======OS - Linux - Networking - Bonding - Notes====== [[http://www.cloudibee.com/network-bonding-modes/|CloudiBee - Linux Network bonding – setup guide]] Check the status of a bond: cat /proc/net/bonding/bond0 Source:[[https://kudithipudi.org/2010/07/30/how-to-check-status-of-bond-interface-in-linux/|Kudithipudi.org - HOW TO : Check status of bond interface in Linux]] Change active slave in an active/backup bond (to em1): ifenslave -c bond0 em1 Source:[[https://www.thegeekdiary.com/redhat-centos-how-to-change-currently-active-slave-interface-of-bonding-online/|The Geek Diary - RedHat / CentOS : How to change currently active slave interface of bonding online]] Change the active slave in an active/backup bond on older versions of Linux: # Remove the currently active interface from the bond echo -eth1 > /sys/class/net/bond0/bonding/slaves # Re-add the interface to the bond echo +eth1 > /sys/class/net/bond0/bonding/slaves Source:[[http://blog.erben.sk/2010/09/10/how-to-change-active-slave-when-running-bonding-active-backup/|blog.erben.sk - How to change Currently Active Slave when runnning bonding in active-backup mode]] =====Create a bond (with vlan) on the commandline===== With ifconfig and vconfig: ifconfig eth2 down ifconfig eth3 down ifconfig bond0 up ifenslave bond0 eth2 eth3 vconfig add bond0 4 ifconfig bond0.4 10.20.4.200 netmask 255.255.255.0 ifconfig eth2 up ifconfig eth3 up ifconfig bond0.4 up With (only) ip: ip link set dev eth2 down ip link set dev eth3 down ip link add bond0 type bond ip link add link bond0 name bond0.4 type vlan id 4 ip address add 10.20.4.200/24 dev bond0.4 ip link set eth2 master bond0 ip link set eth3 master bond0 ip link set dev eth2 up ip link set dev eth3 up ip link set dev bond0 up ip link set dev bond0.4 up Sources: * [[https://developer.ridgerun.com/wiki/index.php/Network_Interface_Bonding|RidgeRun Developer Wiki - Network Interface Bonding]] * [[https://sysadmincorner.wordpress.com/2012/04/06/configuring-vlan-interfaces-in-linux/|System Administrators Corner - Configuring VLAN interfaces in Linux]] * [[https://michlstechblog.info/blog/linux-configure-an-interface-for-a-tagged-vlan-by-ifconfig/| Michls Tech Blog - Linux: Configure an interface for a tagged vlan by ifconfig]] * [[https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-vlan_on_bond_and_bridge_using_ip_commands|Red Hat - Enterprise Linux 7 - 10.6. VLAN on Bond and Bridge Using ip Commands]]