CentOS 7 nmcli를 이용한 본딩 방법
1. 본딩에 사용할 디바이스 확인
DEVICE TYPE STATE CONNECTION
eno16777736 ethernet connected ethernet-eno16777736
eno33554976 ethernet connected ethernet-eno33554976
2. 기존 Connection 확인 후 삭제
NAME UUID TYPE DEVICE
ethernet-eno33554976 e6b99dfd-f18f-4b85-bcf6-c79adb8676d7 802-3-ethernet eno33554976
ethernet-eno16777736 f8a9db6c-2549-4cc3-a3ba-24703e521f55 802-3-ethernet eno16777736
# nmcli con del ethernet-eno33554976
# nmcli con del ethernet-eno16777736
# nmcli con
NAME UUID TYPE DEVICE
3. 본딩 인터페이스 추가 하기
Connection 'bond0' (7e9ac222-5445-484d-9aaa-81c9681980bb) successfully added.
4. 만들어진 본딩 인터페이스 bond0에 ip 수동 설정 (생략하면 디폴트로 dhcp가 구성 된다)
# nmcli con mod bond0 ipv4.gateway 192.168.3.1
# nmcli con mod bond0 ipv4.method manual
5. 슬레이브 인터페이스 추가 (1번에서 확인한 디바이스 이름 사용)
Connection 'bond0-eth0' (29b2492c-222f-43fe-a8cd-da1ab35f9131) successfully added.
# nmcli con add type bond-slave con-name bond0-eth1 ifname eno33554976 master bond0
Connection 'bond0-eth1' (d9fce37a-fc58-4210-b9fc-601316cb031d) successfully added.
6. bond0 인터페이스를 up 시킨다
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)
7. Connection 정보 확인
NAME UUID TYPE DEVICE
bond0-eth1 d9fce37a-fc58-4210-b9fc-601316cb031d 802-3-ethernet eno33554976
bond0-eth0 29b2492c-222f-43fe-a8cd-da1ab35f9131 802-3-ethernet eno16777736
bond0 7e9ac222-5445-484d-9aaa-81c9681980bb bond bond0
# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno16777736: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP mode DEFAULT qlen 1000
link/ether 00:0c:29:2f:ba:26 brd ff:ff:ff:ff:ff:ff
3: eno33554976: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP mode DEFAULT qlen 1000
link/ether 00:0c:29:2f:ba:26 brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT
link/ether 00:0c:29:2f:ba:26 brd ff:ff:ff:ff:ff:ff
# ifconfig bond0
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 192.168.3.125 netmask 255.255.255.0 broadcast 192.168.3.255
inet6 fe80::20c:29ff:fe2f:ba26 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:2f:ba:26 txqueuelen 0 (Ethernet)
RX packets 89 bytes 10605 (10.3 KiB)
RX errors 0 dropped 2 overruns 0 frame 0
TX packets 62 bytes 5692 (5.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# 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: eno16777736
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eno33554976
MII Status: down
Speed: Unknown
Duplex: Unknown
Link Failure Count: 2
Permanent HW addr: 00:0c:29:2f:ba:30
Slave queue ID: 0
Slave Interface: eno16777736
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:0c:29:2f:ba:26
Slave queue ID: 0
음.. 그런데 통신이 안된다.. nmcli con에서도 bond0가 2개로 보이고..
아무래도 본딩을 이것저것 만들었다 지웠다하니 뭔가 꼬인거 같은데
여튼 재부팅 하니 잘된다. 하나씩 연결 끊어봐도 핑도 잘되고.
잘되면 된거지 뭐 -_-a
끝!
PS
1. nmtui로 하면 좀 더 직관적이긴한데 탭키로 왔다리 갔다리 하는게 너무 귀찮다.
2. 기존처럼 ifcfg 파일을 직접 수정해도 된다.(고 RHEL 메뉴얼에 나와있지만 안해봄.. 귀찮....)
'Server Engineer > Linux' 카테고리의 다른 글
ZFS on CentOS 6 - 컴파일 설치.2 (0) | 2016.06.02 |
---|---|
ZFS on CentOS 6 - 컴파일 설치 (0) | 2016.06.02 |
ZFS on CentOS 6 - Yum 설치 (0) | 2016.06.02 |
CentOS7 에서 KVM 가상머신 만들기 (0) | 2016.04.29 |
RHEL6 초간단 Yum 구성 (0) | 2016.02.16 |