Main Menu

Search

Showing posts with label Network bond. Show all posts
Showing posts with label Network bond. Show all posts

LINUX: How To Remove & Reload Particular Network Bond on Linux Hosts?

Below are steps for removing and reloading particular network bond on Linux hosts

1. Bring down the network bond using below command. Replace bondX with the bond number you want to remove and reloading.

ifdown bondX

2. Run below command to remove the bonding during the runtime. This command just removes the loaded bonds during runtime, it does not complete remove the bonds.
modprobe -r bonding

3. Bring up the network bond again using below command. Replace bondX with the bond number.

ifup bondX

Products to which Article Applies

All Linux Operating Systems

Additional Reference

https://wiki.linuxfoundation.org/networking/bonding

 

LINUX: "ip addr" or "ip a" Command To List All Network Interfaces & IP Addresses In Linux (How To Doc)

Below "ip addr" or "ip a" commands can be used to list all network interfaces & IP addresses in Linux.
ip addr | grep -i global

ip a | grep -i global

Below is example output of above commands showing network bonds and their IP addresses.

# ip a | grep global
inet 192.168.20.6/24 brd 192.168.20.255 scope global bond1
inet 192.168.21.6/24 brd 192.168.21.255 scope global bond2
inet 192.168.23.6/24 brd 192.168.23.255 scope global bond0

Products to which Article Applies

All Linux Operating Systems

LINUX: How To Change MTU Setting Value for Network Bonds/Interfaces Dynamically Without Reboot? ("ip link" Command)

Below command can be used to change MTU setting value for Network bonds/interfaces dynamically without reboot.
ip link set dev <bond/interface name> mtu <value>

For e.g. if you want MTU value for network bond bond0 as 64000, your command looks as follows:


ip link set dev bond0 mtu 64000


Products to which Article Applies

All Linux Operating Systems

Additional Reference

https://www.cyberciti.biz/faq/how-can-i-setup-the-mtu-for-my-network-interface/
http://www.tldp.org/test/en/linux-ip/apbs03.html


Oracle VM Manager (OVMM): List Network Bonds of All Servers / Dom0 Hypervisors managed by OVM Manager in OVM CLI (How To Doc)

Below are steps for listing Network Bonds of All Servers / Dom0 Hypervisors managed by OVM Manager in OVM CLI.

1. From the host running OVM Manager, login to OVM Shell CLI prompt using "admin" user by running below command.

 ssh admin@localhost -p 10000

When prompted for password, enter OVM "admin" user password. After successful login you will be in OVM shell prompt "OVM>".

2. In OVM CLI prompt, run below "list bondport" command. This will list Network Bonds of All Servers / Dom0 Hypervisors managed by OVM Manager.

list bondport

Below is example output of above command.

  id:0004fb000xxyyzzaab4f999cb0f407718  name:bond0 on ovm-server-01.testcompany.com
  id:0004fb000xxyyzzaa9a40b09c932a347f  name:bond3 on ovm-server-01.testcompany.com
  id:0004fb000xxyyzzaad2183601f492caed  name:bond4 on ovm-server-01.testcompany.com
  id:0004fb000xxyyzzaa34b891b71c5d7391  name:bond1 on ovm-server-01.testcompany.com
  id:0004fb000xxyyzzaa577e48ae2c7957c1  name:bond2 on ovm-server-01.testcompany.com
  id:0004fb000xxyyzzaa2054669136a6768e  name:bond6 on ovm-server-04.testcompany.com
  id:0004fb000xxyyzzaaaf82b99716165da0  name:bond6 on ovm-server-01.testcompany.com
  id:0004fb000xxyyzzaabe4b5b57b030eb42  name:bond5 on ovm-server-01.testcompany.com
  id:0004fb000xxyyzzaa20b2c3c9babe6cf8  name:bond3 on ovm-server-04.testcompany.com
  id:0004fb000xxyyzzaada9c68aef0d8b2bd  name:bond2 on ovm-server-04.testcompany.com
  id:0004fb000xxyyzzaaabf16c589aebd754  name:bond5 on ovm-server-04.testcompany.com
  id:0004fb000xxyyzzaa68058a8a13818b7b  name:bond4 on ovm-server-04.testcompany.com
  id:0004fb000xxyyzzaaf4ce997bb30e789d  name:bond1 on ovm-server-04.testcompany.com
  id:0004fb000xxyyzzaa5fec6867f06ff6ce  name:bond0 on ovm-server-04.testcompany.com
  id:0004fb000xxyyzzaaa16cf250201b1dd1  name:bond5 on ovm-server-03.testcompany.com
  id:0004fb000xxyyzzaacd1396f7f335864b  name:bond6 on ovm-server-03.testcompany.com
  id:0004fb000xxyyzzaa23d126c4984878b6  name:bond3 on ovm-server-03.testcompany.com
  id:0004fb000xxyyzzaa49ba4078817da495  name:bond4 on ovm-server-03.testcompany.com
  id:0004fb000xxyyzzaab1281ee75c3e68d6  name:bond1 on ovm-server-02.testcompany.com
  id:0004fb000xxyyzzaad21e61585009491a  name:bond0 on ovm-server-02.testcompany.com
  id:0004fb000xxyyzzaaf075340a2b49f9c3  name:bond5 on ovm-server-02.testcompany.com
  id:0004fb000xxyyzzaa61f5ee5acd3b64a4  name:bond4 on ovm-server-02.testcompany.com
  id:0004fb000xxyyzzaab0f7d969be0d1cee  name:bond3 on ovm-server-02.testcompany.com
  id:0004fb000xxyyzzaa288dfeb95dca7467  name:bond2 on ovm-server-02.testcompany.com
  id:0004fb000xxyyzzaacfd4b7100025f4ef  name:bond1 on ovm-server-03.testcompany.com
  id:0004fb000xxyyzzaaa7d8e8e01379686a  name:bond2 on ovm-server-03.testcompany.com
  id:0004fb000xxyyzzaa54eebe7df3eefbae  name:bond6 on ovm-server-02.testcompany.com
  id:0004fb000xxyyzzaa6205dbec676732e4  name:bond0 on ovm-server-03.testcompany.com


