Configuring bonding connections and teaming connections using NMCLI

Source: Internet
Author: User

I. Mode of bonding

1.BALANCE-RR: Polling Mode

2.active-backup: Hot Standby mode

3.broadcast: Broadcast mode

Two. Configuration steps (Command configuration)

1. Create the main interface

Nmcli con Add type Bond con-name BOND0 ifname bond0 mode active-backup

2. Assigning an IP address to the main interface

Nmcli con mod bond0 ipv4.addresses ' 192.168.0.100/24 '

Nmcli con mod bond0 ipv4.method Manual

3. Create a Slave interface

Nmcli con Add type bond-slave ifname eno1 master bond0

Nmcli con Add type bond-slave ifname Eno2 master bond0

4. Turn on the main interface and the Slave interface

Nmcli con up Bond-slave-eno2

Nmcli con up Bond-slave-eno1

Nmcli con up bond0

Configuration steps (File configuration)

Vi/etc/sysconfig/network-scripts/ifcfg-master

Device=bond0

Type=bond

Bonding_master=yes

Onboot=yes

Userctl=no

bonding_opts= "Mode=balance-rr miimon=50"

Bootproto=none

ipaddr0=10.1.1.250

Prefix0=24

Vi/etc/sysconfig/network-scripts/ifcfg-slave

Device=<name>

Type=ethernet

Onboot=yes

Master=bond0

Slave=yes

Userctl=no

Three. View Results

Cat/proc/net/bonding/bond0

Bonding mode:fault-tolerance (Active-backup)

Primary Slave:none

Currently Active Slave:eth0

MII Status:up

MII Polling Interval (ms): 50

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface:eth0

MII Status:up

Speed-Mbps

Duplex:full

Link Failure count:0

Permanent HW addr:00:10:18:2b:98:85

Slave Queue id:0

Slave interface:eth1

MII Status:up

Speed-Mbps

Duplex:full

Link Failure count:0

Permanent HW addr:64:31:50:18:80:8f

Slave Queue id:0

I. Teaming configuration process

#ip Link (view network card device)

1:lo: <LOOPBACK,UP,LOWER_UP> MTU 65536 qdisc noqueue State UNKNOWN mode DEFAULT

Link/loopback 00:00:00:00:00:00 BRD 00:00:00:00:00:00

2:eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU qdisc pfifo_fast State up mode DEFAULT Qlen 1000

Link/ether 52:54:00:00:xx:0b BRD FF:FF:FF:FF:FF:FF

4:eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU qdisc pfifo_fast State up mode DEFAULT Qlen 1000

Link/ether 00:10:18:2b:98:85 BRD FF:FF:FF:FF:FF:FF

6:eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU qdisc pfifo_fast State up mode DEFAULT Qlen 1000

Link/ether 64:31:50:18:80:8f BRD FF:FF:FF:FF:FF:FF

#nmcli con Add type team con-name TEAM0 ifname team0 config ' {"runner": {"name": "Activebackup"}} ' (1)

#nmcli con mod team0 ipv4.addresses ' 192.168.0.100/24 ' (2)

#nmcli con mod team0 ipv4.method Manual (3)

#nmcli con Add type team-slave con-name TEAM0-PORT1 ifname eno1 Master team0 (4) Red can not be added

#nmcli con Add type team-slave con-name TEAM0-PORT2 ifname eno2 Master team0 (5) Red can not be added

#teamdctl Team0 State (View status)

Setup

Runner:activebackup

Ports

Eno1

Link watches:

Link Summary:up

INSTANCE[LINK_WATCH_0]:

Name:ethtool

Link:up

Eno2

Link watches:

Link Summary:up

INSTANCE[LINK_WATCH_0]:

Name:ethtool

Link:up

Runner

Active Port:eno1

#ping-I team0 192.168.0.254 (test)

PING 192.168.0.254 (192.168.0.254) from 192.168.0.100 team0:56 (+) bytes of data.

Bytes from 192.168.0.254:icmp_seq=10 ttl=64 time=1.08 ms

Bytes from 192.168.0.254:icmp_seq=11 ttl=64 time=0.789 ms

Bytes from 192.168.0.254:icmp_seq=12 ttl=64 time=0.906 ms

... Output omitted ...

#nmcli Dev Dis eno1 (turn off a slave device)

#teamdctl Team0 State

Setup

Runner:activebackup

Ports

Eno2

Link watches:

Link Summary:up

INSTANCE[LINK_WATCH_0]:

Name:ethtool

Link:up

Runner

Active Port:eno2

#nmcli con up Team0-port1

#nmcli Dev Dis Eno2

#teamdctl Team0 State

Setup

Runner:activebackup

Ports

Eno1

Link watches:

Link Summary:up

INSTANCE[LINK_WATCH_0]:

Name:ethtool

Link:up

Runner

Active Port:eno1

# nmcli Dev Dis eno2

# Teamdctl Team0 State

Setup

Runner:activebackup

Ports

Eno1

Link watches:

Link Summary:up

INSTANCE[LINK_WATCH_0]:

Name:ethtool

Link:up

Runner

Active Port:eno1

#nmcli con up Team0-port2

# Teamdctl Team0 State

Setup

Runner:activebackup

Ports

Eno1

Link watches:

Link Summary:up

INSTANCE[LINK_WATCH_0]:

Name:ethtool

Link:up

Eno2

Link watches:

Link Summary:up

INSTANCE[LINK_WATCH_0]:

Name:ethtool

Link:up

Runner

Active Port:eno1

Configuring bonding connections and teaming connections using NMCLI

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.