Understanding “Network Bonding/Teaming” in Redhat Linux

How to configure Network Bonding/Teaming in Red Hat Linux

As a system admin we would like to avoid the server down by having the redundancy for the “/” filesystem by using the RAID technology(MIRRORING THE DATA), then multiple FC links to SAN technology with the help of Multipathing software and many more.How do you provide the redundancy in network level?As all, we know having multiple network card (NIC) will not provide any redundancy if either  NIC1 or NIC2  failed then it may lead to network downstate.

In RedHat Linux with the help of Bonding/Teaming, we could accomplish the network level redundancy.Once you have configured the bonding with the help of two NIC cards, then any failure occurs on any one of the NIC cards the kernel will automatically detect the failure of NIC  and it works safely without any issues.Bonding could be also used for the load sharing between the two physical Links.

The dig shows how Bonding is working

Let me show now how to configure network bonding in RHEL

Task: Configure Network bonding between eth0 and eth1 with name of bond0

Bonding driver: Linux allows binding of multiple network interfaces in to a single channel  NIC by using kernel module called Bonding
Tips: The behavior of the bonded interface depends upon the mode(mode provides either hot standby or load balancing service.

Make sure you have two physical Ethernet cards available in your Linux server

Step:1 Check the network adapter details
#ifconfig |grep eth

As you can see from the above output we have two Network adapters with the logical name eth0 and eth1.

Step:2 Edit the configuration file for both the ethernet cards as follows
#vi  /etc/sysconfig/network-scripts/ifcfg-eth0

add the following lines inside this file

Do the same for another interface eth1

Step:3 Create a “bond0” configuration file
#vi  /etc/sysconfig/network-scripts/ifcfg-bond0

add the following parameter as shown below

you will not find the /etc/modprobe.conf in RHEL6, so you need to define your bonding option inside the above configuration file(highlighted with yellow box)

We can configure NIC bonding for various purpose, so when you do the configuration you will have to specify the purpose for which you want to use the bonding.Here are the modes available with the bonding

1.balance-rr or 0: Set a  round-robin policy for fault tolerance and load balancing.Transmissions are received and sent out sequentially on each bonded slave interface beginning with the first one available.

2.active-backup or 1: Set an active-backup policy for fault tolerance.Transmissions are received and sent out via the first available bonded slave interface, another bonded slave interface is only used when the active bonded slave interface fails.

3.balance -xor or 2: Sets an exclusive policy for fault tolerance and load balancing.In this method, the interface matches up the incoming request’s MAC address with the MAC address for one of the slave NIC’s.Once the link is established, transmissions are sent out sequentially beginning with the first available interface

4.broadcast or 3: Sets broadcast policy for the fault tolerance, All transmissions are sent on all slave interfaces.

Understanding miimon in network bonding: It specifies(in milliseconds) how often MII link monitoring occurs.This is very much useful when high availability is required because  MII is used to verify that the NIC is active.

 

To  check that the driver for a particular NIC  supports the MII tool,run the following command
#ethtool  <interface name> |<grep "Link detected"

#ethtool   eth0 |grep "Link detected"

as you can see from the above screenshot driver supports the MII tool.

Step:4 Load the bonding module
#modprobe  bonding

Step:5 Restart the network interface to make the changes update
#service network restart

Step:6  Confirm whether your  configuration is working properly or not by using the following command
#cat /proc/net/bonding/bond0

As you can see from the above screenshot, NIC bonding interfaces are in active state.

Step:7 Verify whether “bond0” interface has come up with IP or not
#ifconfig -a

The above screenshot has confirmed the bonding interface has the IP address and it is in running state.

You can also notice eth1 and eth2  have flag “SLAVE” and for bond0 interface has flag “MASTER”

To verify the current bonding mode, run the following command

#cat  /sys/class/net/bond0/bonding/mode

From the above output, the current mode is balance-rr  or 0

To check the currently configured bonds
#cat  /sys/class/net/bonding_masters

The above screenshot says we have one master bond with the name “bond0”

Note: So from now onwards even if anyone of your NIC adapter failed, the bond0 interface will continue running and provides the uninterrupted service to the clients. The failed interface flag will be changed to “down”  state and after resolving the issue with the failed interface the flag again will change its state to “Running”.

I hope you have enjoyed this article, Kindly subscribe 👉🏿👉🏿 Click this link to Subscribe

Never miss any updates from my blog do like my FB page here 👉🏿👉🏿Learn Linux in an easier way

 

**********************Thank you**************************************************************************

How to configure IP address in RHEL server?

Introduction

In this article we are going to cover how to configure the IP address and what all are the initial checks up we need to perform before you configure the IP address.

Every system in a network needs an IP address to communicate with another system, it can be easily configured in RHEL with the help of “ifconfig” command.

Types if IP:

IP address can be configured in two ways

1)Static IP

