LoginSignup
5
4

More than 5 years have passed since last update.

Ubuntu/Debianにおいて再起動無しでLinux Bonding(VLAN-tagged)を構成するための黒魔術

Posted at

/etc/network/interfacesを以下のように編集してタグVLANがついたbondインターフェースを構成する場合、一度再起動する必要があると、ずっと思っていた。

$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto bond0
iface bond0 inet manual
        mtu 1500
        bond-mode balance-alb
        bond-miimon 100
        bond-slaves em1 em2

auto bond0.1234
iface bond0.1234 inet static
        address 10.x.y.50
        netmask 255.255.255.0
        gateway 10.x.y.1
        network 10.x.y.0
        vlan_raw_device bond0

auto em1
iface em1 inet manual
bond-master bond0

auto em2
iface em2 inet manual
bond-master bond0

1234は、VLANのIDである。

上記のNIC構成の場合、rootユーザで以下のコマンドを打つことで、再起動を避けることが可能である。

$ ifdown bond0 && ifup bond0 && ifup em1 && ifup em2 && ifup bond0.1234
5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4