본문으로 바로가기
반응형

RHEL8에서 nmcli 명령어를 통해 bond 구성 및 bond0 + VLAN 구성방법입니다.

 

 

1. Bond0 생성

[root@worker3 ~]# nmcli connection add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup,miimon=100"
Connection 'bond0' (d3412708-c180-49d7-9834-b31127e96977) successfully added."

 

 

2. 상태 확인

[root@worker3 ~]# nmcli d status
DEVICE    TYPE      STATE                                  CONNECTION
eno3.535  vlan      connected                              eno3.535
bond0     bond      connecting (getting IP configuration)  bond0

 

 

3. bond0에 인터페이스 추가

[root@worker3 ~]# nmcli connection add type ethernet slave-type bond con-name eno3 ifname eno3 master bond0
Warning: There is another connection with the name 'eno3'. Reference the connection by its uuid '202d0c89-93dd-45af-99c4-f97b6e49892e'
Connection 'eno3' (202d0c89-93dd-45af-99c4-f97b6e49892e) successfully added.

[root@worker3 ~]# nmcli connection add type ethernet slave-type bond con-name eno4 ifname eno4 master bond0
Warning: There is another connection with the name 'eno4'. Reference the connection by its uuid '737dfef8-722d-484a-a738-d423b3844fc4'
Connection 'eno4' (737dfef8-722d-484a-a738-d423b3844fc4) successfully added.

 

 

4. bond0 인터페이스 활성화

[root@worker3 ~]# nmcli connection up bond0


## bond0에 IP 추가하여 사용할 경우 아래 절차를 따릅니다.
# nmcli connection modify bond0 ipv4.addresses '10.10.10.10/24'
# nmcli connection modify bond0 ipv4.gateway '10.10.10.1'
# nmcli connection modify bond0 ipv4.dns '8.8.8.8'
# nmcli connection modify bond0 ipv4.method manual

# nmcli connection up bond0

# systemctl restart NetworkManager

 

 

5. bond0 + vlan 인터페이스 생성

[root@worker3 ~]# nmcli connection add type vlan con-name bond0.535 ifname bond0.535 vlan.parent bond0 vlan.id 535

 

 

6. bond0.535 인터페이스에 IP 설정 및 활성화

[root@worker3 ~]# nmcli connection modify bond0.535 ipv4.addresses 55.55.35.218/24

[root@worker3 ~]# nmcli connection modify bond0.535 ipv4.gateway 55.55.35.1

[root@worker3 ~]# nmcli connection modify bond0.535 ipv4.dns 55.55.35.200

[root@worker3 ~]# nmcli connection modify bond0.535 ipv4.method manual

[root@worker3 ~]# nmcli connection up bond0.535

[root@worker3 ~]# systemctl restart NetworkManager

 

 

7. bond0 상태 확인

[root@worker3 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v4.18.0-305.el8.x86_64

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

Slave Interface: eno3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: e4:43:4b:b5:1b:8c
Slave queue ID: 0

Slave Interface: eno4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: e4:43:4b:b5:1b:8d
Slave queue ID: 0

 

 

8. 인터페이스 디바이스 및 연결상태 확인

[root@worker3 ~]# nmcli d status
DEVICE     TYPE      STATE         CONNECTION
bond0.535  vlan      connected     bond0.535
bond0      bond      connected     bond0
eno3       ethernet  connected     eno3
eno4       ethernet  connected     eno4


[root@worker3 ~]# nmcli c
NAME       UUID                                  TYPE      DEVICE
bond0.535  d14e6a23-ddec-4265-bb4c-2b8f0d4a7566  vlan      bond0.535
bond0      d3412708-c180-49d7-9834-b31127e96977  bond      bond0
eno3       ea4be0f7-c711-4cf2-819a-3b0aa84feb41  ethernet  eno3
eno4       737dfef8-722d-484a-a738-d423b3844fc4  ethernet  eno4
728x90