2)Dynamic IP

Static IP:

The IP can be configured manually by the system administrator or by individuals.Static IP mostly use with the devices like router, printer etc…

Dynamic IP:

In this method, the IP address is automatically configured from the DHCP server, when you set the IP should configure automatically in the network management tool then the system will call the DHCP server for the IP address, DHCP service provides the IP address to the system when it joins the network.

Procedure to configure the IP address:

1)Check how many adapters available and its status from your server

2)Choose the adapter to which you are going to configure

3)Deactivate the network adapter before you assign IP address

4)Configure the IP with the help of “ifconfig” command

5)Make the assigned IP address permanent with the help of “setup” command.

6)After assigned the IP address permanently to the network management file activate the network adapter.

Configure the IP address:

Method: Static IP

To check the network adapter status:
#ifconfig

from the above output, we have only one adapter connected to the server and the logical name for the network adapter is “eth0”, the current IP address for the adapter is 10.0.2.15 and the adapter is in running state.

eth0 –>eth indicates the adapter manufacturer name and “0” indicates the first adapter .if  the server is having two network adapter means it would display as eth1.

Note: You don’t have to worry about the  adapter names and numbers since the kernel device driver will generate all these by default.

To deactivate the network adapater:

syntax:

#ifdown   <Network adapatername>
#ifdown   eth0

Now check the network adapter status whether it is successfully deactivated or not

#ifconfig

From the output, eth0 adapter has been turned in to deactivated mode successfully

Now let us configure the IP address to the eth0 adapter by  using the following command:

syntax:

#ifconfig   <Network adapter>  <ipaddress>
#ifconfig  eth0   10.250.1.50

Check whether the IP is assigned to the eth0 adapter

#ifconfig  eth0

from the output, you could see the IP 10.250.1.50 has been successfully assigned

Note: Now if you deactivate the adapter , next time when you bring it back to the activate state, the IP will get assigned from the DHCP service.This is the default mode in RHEL.Below is the screenshot how the IP get assigned automatically after deactivate and activate the eth0 adapter👇👇

Now its time to make this ip address permanent by using the following command
#setup

From this tool choose the network configuration

Now choose edit devices

Choose the eth0 device from the option

Now check the default setting for the network adapter devices

From the above screenshot, you could find the default mode to configure the IP is in DHCP always.

Now Unselect the DHCP mode and add your static IP here to make it permanent one

Note: Use spacebar from your keyboard to deselect the DHCP

We have now successfully added the static IP 10.250.1.50 to the adapter eth0.

That’s it…Now save the information and exit the network management tool

 

Now activate the network adapater:

syntax:

#ifup  <network adapater>
#ifup  eth0

So from now onwards 10.250.1.50 is the default IP address for your server , even after restart , deactivate and activate the adapter this IP would be the permanent one.

#ifconfig eth0

From the above output, the IP has been permanently activated with the static method.

Note:

If you forget to add the IP address in the network management with the “setup” command then the assigned IP would be a temporary one,if you do a restart or deactivate and activate the adapter it will assign the IP from the DHCP server since in RHEL the default mode after restart or activate the network adapter will be in Dynamic IP mode.

Tips and tricks:

*If you are facing issues while you bringing up your network adapter or assigning the IP address just try to restart the network management service

#service NetworkManagement restart

The above command will do a refresh on all the network adapter configuration files and then try to configure or activate the adapter.

I hope you have enjoyed this article, in our next tutorial I will explain you the troubleshooting concepts in IP configuration.

Never miss any article from this blog ,Kindly do like my FB page 👉👉  Learn Linux in a easier way

*************************************************************************************************************************************

If you found this article useful, Kindly Subscribe here 👉🏿👉🏿Subscribe here

Visit and Subscribe My Youtube Channel for More Videos  https://youtu.be/6vYQYY_zL0o