728x90
🚀Network Bonding이란?
Linux Bonding(또는 NIC Bonding)은 두 개 이상의 네트워크 인터페이스(NIC)를 하나로 묶어 단일 인터페이스처럼 작동하도록 구성하는 기술입니다. 이를 통해 고가용성(High Availability), 부하 분산(Load Balancing), 대역폭 증가 등의 이점을 얻을 수 있습니다.
Bonding을 사용하면 네트워크 장애 발생 시 자동으로 대체 NIC를 활성화하여 연결을 유지할 수 있으며, 특정 모드를 사용하면 대역폭을 증가시킬 수도 있습니다.
🚀사전 작업
📌기존 네트워크 설정 초기화
- 본딩을 설정하기 전에 기존의 네트워크 인터페이스 설정을 삭제하고 재부팅합니다.
1️⃣nmtui를 사용하여 모든 이더넷 정보 삭제
# nmtui
2️⃣ 기존 네트워크 설정 파일 삭제
# cd /etc/sysconfig/network-scripts/
# rm -f ifcfg-eth*
# rm -f ifcfg-bond*
3️⃣재부팅
# reboot
4️⃣확인(아무것도 없어야함)
# ls /etc/sysconfig/network-scripts/
🚀본딩 인터페이스 생성 및 설정
1️⃣본딩 모드 선택
Linux 본딩은 다양한 모드를 지원합니다. 이번 실습에서는 Active-Backup 모드 (mode=1) 를 사용합니다.
- Mode 1 (active-backup): 하나의 NIC가 활성 상태이고, 다른 NIC는 대기 상태로 대체 역할을 수행합니다. (고가용성 지원)
📎본딩의 모드에 대해서 보고 싶다면 이전에 포스팅한 글을 참고하시면 됩니다.
2024.03.13 - [OS/Linux] - Bonding
Bonding
Bonding 이란? Linux Bonding (또는 NIC Bonding)은 두 개 이상의 네트워크 인터페이스 카드(NIC)를 하나로 묶어서 단일 인터페이스처럼 작동하게 하는 기술입니다. 이 기술을 사용하면 네트워크의 고가용
www.estar987.com
2️⃣본딩 인터페이스 생성
# nmcli connection add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup,miimon=100"
3️⃣본딩 인터페이스에 Slave 인터페이스 추가
# nmcli connection add type ethernet slave-type bond con-name bond0-eth0 ifname eth0 master bond0
# nmcli connection add type ethernet slave-type bond con-name bond0-eth1 ifname eth1 master bond0
4️⃣본딩 인터페이스에 IP 주소 설정
# nmcli connection modify bond0 ipv4.addresses 192.168.207.220/24
# nmcli connection modify bond0 ipv4.gateway 192.168.207.254
# nmcli connection modify bond0 ipv4.dns 168.126.63.1
# nmcli connection modify bond0 ipv4.method manual
5️⃣네트워크 적용 및 확인
# systemctl restart NetworkManager
# nmcli device status
DEVICE TYPE STATE CONNECTION
bond0 bond connected bond0
eth0 ethernet connected bond0-eth0
eth1 ethernet connected bond0-eth1
lo loopback unmanaged --
# 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: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 90:b1:1c:38:91:60
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 90:b1:1c:38:91:61
Slave queue ID: 0
🚀네트워크 장애 테스트
1️⃣장애 시 자동 전환 확인
- eth0이 비활성화되면 eth1이 자동으로 활성화됨을 확인할 수 있습니다.
# 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: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 90:b1:1c:38:91:60
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 90:b1:1c:38:91:61
Slave queue ID: 0
# ifconfig eth0 down
# 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: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
Slave Interface: eth0
MII Status: down
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 90:b1:1c:38:91:60
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 90:b1:1c:38:91:61
Slave queue ID: 0
2️⃣네트워크 연결 테스트
3️⃣재부팅 후 유지 확인
'OS > Linux' 카테고리의 다른 글
[Linux] Prometheus & Grafana 소스 컴파일 설치 및 Trouble Shooting (0) | 2025.02.21 |
---|---|
[Linux] PostgreSQL & Airflow 연동간 발생한 문제 (0) | 2025.02.20 |
[Linux] Dell 서버 iDRAC(IPMI) 관리용 ipmitool 소스 컴파일 설치 가이드 (0) | 2025.02.19 |
[Linux] PostgreSQL, Airflow 및 OS 계정 연동 (0) | 2025.02.18 |
[Linux] Airflow 2.7.3 & PostgreSQL 13.18 설치 및 설정 매뉴얼 (Python 3.10.14 환경) (0) | 2025.02.17 |