본문 바로가기

운영체제/Unix & Linux

nmcli 를 이용한 bonding 구성

반응형

구성 환경

redhat(centos)에서 nmcli 를 이용한 bonding(mode 4, LACP) 구성

 

준비

nmcli를 사용하기 위해서는 NetworkManager 서비스가 실행중이어야 한다

> systemctl status NetworkManager

> systemctl enable NetworkManager 

> systemctl start NetworkManager

 

1. bonding 인터페이스 생성

 > nmcli connection add type bond con-name bond0 ifname bond0 bond.options "mode=4,miimon=100"
'bond0' (4e82d3ae-3103-4c0d-b988-f658a26db086) 연결이 성공적으로 추가되었습니다.

2. 확인

 > nmcli con show
NAME    UUID                                  TYPE      DEVICE
bond0   4e82d3ae-3103-4c0d-b988-f658a26db086  bond      bond0
ens160  ac81fe80-2710-4bbc-b232-257b89942e87  ethernet  ens160
ens161  dbf76be3-b941-4c83-94d1-2bb551af35ca  ethernet  --

3.  slave 인터페이스 구성

3.1 slave 인터페이스를 구성할 인터페이스 확인(여기서는 ens224, ens256 인터페이스 사용)

 > nmcli device status
DEVICE  TYPE      STATE                          CONNECTION
ens160  ethernet  연결됨                         ens160
bond0   bond      연결 중 (IP 설정 가져오는 중)  bond0
ens161  ethernet  연결 끊겼음                    --
ens224  ethernet  연결 끊겼음                    --
ens256  ethernet  연결 끊겼음                    --
lo      loopback  관리되지 않음                  --

3.2 slave 인터페이스 구성

> nmcli con add type ethernet slave-type bond con-name bond0-ens224 ifname ens224 master bond0
'bond0-ens224' (be06d502-9899-4187-ab04-2b106a36c1a5) 연결이 성공적으로 추가되었습니다.

> nmcli device status
DEVICE  TYPE      STATE          CONNECTION
ens160  ethernet  연결됨         ens160
bond0   bond      연결됨         bond0
ens224  ethernet  연결됨         bond0-ens224
ens161  ethernet  연결 끊겼음    --
ens256  ethernet  연결 끊겼음    --
lo      loopback  관리되지 않음  --
> nmcli con add type ethernet slave-type bond con-name bond0-ens256 ifname ens256 master bond0
'bond0-ens256' (d431ed50-e397-4f73-8aa9-d450331e826e) 연결이 성공적으로 추가되었습니다.

> nmcli device status
DEVICE  TYPE      STATE          CONNECTION
ens160  ethernet  연결됨         ens160
bond0   bond      연결됨         bond0
ens224  ethernet  연결됨         bond0-ens224
ens256  ethernet  연결됨         bond0-ens256
ens161  ethernet  연결 끊겼음    --
lo      loopback  관리되지 않음  --

4. IP 설정

> nmcli con modify bond0 ipv4.method manual ipv4.addresses '10.10.10.176/24'
> nmcli con modify bond0 ipv4.gateway '10.10.10.1' 
> nmcli con modify bond0 ipv4.dns '8.8.8.8'
>  nmcli con up bond0
연결이 성공적으로 활성화되었습니다 (master waiting for slaves) (D-버스 활성 경로: /org/freedesktop/NetworkManager/ActiveConnection/15)

> nmcli device show bond0
GENERAL.DEVICE:                         bond0
GENERAL.TYPE:                           bond
GENERAL.HWADDR:                         00:50:56:2B:94:55
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (연결됨)
GENERAL.CONNECTION:                     bond0
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveC>
IP4.ADDRESS[1]:                         10.10.10.176/24
IP4.GATEWAY:                            10.10.10.1
IP4.ROUTE[1]:                           dst = 10.10.10.0/24, nh = 0.0.0.0, mt =>
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 10.10.10.1, mt = >
IP4.DNS[1]:                             8.8.8.8
IP6.ADDRESS[1]:                         fe80::9cfa:59f0:feef:cf2/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 1024

5. 확인

모든 인터페이스의 churn 상태가 none 인지 확인,

만약 상태가 churned 상태이면 네트워크쪽 LACP 구성 확인 필요

> 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 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0

802.3ad info
LACP active: on
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
System priority: 65535
System MAC address: 00:50:56:2b:94:55
Active Aggregator Info:
        Aggregator ID: 1
        Number of ports: 2
        Actor Key: 15
        Partner Key: 1
        Partner Mac Address: 58:bc:27:0d:f6:00

Slave Interface: ens224
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:2b:94:55
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: 00:50:56:2b:94:55
    port key: 15
    port priority: 255
    port number: 1
    port state: 61
details partner lacp pdu:
    system priority: 32768
    system mac address: 58:bc:27:0d:f6:00
    oper key: 1
    port priority: 32768
    port number: 3
    port state: 61

Slave Interface: ens256
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:29:5c:21
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: 00:50:56:2b:94:55
    port key: 15
    port priority: 255
    port number: 2
    port state: 61
details partner lacp pdu:
    system priority: 32768
    system mac address: 58:bc:27:0d:f6:00
    oper key: 1
    port priority: 32768
    port number: 4
    port state: 61

반응형