RHEL7: Configure network bonding between two RHEL systems.

Share this link

Presentation

There are several ways to configure network bonding in RHEL 7:

  • using the nmtui command and a Text User Interface,
  • using the nmcli command at the Command Line Interface,
  • using the graphical interface,
  • through direct changes in the network configuration files.

For the rest of this tutorial, it is the nmcli option that has been chosen because it’s the quickest method and arguably the least prone to errors.

Prerequisites

To put into practice this tutorial, you need two VM and access to their respective console.
Each VM has been installed with a base distribution (minimal distribution should work but was not tested). Each VM’s got two network interfaces called eth0 and eth1.

If a previous network configuration was set up, remove it on both VM:

# nmcli con show
NAME                UUID                                  TYPE            DEVICE
Wired connection 1  f32cfcb7-3567-4313-9cf3-bdd87010c7a2  802-3-ethernet  eth1  
System eth0         257e9416-b420-4218-b1eb-f14302f20941  802-3-ethernet  eth0  
# nmcli con del f32cfcb7-3567-4313-9cf3-bdd87010c7a2
# nmcli con del 257e9416-b420-4218-b1eb-f14302f20941

Bonding Configuration

Execute the following steps at the console of both VM.

Create the bonding interface:

# nmcli con add type bond con-name mybond0 ifname bond0 mode active-backup
[88934.922710] bonding: bond0: Setting MII monitoring interval to 100.
[88934.923313] bonding: bond0: setting mode to active-backup (1).
[88934.923845] bonding: bond0: Setting ARP monitoring interval to 0.
[88934.924382] bonding: bond0: setting arp_validate to none (0).
[88934.924891] bonding: bond0: Setting primary slave to None.
[88934.925375] bonding: bond0: setting primary_reselect to always (0).
[88934.925920] bonding: bond0: Setting fail_over_mac to none (0).
[88934.926409] bonding: bond0: Setting use_carrier to 1.
[88934.926819] bonding: bond0: Setting ad_select to stable (0).
[88934.927286] bonding: bond0: setting xmit hash policy to layer2 (0).
[88934.927786] bonding: bond0: Setting resend_igmp to 1.
Connection 'mybond0' (304e66f0-c31c-4b57-92e8-734e2b53bdac) successfully added.

Note: If you don’t specify con-name mybond0, the bonding interface will be named bond-bond0.

Add an IPv4 configuration:
In RHEL 7.0:

# nmcli con mod mybond0 ipv4.addresses "192.168.1.10/24 192.168.1.1"
# nmcli con mod mybond0 ipv4.method manual

From RHEL 7.1 on:

# nmcli con mod mybond0 ipv4.addresses 192.168.1.10/24
# nmcli con mod mybond0 ipv4.gateway 192.168.1.1
# nmcli con mod mybond0 ipv4.method manual

Note: If you don’t specify any IP configuration, both VM will get their ip address and gateway through DHCP by default.

Add the eth0 interface to the bonding interface:

# nmcli con add type bond-slave con-name bond0-eth0 ifname eth0 master bond0
[89010.860765] bonding: bond0: making interface eth0 the new active one.
[89010.861336] bonding: bond0: enslaving eth0 as an active interface with an up link.
Connection 'bond0-eth0' (35081742-5962-4edf-8465-6843603d7777) successfully added.

Note: If you don’t specify con-name bond0-eth0, the bonding slave interface will be named bond-slave-eth0.

Add the eth1 interface to the bonding interface:

# nmcli con add type bond-slave con-name bond0-eth1 ifname eth1 master bond0
[89146.655598] bonding: bond0: enslaving eth1 as a backup interface with an up link.
Connection 'bond0-eth1' (037019f3-7115-46a4-a6f9-8fba7bf2adcd) successfully added.

Note: If you don’t specify con-name bond0-eth1, the bonding slave interface will be named bond-slave-eth1.

Activate the bonding interface:

# nmcli con up mybond0
[89222.099283] bonding: bond0: releasing backup interface eth1
[89222.102432] bonding: bond0: releasing active interface eth0
[89222.126862] bonding: bond0: Setting MII monitoring interval to 100.
[89222.127410] bonding: bond0: setting mode to active-backup (1).
[89222.127950] bonding: bond0: Setting ARP monitoring interval to 0.
[89222.128494] bonding: bond0: setting arp_validate to none (0).
[89222.128991] bonding: bond0: Setting primary slave to None.
[89222.129460] bonding: bond0: setting primary_reselect to always (0).
[89222.129964] bonding: bond0: Setting fail_over_mac to none (0).
[89222.130443] bonding: bond0: Setting use_carrier to 1.
[89222.130847] bonding: bond0: Setting ad_select to stable (0).
[89222.131307] bonding: bond0: setting xmit hash policy to layer2 (0).
[89222.131801] bonding: bond0: Setting resend_igmp to 1.
[89222.132219] IPv6: ADDRCONF(NETDEV_UP): bond0: link is not ready
[89222.251450] bonding: bond0: making interface eth1 the new active one.
[89222.252022] bonding: bond0: first active interface up!
[89222.252462] bonding: bond0: enslaving eth1 as an active interface with an up link.
[89222.253641] IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
[89222.305553] bonding: bond0: enslaving eth0 as a backup interface with an up link.
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/70)

