Monday, 30 April 2018

debian network bonding and bridge config

debian network  bonding and bridge config

cat /etc/network/interfaces
auto lo
iface lo inet loopback


auto bond0 
iface bond0 inet manual
bond_mode 802.3ad
    bond_xmit_hash_policy layer2+3
    bond_miimon 100
    bond_updelay 200
    bond_downdelay 200
    slaves eth0 eth1

auto br0
iface br0 inet static
address 192.168.201.131
netmask 255.255.255.0
gateway 192.168.201.1
bridge_ports bond0 


check bonding status

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

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2+3 (2)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 200

802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 1
Number of ports: 2
Actor Key: 33
Partner Key: 34
Partner Mac Address: 30:7b:ac:7a:96:05

Slave Interface: eth0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 24:6e:96:93:df:88
Aggregator ID: 1
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 24:6e:96:93:df:8a
Aggregator ID: 1
Slave queue ID: 0

root@host131:~# ethtool br0
Settings for br0:
Link detected: yes
root@host131:~# ethtool bond0
Settings for bond0:
Supported ports: [ ]
Supported link modes:   Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes:  Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 20000Mb/s
Duplex: Full
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes
 

opensuse bridge network configuration

1.  Add OpenSUSE netease mirror
rm /etc/zypp/repos.d/*

zypper addrepo -f http://mirrors.163.com/openSUSE/distribution/leap/42.3/repo/oss/ openSUSE-leap42.3-Oss
zypper addrepo -f http://mirrors.163.com/openSUSE/distribution/leap/42.3/repo/non-oss/ openSUSE-leap42.3-Non-Oss
zypper addrepo -f http://mirrors.163.com/openSUSE/update/leap/42.3/oss/ openSUSE-leap42.3-Update-Oss
zypper addrepo -f http://mirrors.163.com/openSUSE/update/leap/42.3/non-oss/ openSUSE-leap42.3-Update-Non-Oss


2. install bridge-utils
zypper install bridge-utils


3. network config
opensuse:~ # cat /etc/resolv.conf   (DNS setting)
nameserver  119.29.29.29
opensuse:~ # cat /etc/sysconfig/network/routes  (gateway Setting)
default 192.168.181.2
eth0 setting
opensuse:~ # cat /etc/sysconfig/network/ifcfg-eth0  (eth0 setting)
BOOTPROTO='none'
HWADDR='00:0c:29:50:ba:e6'
NAME='eth0'
STARTMODE='auto'

opensuse:~ # cat /etc/sysconfig/network/ifcfg-br0 (br0 setting)
BOOTPROTO='static'
BRIDGE='yes'
BRIDGE_FORWARDDELAY='0'
BRIDGE_PORTS='eth0'
BRIDGE_STP='off'
ETHTOOL_OPTIONS=''
IPADDR='192.168.181.139/24'
STARTMODE='auto'


checking br
opensuse:~ # brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.000c2950bae6       no              eth0