1)、安装vconfig包
yum install vconfig
2)、在内核加载802.1q模块
modprobe 8021q
lsmod |grep -i 8021q (查看模块是否加载)
3)、配置vlan接口并且做桥接
vconfig add em1 13
cat /etc/sysconfig/network-scripts/ifcfg-em1.13
DEVICE=em1.13
ONBOOT=yes
BOOTPROTO=static
TYPE=ethernet
VLAN=yes
BRIDGE=br0
cat ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
IPADDR=60.10.118.19
NETMASK=255.255.255.240
ONBOOT=yes
vconfig add em1 11
cat /etc/sysconfig/network-scripts/ifcfg-em1.11
DEVICE=em1.11
ONBOOT=yes
BOOTPROTO=static
TYPE=ethernet
VLAN=yes
BRIDGE=br11
cat ifcfg-br11
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
IPADDR=60.10.118.10
NETMASK=255.255.255.240
ONBOOT=yes
时间: 2024-10-10 23:00:05