tools used:vconfig
New file: /etc/sysconfig/modules/8021q.modules
process: (In VLAN11,VLAN22 Bridge and eth0 as an illustration )
1. Modify the eth0 configuration file as follows:
Device=eth1
Onboot=yes
2. Create a new virtual network card configuration file ifcfg-eth1.10
device= eth1.10
Bootproto=static
ipaddr=192.168.11.20
netmask=255.255.255.0
Onboot=yes
Vlan=yes must have this configuration or the VLAN NIC will not boot after a system reboot
3. Gateway configuration file
[Email protected] ~]# cat/etc/sysconfig/network
Networking=yes
Hostname=vlan
gateway=192.168.11.1
4. load the 802.1q module and add it to the boot load
[Email protected] ~]# modprobe 8021q
Vim /etc/sysconfig/modules/8021q.modules
modprobe 8021q >/dev/null 2>&1
[email protected] ~]# chmod +x /etc/sysconfig/modules/8021q.modules
5. Create a new virtual network card and write to boot
[[email protected] ~]# vconfig add eth1 10
6. Restart the network or manually start eth1.10
[Email protected] ~]# service network restart
This article is from the "technical Discrimination" blog, please be sure to keep this source http://emg2012.blog.51cto.com/3705315/1651153
Linux NIC configuration vlan tag