Products to which Article Applies

Oracle VM Manager Version 3.3.X & Above Versions  


Additional Reference

https://community.oracle.com/docs/DOC-914735

Linux: How To Do Network Bond Interfaces Failover Testing?

Procedure provides detailed steps for testing the Linux bond failover for Linux environments where there are multiple slaves set for each network bond for high availability.

For e.g. if you have network bond bond0 which has bonding configuration file /etc/sysconfig/network-scrips/ifcfg-bond0 file with below entries.

DEVICE=bond0
ONBOOT=yes
MASTER=yes
IPADDR=10.10.10.20
NETMASK=255.255.255.0
GATEWAY=10.10.240.240
BONDING_OPTS="mode=1 miimon=100"
TYPE=Ethernet

And lets assume you have two slaves eth0 and eth1 for bond0 with below entries inside ifcfg-eth0 and ifcfg-eth1.

ifcfg-eth0

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes 


ifcfg-eth1

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes 

So you want to do network bond failover testing for bond0 by shutting down on slave (eth0 or eth1) at a time, below are the steps to follow.


1. Open a command window on local windows machine and do continuous pings to Linux Host using below command to the bond0 IP address, In this case IP will be 10.10.10.20

ping -t <IP>

2. Now list the slaves for network bond interface using below command. In this example bondX will be bond0.

cat /proc/net/bonding/bondX

You will see that both the slaves will be up, they can in active-active or active-backup mode based on the bonding options.


3. Bring down one the slaves slave as follows. It can be either eth0 or eth1

ip link set dev <slave> down

Wait for about 15 seconds. Check the slaves of bond using below command

cat /proc/net/bonding/bondX

You will see one of the slaves as down which you brought down.Check if there are any issues with the ping tests from windows command prompt from step (1)


4. Bring up the slave you brought down in above step (3) using below command

ip link set dev <slave> up

Wait for 15 seconds and then run below command, replace bondX as needed with bond/interface name.

cat /proc/net/bonding/bondX

You will see both the slaves up now.


5. Now bring down the other slave now by running below command

ip link set dev <slave> down

Wait for about 15 seconds and then run below command.

cat /proc/net/bonding/bondX

You will see one of the slaves as down which you brought down in step (5). Check if there are any issues with the ping tests in above step (1).


6. Now bring back slave you stopped in above step (5) again by running below command.

ip link set dev <slave> up

Wait for about 15 seconds and then run below command.

cat /proc/net/bonding/bondX

You will see both the slaves up.



Products to which Article Applies


For this tutorial, the steps were tested on Oracle Linux. But the steps are applicable also to CentOS and Red Hat OS.

Additional Reference

https://www.cyberciti.biz/faq/linux-ip-command-examples-usage-syntax/
https://www.howtoforge.com/tutorial/how-to-configure-high-availability-and-network-bonding-on-linux/