본문 바로가기
서버/Linux

Rocky linux Bonding 설정(nmcli)

by WYYOON 2025. 2. 20.
728x90
반응형
SMALL

1. 인터페이스 생성 및 모니터링 주기 설정

※ miimon: 모니터링 주기를 가리키며 ms 단위임으로 1000으로 할 경우 1초 단위로 링크 모니터링 수행

 

# nmcli connection add type bond con-name bond0 ifname bond0 bond.options “mode=active-backup,miimon=1000”




2. 설정

# nmcli device status

DEVICE  TYPE      STATE                                  CONNECTION
ens32   ethernet  connected                              ens32
lo      loopback  connected (externally)                 lo
bond0   bond      connecting (getting IP configuration)  bond0
ens34   ethernet  disconnected                           --

 

# nmcli connection add type ethernet slave-type bond con-name bond0-ens32 ifname ens32 master bond0
# nmcli connection add type ethernet slave-type bond con-name bond0-ens34 ifname ens34 master bond0




3. IP 설정

# nmcli connection modify bond0 ipv4.addresses 192.168.204.220/24
# nmcli connection modify bond0 ipv4.gateway 192.168.204.254
# nmcli connection modify bond0 ipv4.dns 168.126.63.1
# nmcli connection modify bond0 ipv4.method manual




4. 적용

 

# nmcli connection down ens32
# nmcli connection down ens34
# nmcli connection up bond0
# nmcli device

DEVICE  TYPE      STATE                   CONNECTION
bond0   bond      connected               bond0
lo      loopback  connected (externally)  lo
ens32   ethernet  connected               bond0-ens32
ens34   ethernet  connected               bond0-ens34







4. 테스트

4-1. Active 확인

# cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v5.14.0-284.11.1.el9_2.x86_64

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

Slave Interface: ens34
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c1:4d:e2
Slave queue ID: 0

Slave Interface: ens32
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:ad:3f:92
Slave queue ID: 0




4-2. Active 다운

# ifconfig ens34 down




4-3. Active 변경 확인

# cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v5.14.0-284.11.1.el9_2.x86_64

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

Slave Interface: ens34
MII Status: down
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:0c:29:c1:4d:e2
Slave queue ID: 0

Slave Interface: ens32
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:ad:3f:92
Slave queue ID: 0

 


 

 

728x90
반응형
SMALL