RedHat networking: Difference between revisions
From Lolly's Wiki
Jump to navigationJump to search
m (Text replacement - "</source" to "</syntaxhighlight") |
|||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
== /etc/modprobe.d/bonding.conf == | == /etc/modprobe.d/bonding.conf == | ||
< | <syntaxhighlight lang=conf> | ||
alias netdev-bond0 bonding | alias netdev-bond0 bonding | ||
options bond0 miimon=100 mode=active-backup updelay=0 downdelay=0 primary=bond0_slave1 | options bond0 miimon=100 mode=active-backup updelay=0 downdelay=0 primary=bond0_slave1 | ||
Line 12: | Line 12: | ||
alias netdev-bond1 bonding | alias netdev-bond1 bonding | ||
options bond1 miimon=100 mode=4 lacp_rate=1 | options bond1 miimon=100 mode=4 lacp_rate=1 | ||
</ | </syntaxhighlight> | ||
== /etc/sysconfig/network-scripts/ifcfg-bond0 == | == /etc/sysconfig/network-scripts/ifcfg-bond0 == | ||
< | <syntaxhighlight lang=conf> | ||
DEVICE=bond0 | DEVICE=bond0 | ||
TYPE=Bond | TYPE=Bond | ||
Line 30: | Line 30: | ||
PREFIX=16 | PREFIX=16 | ||
GATEWAY=172.16.0.1 | GATEWAY=172.16.0.1 | ||
</ | </syntaxhighlight> | ||
== /etc/sysconfig/network-scripts/ifcfg-bond0_slave1 == | == /etc/sysconfig/network-scripts/ifcfg-bond0_slave1 == | ||
< | <syntaxhighlight lang=conf> | ||
HWADDR=94:18:82:80:C2:18 | HWADDR=94:18:82:80:C2:18 | ||
TYPE=Ethernet | TYPE=Ethernet | ||
Line 42: | Line 42: | ||
MASTER=bond0 | MASTER=bond0 | ||
SLAVE=yes | SLAVE=yes | ||
</ | </syntaxhighlight> | ||
== /etc/sysconfig/network-scripts/ifcfg-bond0_slave2 == | == /etc/sysconfig/network-scripts/ifcfg-bond0_slave2 == | ||
< | <syntaxhighlight lang=conf> | ||
HWADDR=94:18:82:80:C2:1A | HWADDR=94:18:82:80:C2:1A | ||
TYPE=Ethernet | TYPE=Ethernet | ||
Line 54: | Line 54: | ||
MASTER=bond0 | MASTER=bond0 | ||
SLAVE=yes | SLAVE=yes | ||
</ | </syntaxhighlight> | ||
== Check state of bond0 == | == Check state of bond0 == | ||
< | <syntaxhighlight lang=bash> | ||
# cat /proc/net/bonding/bond0 | # cat /proc/net/bonding/bond0 | ||
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) | Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) | ||
Line 84: | Line 84: | ||
Permanent HW addr: 94:18:82:80:c2:1a | Permanent HW addr: 94:18:82:80:c2:1a | ||
Slave queue ID: 0 | Slave queue ID: 0 | ||
</ | </syntaxhighlight> | ||
== /etc/sysconfig/network-scripts/ifcfg-bond1 == | == /etc/sysconfig/network-scripts/ifcfg-bond1 == | ||
< | <syntaxhighlight lang=conf> | ||
DEVICE=bond1 | DEVICE=bond1 | ||
TYPE=Bond | TYPE=Bond | ||
Line 100: | Line 100: | ||
IPADDR=172.20.0.30 | IPADDR=172.20.0.30 | ||
PREFIX=24 | PREFIX=24 | ||
</ | </syntaxhighlight> | ||
== /etc/sysconfig/network-scripts/ifcfg-bond1_slave1 == | == /etc/sysconfig/network-scripts/ifcfg-bond1_slave1 == | ||
< | <syntaxhighlight lang=conf> | ||
TYPE=Ethernet | TYPE=Ethernet | ||
NAME=bond1_slave1 | NAME=bond1_slave1 | ||
Line 113: | Line 113: | ||
MTU=1500 | MTU=1500 | ||
DEVICE=eno49 | DEVICE=eno49 | ||
</ | </syntaxhighlight> | ||
== /etc/sysconfig/network-scripts/ifcfg-bond1_slave2 == | == /etc/sysconfig/network-scripts/ifcfg-bond1_slave2 == | ||
< | <syntaxhighlight lang=conf> | ||
TYPE=Ethernet | TYPE=Ethernet | ||
NAME=bond1_slave2 | NAME=bond1_slave2 | ||
Line 126: | Line 126: | ||
MTU=1500 | MTU=1500 | ||
DEVICE=eno50 | DEVICE=eno50 | ||
</ | </syntaxhighlight> | ||
== Check state of bond1 == | == Check state of bond1 == | ||
< | <syntaxhighlight lang=bash> | ||
# cat /proc/net/bonding/bond1 | # cat /proc/net/bonding/bond1 | ||
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) | Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) | ||
Line 200: | Line 200: | ||
port number: 1046 | port number: 1046 | ||
port state: 63 | port state: 63 | ||
</ | </syntaxhighlight> |
Latest revision as of 20:45, 25 November 2021
Bonding
In this example we configure two bonds.
bond0 : Failover (eno1/bond0_slave1 and eno3/bond0_slave2) bond1 : LACP
/etc/modprobe.d/bonding.conf
alias netdev-bond0 bonding
options bond0 miimon=100 mode=active-backup updelay=0 downdelay=0 primary=bond0_slave1
alias netdev-bond1 bonding
options bond1 miimon=100 mode=4 lacp_rate=1
/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
TYPE=Bond
BONDING_MASTER=yes
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=bond0
UUID=9e2088b8-4cfe-435a-b0a2-9387f0fc8024
ONBOOT=yes
DNS1=172.16.0.69
BONDING_OPTS="miimon=100 updelay=0 downdelay=0 mode=active-backup primary=bond0_slave1"
IPADDR=172.16.0.105
PREFIX=16
GATEWAY=172.16.0.1
/etc/sysconfig/network-scripts/ifcfg-bond0_slave1
HWADDR=94:18:82:80:C2:18
TYPE=Ethernet
NAME=bond0_slave1
UUID=a03819df-0715-455d-9726-9348cdbd45c9
DEVICE=eno1
ONBOOT=yes
MASTER=bond0
SLAVE=yes
/etc/sysconfig/network-scripts/ifcfg-bond0_slave2
HWADDR=94:18:82:80:C2:1A
TYPE=Ethernet
NAME=bond0_slave2
UUID=a03819df-0715-455d-9726-9348cdbd45c9
DEVICE=eno3
ONBOOT=yes
MASTER=bond0
SLAVE=yes
Check state of bond0
# 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: eno1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eno1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 94:18:82:80:c2:18
Slave queue ID: 0
Slave Interface: eno3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 94:18:82:80:c2:1a
Slave queue ID: 0
/etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
TYPE=Bond
BONDING_MASTER=yes
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=bond1
UUID=c9a4bce2-5dbe-4cf9-beb6-34a24512ae23
ONBOOT=yes
BONDING_OPTS="mode=4 miimon=100 lacp_rate=1"
IPADDR=172.20.0.30
PREFIX=24
/etc/sysconfig/network-scripts/ifcfg-bond1_slave1
TYPE=Ethernet
NAME=bond1_slave1
UUID=9ad3a93f-362e-4a18-bb2e-c4588e666e12
ONBOOT=yes
MASTER=bond1
SLAVE=yes
MACADDR=14:02:ec:8e:f3:24
MTU=1500
DEVICE=eno49
/etc/sysconfig/network-scripts/ifcfg-bond1_slave2
TYPE=Ethernet
NAME=bond1_slave2
UUID=6d8015ef-fe60-472a-b18f-17caf952e45b
ONBOOT=yes
MASTER=bond1
SLAVE=yes
MACADDR=14:02:ec:8e:f3:24
MTU=1500
DEVICE=eno50
Check state of bond1
# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
802.3ad info
LACP rate: fast
Min links: 0
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 2
Number of ports: 2
Actor Key: 13
Partner Key: 70
Partner Mac Address: 01:e0:52:00:00:02
Slave Interface: eno49
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 14:02:ec:8e:f3:24
Slave queue ID: 0
Aggregator ID: 2
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
system priority: 0
port key: 13
port priority: 255
port number: 1
port state: 63
details partner lacp pdu:
system priority: 32768
oper key: 70
port priority: 32768
port number: 534
port state: 63
Slave Interface: eno50
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 14:02:ec:8e:f3:24
Slave queue ID: 0
Aggregator ID: 2
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
system priority: 0
port key: 13
port priority: 255
port number: 2
port state: 63
details partner lacp pdu:
system priority: 32768
oper key: 70
port priority: 32768
port number: 1046
port state: 63