通过vconfig命令配置VLAN

#yum install vconfig  安装vconfig命令包

#modprobe 8021q 加载8021q模块,若不支持8021q模块,则不支持VLAN

#lsmod |grep -i 8021q

 

#vconfig add eth0 100  在eth0上配置VLAN 100

#vconfig add eth0 200  在eth0上配置VLAN 200

#vconfig set_flag eth0.100 1 1 设置VLAN的REORDER_HDR参数

#vconfig set_flag eth0.200 1 1 设置VLAN的REORDER_HDR参数

 

 

#ifconfig eth0.100 192.168.1.8 netmask 255.255.255.0 up   配置网络命令

#ifconfig eth0.100 192.168.2.8 netmask 255.255.255.0 up   配置网络命令

 

#ip link set eth0.100 down

#vconfig rem eth0.100   删除VLAN命令

posted @ 2024-05-27 10:56  Sky_Liao  阅读(376)  评论(0编辑  收藏  举报