ubuntu下配置vlan设备

添加vlan设备(如eth4为万兆口)

$ ip link add link eth4 name vlan1000 type vlan id 1000

配置vlan地址,如ceph为192.168.1.0网络

$ ip add addr 192.168.1.xxx(xxx最好和千兆口网络地址一致,避免冲突)

配置设备地址长期生效,写入配置文件

$ cat /etc/network/interfaces
...
auto vlan1000
iface vlan1000 inet static
 address 192.168.1.xxx
 netmask 255.255.255.0
 vlan-raw-device eth4

启动设备

$ ip link set dev eth4 up
$ ip link set dev vlan1000 up

results matching ""

    No results matching ""