[Linux Setting] CentOS 6.9 Setting Guide : 기본설정 : 네트워크 설정(bonding)
1. 용도 및 목적
Linux 설치 및 다양한 테스트 환경을 만들기 위함
네트워크 이중화 및 연결을 위한 NIC Setting 및 테스트
2. 설치 환경
-O/S
Windows 10 Pro , VirtualBox(CentOS6.9)
-H/W
Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
RAM 8GB
SDD 256GB
3. 로그 인 후 아래 절차를 따른다.
-root로 로그인한다
ID : root, PW : 기존에설정한PW
4. 네트워크 이중화 구성 (NIC 설정)
인터페이스 bond0 생성 (fail_over_mac=1 옵션은 리얼장비에서 보통 안쓰나, Virtualbox 에서 저 옵션을 안하면 인터페이스 절체가 안된다, 추측으로는 실제 스위치가 아닌 가상머신의 네트워크 어댑터 문제로 보인다)
-bond0 인터페이스 생성
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.35.11
PREFIX=24
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=1 miimon=100 fail_over_mac=1"
GATEWAY=192.168.35.1
-bond0 에 eth0 멤버 추가
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:AB:3F:36
TYPE=Ethernet
UUID=e76a3e8d-9274-4360-aec6-2f21d53a862b
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
-bond0 에 eth1 멤버 추가
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=08:00:27:E6:5B:1D
TYPE=Ethernet
UUID=8cc4944b-d06d-4b38-92a8-0581f8c44e60
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
-bond0 상태 확인
[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: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ab:3f:36
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:e6:5b:1d
Slave queue ID: 0
-network 재시작
#service network restart
4.interface failover 테스트
-현재 상태확인(Active : eth0)
[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: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ab:3f:36
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:e6:5b:1d
Slave queue ID: 0
-수동으로 eth0을 다운시킨다.
[root@localhost ~]# ifdown eth0
-절체 후 상태확인(Active : eth1)
[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: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:e6:5b:1d
Slave queue ID: 0