온라인 상태에서 bond0 에 묶인 NIC 두개를 다른 NIC 두개로 교체하는 방법을 안내하는 문서다. 새로 bonding 구성될 NIC (eth3, eth4)는 이미 커널에서 인식이 된 상태라는 전제하에  문서를 작성 했으며, 교체 시 bond0쪽 네트워크 장애가 잠시 발생하게 된다.

1. 정보

1.1. 서버

♦ RHCS-NODE1 : bond0 장치의 NIC를 교체 작업할 서버. 작업시 사용할 백업 IP 가 192.168.11.31 이다.

♦ RHCS-NODE2 : 백업 네트워크를 통해 ssh 접속을 위한 서버이다. 백업 IP – 192.168.11.32

1.2. 백업 네트워크

eth1 – 192.168.11.31

1.3. bond 장치

bond0 (mode=1), ip – 192.168.0.31

1.4. 기존 bond0의 NIC

eth0, eth2

1.4. 신규 bond0의 NIC

eth3, eth4

 

2. 접속 하기

RHCS-NODE2 서버에서 백업 네트워크을 통해 RHCS-NODE1 서버로  ssh 로그인 한다.

[root@RHCS-NODE2 ~]# ssh 192.168.11.31
[root@RHCS-NODE1 ~]# who am i
[root pts/2 2014-07-08 16:00 (192.168.11.32)

 

3. 네트워크 정보 확인

3.1. IP 정보 확인

bond0의 맥어드레스가 eth0, eth2 와 일치되는게 확인된다.

[root@RHCS-NODE1 ~]# ifconfig

bond0 Link encap:Ethernet HWaddr 00:50:56:AB:75:BC
inet addr:192.168.0.31 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:feab:75bc/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:839670 errors:0 dropped:0 overruns:0 frame:0
TX packets:2657159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:747974849 (713.3 MiB) TX bytes:163858197 (156.2 MiB)

eth0 Link encap:Ethernet HWaddr 00:50:56:AB:75:BC
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:423696 errors:0 dropped:0 overruns:0 frame:0
TX packets:1351330 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:376314056 (358.8 MiB) TX bytes:85228642 (81.2 MiB)

eth1 Link encap:Ethernet HWaddr 00:50:56:AB:7D:E2
inet addr:192.168.11.31 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:feab:7de2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:990650 errors:0 dropped:0 overruns:0 frame:0
TX packets:643385 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:85857610 (81.8 MiB) TX bytes:217080994 (207.0 MiB)

eth2 Link encap:Ethernet HWaddr 00:50:56:AB:75:BC
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:415974 errors:0 dropped:0 overruns:0 frame:0
TX packets:1305829 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:371660793 (354.4 MiB) TX bytes:78629555 (74.9 MiB)

eth3 Link encap:Ethernet HWaddr 00:0C:29:0B:7E:DF
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

eth4 Link encap:Ethernet HWaddr 00:0C:29:0B:7E:E9
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

 

3.2. 기존 bonding 상태 확인

[root@RHCS-NODE1 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

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): 0Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:ab:75:bc
Slave queue ID: 0

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:0b:7e:d5
Slave queue ID: 0

 

4. 장치 변경 작업

4.1. 스크립트 파일 수정

기존 eth0과 eth2은 비활성화, 신규 eth3, eth4은 활성화 되게 스크립트 파일 수정

[root@RHCS-NODE1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:50:56:AB:75:BC
ONBOOT=no
USERCTL="no"[root@RHCS-NODE1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
HWADDR=00:50:56:AB:77:CE
ONBOOT=no
USERCTL="no"[root@RHCS-NODE1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth3
DEVICE=eth3
HWADDR=00:0C:29:0B:7E:DF
ONBOOT=yes
MASTER="bond0"
SLAVE="yes"
USERCTL="no"[root@RHCS-NODE1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth4
DEVICE=eth3
HWADDR=00:0C:29:0B:7E:E9
ONBOOT=yes
MASTER="bond0"
SLAVE="yes"
USERCTL="no"

 

4.2. 장치 빼내기

bond0 장치에서 묶여있는 eth0, eth2를 빼내고 확인한다.

[root@RHCS-NODE1 ~]# ifenslave -d bond0 eth0 eth2

[root@RHCS-NODE1 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

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

 

4.3. network 서비스 재시작

[root@RHCS-NODE1 ~]# /etc/init.d/network restart

 

5. 확인하기

5.1. bond0 확인

신규 NIC(eth3, eth4)가 bond0 로 묶였는지 확인

[root@RHCS-NODE1 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009

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

Slave Interface: eth3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:0b:7e:df
Slave queue ID: 0

Slave Interface: eth4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:0b:7e:e9
Slave queue ID: 0

5.2.  패킷 확인

bond0 쪽 라인을 통해 ping 테스트를 한 뒤 별도의 쉘에서 아래처럼 본다.

[root@RHCS-NODE1 ~]# watch -d -n1 'cat /proc/net/dev'
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth0: 4294 42 0 0 0 0 0 0 1274 19 0 0 0 0 0 0
eth1: 1354563 4593 0 0 0 0 0 0 495111 2737 0 0 0 0 0 0
eth2: 4234 41 0 0 0 0 0 0 128 2 0 0 0 0 0 0
eth3: 18842 196 0 0 0 0 0 0 3992 49 0 0 0 0 0 0
eth4: 18842 196 0 0 0 0 0 0 128 2 0 0 0 0 0 0
bond0: 37684 392 0 0 0 0 0 0 4120 51 0 0 0 0 0 0

5.3. 맥어드레스 확인

마지막으로 ifconfig 명령어를 통해 bond0, eth3, eth4의 맥어드레스가 같은지 확인해 본다.

 

만약 정상적으로 장치 변경이 안될 경우 서버를 리부팅 하길 바라며, 이상으로 문서를 마친다.

bond 장치에 포함된 NIC 교체하기

댓글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다