Check the configuration:

# nmcli con show
NAME        UUID                                  TYPE            DEVICE
mybond0     304e66f0-c31c-4b57-92e8-734e2b53bdac  bond            bond0
bond0-eth1  037019f3-7115-46a4-a6f9-8fba7bf2adcd  802-3-ethernet  eth1
bond0-eth0  35081742-5962-4edf-8465-6843603d7777  802-3-ethernet  eth0

Source: RHEL 7 Networking Guide.

Additional Resources

The Geek Diary website provides an interesting tutorial about Changing the currently active slave interface online.
The RackSpace developer blog provides a tutorial explaining LACP bonding and Linux configuration on RHEL 7.

(No Ratings Yet)
Loading...
17 comments on “RHEL7: Configure network bonding between two RHEL systems.
  1. abu3lia says:

    Just want to point your attention that if you configure the nics for Bonding you will have issue with iSCSI connectivity, you can override that by enabling the demo mode for the target.

  2. lolloruns says:

    On RHEL 7 official documentation they say you have to load the bonding module first
    modprobe –first-time bonding
    In my CentOS 7.1 I had to activate it the first time.

  3. lisenet says:

    Just FYI, ipv4.gateway is an invalid property on RHEL 7.0 (but it’s available on RHEL 7.2).

    On RHEL 7.0, you would set up a gateway this way:

    # nmcli con mod mybond0 ipv4.addresses “192.168.1.10/24 192.168.1.1”

  4. sumon1142 says:

    Can you make a bond by taking one interface from vm1 and other interface from vm2? The title above seems like that.

    • CertDepot says:

      I don’t think this is possible. Although there could be some confusion in the title, network bonding always means combining two network interfaces from the same machine to a single link.

  5. Carl says:

    Just wanted to now that on RH7.2, setting the interface devices to eth0 and eth1 fails as there are no such devices. The output of nmcli con show shows

    $ nmcli con show
    NAME UUID TYPE DEVICE
    mybond0 48a3e640-5605-430b-872a-f05b6312da05 bond bond0
    bond0-eth0 9a1ca8f7-7c3f-4715-8a0b-85287809570d 802-3-ethernet —
    bond0-eth1 0628ec00-40af-4524-ad96-66a048bc2f6f 802-3-ethernet —

    No devices are attached to the two bonds. The interfaces, at least for my VM, are eno16777984 instead of eth0 and ens192 instead of eth1. Once I used the correct device names, I was able to remotely log in to the VM.

    $ nmcli con show
    NAME UUID TYPE DEVICE
    bond0-eth0 9a1ca8f7-7c3f-4715-8a0b-85287809570d 802-3-ethernet eno16777984
    bond0-eth1 0628ec00-40af-4524-ad96-66a048bc2f6f 802-3-ethernet ens192
    mybond0 48a3e640-5605-430b-872a-f05b6312da05 bond bond0

    • CertDepot says:

      The network interface names depend on your hardware. As most of the instructions here are given for a virtualized environment, it is normal to use the eth0 and eth1 because it’s what you can find in this kind of environment.

      • Lisenet says:

        I agree with CertDepot, it would be impractical to use anything but a ‘traditionally’ named network device of eth0 (eth1 and so on) for reference purposes.

        We are all aware that RHEL7 comes with the predictable network interface device names, however, there are endless combinations these can get generated depending on hardware one uses.

        Sticking to traditional naming helps to avoid confusion, as otherwise people would start reporting devices that don’t exist on their systems because hardware don’t math.

        • Carl says:

          This is me and my environment of VMWare virtual machines and Dell and HP physical machines, but for my environment at work, none of the Red Hat 7 systems have had eth0 or eth1 interfaces. That’s used with older Red Hat systems. My physical RHEL6 systems use em1_1 and p1p1 for onboard and pci cards. Virtual do use eth0 and eth1 though. With RH7, even my virtual machines are now using the ens192, ens224, and ens256 device names plus the eno one. That was annoying because an OS update to one of my VMs changed the eno interface to ens and I had to reconfigure. But anyway, I would suggest at least calling out that RH7, at least in my experience, aren’t using the ethn device names any more.

          • Lisenet says:

            That’s exactly what I said Carl. RH7 uses the predictable network interface device names, and different hardware generates different names. For blogging purposes, it’s best to stick to traditional naming of eth0, eth1 etc.

          • Sam says:

            Carl, I can see where you are coming from. I think the question you are asking is why. The answer is progress. Issues like this occur when upgrading any Operating System.

            If you have a Server as a firewall, with two interfaces, on reboot, with the naming system, the interfaces could swap, and obvious security implications.

            Eth0 set as an Internal Network
            Eth1 set as an External Network

            Relating each interface to a physical name (see Red Had Documentation Network Guide Ver 7 Chapter 8) removes this problem.

Leave a Reply

Upcoming Events (Local Time)

There are no events.

Follow me on Twitter

Archives

vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |