类似下面的条目(用于 OpenStack 提供商网络)在 14.04 中有效。但在 16.04 中无效。虽然“#vconfig add enp3s0 99”有效,但我需要永久条目。
---- /etc/network/interfaces excerpt ----
auto enp3s0.99
iface enp3s0.99 inet manual
up ip link set dev $IFACE up
down ip link set dev $IFACE down
答案1
添加“vlan-raw-device enp3s0”可解决问题。如下所示:
---- /etc/network/interfaces excerpt ----
auto enp3s0.99
iface enp3s0.99 inet manual
vlan-raw-device enp3s0
up ip link set dev $IFACE up
down ip link set dev $IFACE down
答案2
以前我只能使用 VLAN 命名接口来使其工作。
auto vlan99
iface vlan99 inet static
vlan-raw-device eth0
我确认子接口符号也适用于更高级的配置;
auto bond1
iface bond1 inet manual
bond-mode 4
bond-miimon 100
bond-lacp-rate 1
bond-slaves eno3 eno4
auto bond1.17
iface bond1.17 inet manual
vlan-raw-device bond1
up ip link set dev $IFACE up
down ip link set dev $IFACE down
auto bond1.18
iface bond1.18 inet manual
vlan-raw-device bond1
up ip link set dev $IFACE up
down ip link set dev $IFACE down
auto cloudbr0
iface cloudbr0 inet manual
bridge_ports bond1.17
bridge_fd 5
bridge_stp off
bridge_maxwait 1
auto cloudbr1
iface cloudbr1 inet manual
bridge_ports bond1.18
bridge_fd 5
bridge_stp off
bridge_maxwait 1`