(Network) 본딩의 정의와 설정방법
본딩이란(Bonding)
본딩(Bonding)이란 여러개의 물리적인 NIC카드를 논리적으로 묶어서 대역폭을 확장하거나 NIC카드 장애가 발생 할 경우 정상적인 NIC카드로 네트워크 서비스를 자동으로 변경해주는 기능
본딩 설정방법(centos)
Redhat에서의 네트워크 본딩 설정방법을 정의합니다.
1. 현재OS 확인
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
2. 네트워크 인터페이스명 확인
[root@localhost ~]# ip a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.91.128 netmask 255.255.255.0 broadcast 192.168.91.255
inet6 fe80::20c:29ff:fe87:b70e prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:87:b7:0e txqueuelen 1000 (Ethernet)
RX packets 226 bytes 22388 (21.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 172 bytes 26838 (26.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens36: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.91.129 netmask 255.255.255.0 broadcast 192.168.91.255
inet6 fe80::20c:29ff:fe87:b718 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:87:b7:18 txqueuelen 1000 (Ethernet)
RX packets 9 bytes 1104 (1.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 22 bytes 2236 (2.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 10 bytes 1010 (1010.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10 bytes 1010 (1010.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]#
3.네트워크 인터페이스를 설정하는 곳으로 이동
[root@localhost network-scripts]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]#
4.본딩 할 인터페이스 파일 수정
[root@localhost network-scripts]# vi ifcfg-ens33
BOOTPROTO=none
NAME=ens33
DEVICE=ens33
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@localhost network-scripts]# vi ifcfg-ens36
BOOTPROTO=dhcp
NAME=ens36
DEVICE=ens36
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@localhost network-scripts]#
5.본딩 설정 파일을 생성하고 설정
[본딩모드 옵션]
[root@localhost network-scripts]# vi ifcfg-bond0
BOOTPROTO=none
NAME=bond0
DEVICE=bond0
ONBOOT=yes
TYPE=Bond
IPADDR=192.168.91.110 # 서비스 사용 할 IP
NETMASK=255.255.255.0
GATEWAY=192.168.91.2
BONDING_OPTS=mode=1 miimon=10 primary=ens33 fail_over_mac=1 #본딩모드 옵션
[root@localhost network-scripts]#
6.네트워크 이슈를 예방하기 위한 네트워크관리자 중지
[root@localhost network-scripts]# sudo systemctl stop NetworkManager
[root@localhost network-scripts]# sudo systemctl disable NetworkManager
[root@localhost network-scripts]# sudo systemctl status NetworkManager #종료 상태확인
7.본딩 모듈 적재
[root@localhost network-scripts]# modprobe --first-time bonding
[root@localhost network-scripts]#
8.네트워크 서비스 재시작
[root@localhost network-scripts]# sudo systemctl restart network
[root@localhost network-scripts]#
9.본딩이 정상 동작하는지 확인
[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: ens33 (primary_reselect always)
Currently Active Slave: ens33
MII Status: up
MII Polling Interval (ms): 10
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: ens33
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:87:b7:0e
Slave queue ID: 0
Slave Interface: ens36
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:87:b7:18
Slave queue ID: 0
[root@localhost ~]#
This post is licensed under
CC BY 4.0
by the author.