Ubuntu: How to do bonding using shell?


I am doing bonding of two interfaces

auto eno1  iface eno1 inet manual  bond-master bond0    auto enp1s0  iface enp1s0 inet manual   bond-master bond0    auto bond0  iface bond0 inet static  address  gateway  netmask  bond-mode balance-rr  bond-miimon 100  bond-slaves enp1s0 eno1  

However, I want to do bonding via shell, as /etc/network/interfaces is Debian specific file.

Looking at https://www.kernel.org/doc/Documentation/networking/bonding.txt found suggestions to include lines like these below to any /etc/modprobe.d/*.conf file.

alias bond0 bonding # just example  options bond0 mode=balance-alb miimon=100  

However one might need to change settings without reloading modules. ifenslave didn't offer help either: could only attach/detach slaves to bonding interface.

Could you show a way to do the task in command prompt without exercising distro-specific ways like /etc/network/interfaces or Fedora's /etc/sysconfig/network-scripts/ifcfg-*?

And yes, one could use ifconfig to set IP configuration and various other data for bonding interfaces but it gives no way to set advanced parameters like those that could be put *.conf file as kernel module options. Also ifconfig doesn't allow to make bond1.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »