1.增長vlan服務器
[root@localhost ~]# ip link add link em1 name em1.100 type vlan id 100 網絡
[root@localhost ~]# ip link add link em1 name em1.200 type vlan id 200 ide
[root@localhost ~]# ip addr add 192.168.100.1/24 dev em1.100 brd +接口
[root@localhost ~]# ip addr add 192.168.200.1/24 dev em1.200 brd +ip
[root@localhost ~]# ip link set em1.100 up路由
[root@localhost ~]# ip link set em1.200 up it
其中em1爲dell服務器的網卡接口名稱,在em1上增長兩個vlan,並設置ip地址,啓用兩個虛擬接口class
2.查看vlan配置
[root@localhost ~]# ip link showroute
[root@localhost ~]# ip addr show
3.刪除vlan
[root@localhost ~]# ip link delete em1.100 type vlan
[root@localhost ~]# ip link delete em1.200 type vlan
4.開啓vlan間路由
只要設置ip_forward爲1便可互相通訊,
經過iproute2的ip 命令能夠取代vconfig,ifconfig,route等原始網絡配置命令。