Category Archives: Fedora

HOWTO: Create an Active/Passive TEAM device in RHEL7

Let’s say you have a few spare NICs and want to put them together in a/n (active/passive) bond.  What do you do?

This write-up is VERY similar to HOWTO: Create a BOND with RHEL7 – but it’s for teaming.

This is also is pretty straight-forward.

First, connect via SSH to an IP on a NIC that WILL NOT be part of the bond.

Using ‘nmcli’ – remove references to the NICs you want IN the bond and reload nmcli:

[root@rhce ~]# nmcli con del ens224 ens256
Connection 'ens224' (92d6456d-16bd-4eae-9ecb-386cb4ce4d29) successfully deleted.
Connection 'ens256' (e52eca2f-8c84-428d-8959-93e85f4b03f3) successfully deleted.
[root@rhce ~]# nmcli con reload

Next, with nmcli, create the bond:

[root@rhce ~]# nmcli con add type team con-name team0 ifname team0 config '{"runner": {"name": "activebackup"}}'
Connection 'team0' (01567cc6-b2da-42ac-adf8-b9085c3f4309) successfully added.

Time to add the two NICs (ens224 & ens256) in:

[root@rhce ~]# nmcli con add con-name team0-ens224 ifname ens224 type team-slave master team0
[root@rhce ~]# nmcli con add con-name team0-ens256 ifname ens256 type team-slave master team0

Optional (I think, but I still do it), modify the team’d device to have an IP and DNS:

[root@rhce ~]# nmcli connection modify team0 ipv4.address "192.168.1.50/24"
[root@rhce ~]# nmcli connection modify team0 ipv4.dns "192.168.1.1,8.8.8.8"

 

Check the state of the team & see which NIC is active:

# teamdctl team0 state
setup:
  runner: activebackup
ports:
  ens224
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
        down count: 0
  ens256
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
        down count: 0
runner:
  active port: ens224

Looks like ens224 (first NIC) is active; let’s pull the cable, start a PING test, & see what happens:

[root@rhce ~]# ping 192.168.1.50
PING 192.168.1.50 (192.168.1.50) 56(84) bytes of data.
64 bytes from 192.168.1.50: icmp_seq=1 ttl=64 time=0.140 ms
64 bytes from 192.168.1.50: icmp_seq=2 ttl=64 time=0.167 ms
64 bytes from 192.168.1.50: icmp_seq=3 ttl=64 time=0.167 ms
64 bytes from 192.168.1.50: icmp_seq=4 ttl=64 time=0.172 ms
64 bytes from 192.168.1.50: icmp_seq=5 ttl=64 time=0.166 ms
64 bytes from 192.168.1.50: icmp_seq=6 ttl=64 time=0.171 ms
64 bytes from 192.168.1.50: icmp_seq=7 ttl=64 time=0.153 ms
64 bytes from 192.168.1.50: icmp_seq=8 ttl=64 time=0.181 ms
64 bytes from 192.168.1.50: icmp_seq=9 ttl=64 time=0.172 ms
64 bytes from 192.168.1.50: icmp_seq=10 ttl=64 time=0.194 ms
64 bytes from 192.168.1.50: icmp_seq=11 ttl=64 time=0.172 ms
64 bytes from 192.168.1.50: icmp_seq=12 ttl=64 time=0.172 ms
64 bytes from 192.168.1.50: icmp_seq=13 ttl=64 time=0.172 ms
64 bytes from 192.168.1.50: icmp_seq=14 ttl=64 time=0.191 ms
64 bytes from 192.168.1.50: icmp_seq=15 ttl=64 time=0.165 ms
64 bytes from 192.168.1.50: icmp_seq=16 ttl=64 time=0.155 ms

Nothing strange there … what about the team?

[ root@rhce ~]# teamdctl team0 state
setup:
  runner: activebackup
ports:
  ens256
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
        down count: 0
  ens224
    link watches:
      link summary: down
      instance[link_watch_0]:
        name: ethtool
        link: down
        down count: 1
runner:
  active port: ens256

It switched to ens256 & didn’t drop a ping.

Looks like you got an active/passive team working successfully!