yum install vconfigmodprobe 8021qlsmod | grep -i 8021qvconfig add eth1 51ifconfig eth1.51 up可以使用cat /proc/net/vlan/eth1.51查看eth1.51参数 配置网络信息ifconfig eth1 0.0.0.0 ifconfig eth1.51 192.168.51.250 netmask 255.255.255.0 up 删除VLAN命令vconfig rem eth1.51 将VLAN信息写入配置文件,开机加载8021q模块 echo "modprobe 8021q" >> /etc/rc.local 创建vlan连接vlan的vlan id号要对应才能连接配置文件/etc/sysconfig/network-scripts/ifcfg-ethx.y其中:x表示: 具体物理网卡号y表示: vlan的vlan号,即vlan ID 配置文件要求:1. 必须包含VLAN=yes2. 接口名必须为ethx.y,y表示vlan ID,要与实际的对应3. MAC地址不需要指定 创建配置文件/etc/sysconfig/network-scripts/ifcfg-eth1.51文件内容如下:DEVICE=eth1.51VLAN=yesBOOTPROTO=staticONBOOT=yesIPADDR=192.168.51.250NETMASK=255.255.255.0GATEWAY=192.168.51.1