VLAN tagging on Bonding interfaces for Ubuntu Servers
Firstly, install vlan and bonding packages on the Ubuntu server:
1 2 |
apt-get install vlan apt-get install ifenslave |
Enter these linesĀ on /etc/modules because we want to enable the modules at startup.
1 2 |
8021q bonding |
If there is no network connection, you need to install these packages from CDROM or install these packages while OS setup. This configuration can be used for bonding and VLAN tagging on server. You can define additional VLAN interfaces. This configuration if for Active-Passive interfaces. We need to define primary interface as seen in eth0. If you do not want to configure your physical switch or do not want to struggle with your network administrator, this is the best way. When eth0 is lost, your secondary interface (eth1 in this example) will be used. If you want to use active-active setup, the best way is to setup LACP bonding, but you need to configure your physical switch ports for LACP.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
auto lo iface lo inet loopback auto bond0 iface bond0 inet manual bond-mode 1 bond-miimon 100 bond-slaves none auto eth0 iface eth0 inet manual bond-master bond0 bond-primary eth0 auto eth1 iface eth1 inet manual bond-master bond0 auto bond0.430 iface bond0.430 inet static address 172.16.1.11 netmask 255.255.255.0 gateway 172.16.1.254 dns-nameservers 172.16.1.254 vlan-raw-device bond0 |
bond0 is your bonding interface. bond0.430 is your VLAN tagged bonding interface. 430 is your VLAN. If you want to check bonding status, you can check here:
1 |
cat /proc/net/bonding/bond0 |