]> git.proxmox.com Git - mirror_ifupdown2.git/commit
addons: vlan: error out when vlan-raw-device config change on existing vlan
authorJulien Fortin <julien@cumulusnetworks.com>
Thu, 9 Aug 2018 13:46:16 +0000 (15:46 +0200)
committerJulien Fortin <julien@cumulusnetworks.com>
Thu, 13 Dec 2018 22:43:57 +0000 (14:43 -0800)
commit7114342b2595d4b2f7fd151ca32f6172f88a919d
tree688f187a8cf5dd38927bb64b54887c8084a18f2b
parent8329d2b8af7723a1d8f975270525d33b7627654f
addons: vlan: error out when vlan-raw-device config change on existing vlan

kernel doesn't support vlan raw-device change on existing vlan, user needs to
manually ifdown/ifup the device

[13:45:06] root:~ # ifquery vlan42
auto vlan42
iface vlan42
      address 42.42.42.42/24
      vlan-id 42
      vlan-raw-device swp1

[13:45:07] root:~ # ifup -a
[13:45:09] root:~ # echo $?
0
[13:45:10] root:~ # ip link show vlan42
34: vlan42@swp1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
    link/ether 90:e2:ba:2c:b1:96 brd ff:ff:ff:ff:ff:ff
[13:45:13] root:~ # nano /etc/network/interfaces
[13:45:19] root:~ # ifquery vlan42
auto vlan42
iface vlan42
      address 42.42.42.42/24
      vlan-id 42
      vlan-raw-device swp2

[13:45:25] root:~ # ifreload -a
error: vlan42: cannot change vlan-raw-device from swp1 to swp2: operation not supported. Please delete the device with 'ifdown vlan42' and recreate it to apply the change.
[13:45:27] root:~ # echo $?
1
[13:45:30] root:~ #

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
ifupdown2/addons/vlan.py