Under Linux, you can use Vconfig to manage VLAN virtual appliances as long as the system kernel supports it
1. Check the Environment first
Lsmod grep 290220 14384 1 18542 1 8021q
2, Installation Vconfig
Yum Install -y vconfig
3. Configuring the VLAN interface
For example, configure VLAN 2202 at the eth2 port
22022202 to IF-:eth2:-
Pull the interface up and set the IP
IP link set dev eth2.2202 up207: Eth2.2202@eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU theQdisc noqueue State uplink/ether Fe:fc:fe: the: 1c: +BRD FF:FF:FF:FF:FF:FFIP A add192.168.202.101/ -Dev eth2.2202207: Eth2.2202@eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU theQdisc noqueue State up link/ether Fe:fc:fe: the: 1c: +BRD ff:ff:ff:ff:ff:ff inet192.168.202.101/ -Scope Global eth2.2202Valid_lft Forever Preferred_lft forever Inet6 fe80::fcfc:feff:fe68:1c78/ -scope link tentative valid_lft forever preferred_lft Forever
Of course, you can also use the Ifconfig command, a line command to pull up and set the IP
ifconfig eth2. 2202 192.168. 202.101 255.255. 255.0 192.168. 202.255 up
At this point, the VLAN environment is configured successfully with packets emitted from this interface with vlan2202 tags.
4. Delete VLAN
The delete command is as follows
IP link Set eth2.2202 down
Vconfig REM eth2.2202
Configuring VLAN environments with Vconfig under "VLAN" Linux