1. Edit the file/etc/sysconfig/network
Add a line inside:
Vlan=yes
2. The configuration file ifcfg-eth1.10 and ifcfg-eth1.240 that are regenerated into the NIC device
Cd/etc/sysconfig/network-scripts
CP Ifcfg-eth1 ifcfg-eth1.10
CP Ifcfg-eth1 ifcfg-eth1.240
3. editing files ifcfg-eth1.10 and ifcfg-eth1.240
The syntax that resembles writing ifcfg-eth1 in it is matching this server's IP address, netmask, network, and so on 192.168.10 network segment and 192.168.240 segment
Note: The two files of the device will be changed to eth1.10 and eth1.240 (these two files are copied by ifcfg-eth1, so it should be eth1)
4. Re-edit Ifcfg-eth1
VI ifcfg-eth1
Delete ippaddress, NETMASK, network This is a few lines related to IP address
Everything's OK. Whether it's/etc/rc.d/init.d/network restart or reboot, you'll get a system that goes straight through the 192.168.10 network segment and with the 192.168.240 segment.
Linux adds VLAN NIC configuration