LoginSignup
0
0

More than 5 years have passed since last update.

ubuntu 16.04 interface bonding memo, configuration and status check.

Last updated at Posted at 2019-04-12

ubuntu 16.04 interface bonding memo, configuration and status check.

system

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
$ lsmod | grep bond
bonding               143360  0
$ dpkg -l | grep -Ei "ifenslave|bridge-utils"
ii  bridge-utils                          1.5-9ubuntu1                               amd64        Utilities for configuring the Linux Ethernet bridge
ii  ifenslave                             2.7ubuntu1                                 all          configure network interfaces for parallel routing (bonding)

configuration

  • file: /etc/network/interfaces
auto p1p1
iface p1p1 inet manual
  bond-master bond0

auto p5p1
iface p5p1 inet manual
  bond-master bond0

auto bond0
iface bond0 inet manual
  slaves p1p1 p5p1
  bond_mode active-backup
  bond_miimon 100

check status by command line

$ ip a s p1p1 | head -1
3: p1p1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000

$ ip a s p5p1 | head -1
6: p5p1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000

$ ip a s bond0 | head -1
7: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP group default qlen 1000
$ brctl show br0
bridge name     bridge id               STP enabled     interfaces
br0             8000.001b2136b8a4       no              bond0

check status by proc file system

$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: p5p1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: p5p1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:1b:21:(snip)
Slave queue ID: 0

Slave Interface: p1p1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:1b:21:(snip)
Slave queue ID: 0

check status by sysfs

$ cat /sys/class/net/bond0/bonding/mode
active-backup 1

$ cat /sys/class/net/bond0/bonding/mii_status
up

$ cat /sys/class/net/bond0/bonding/miimon
100

$ cat /sys/class/net/bond0/bonding/active_slave
p5p1

$ cat /sys/class/net/bond0/bonding/slaves
p5p1 p1p1
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0