![Centos7(로드 밸런싱)을 QNAP(트렁크)에 직접 연결](https://linux55.com/image/128444/Centos7(%EB%A1%9C%EB%93%9C%20%EB%B0%B8%EB%9F%B0%EC%8B%B1)%EC%9D%84%20QNAP(%ED%8A%B8%EB%A0%81%ED%81%AC)%EC%97%90%20%EC%A7%81%EC%A0%91%20%EC%97%B0%EA%B2%B0.png)
이야기는 이렇습니다. 여러 NIC(eno1, 2, 3, 4 등)가 있는 서버(x3650M5)가 있습니다. 운영체제는 CentOS7입니다. Eno1이 다운되고 eno2가 로컬 네트워크(10.10.10.11/24)에 연결됩니다. eno3 및 eno4를 통해 서버를 QNAP ts453 NAS에 연결하고 싶습니다. QNAP NAS에는 eth0, 1, 2, 3 등 4개의 네트워크 카드도 있습니다. Eth0은 로컬 네트워크(10.10.10.12/24)에 연결되어 작동합니다. 서버와 NAS는 eno3<->eth2와 eno4<->eth3에 직접 연결됩니다.
단일 연결(예: eno3에서 eth2로)을 사용하고 주소를 예를 들어 설정합니다. 서버의 eno3에서 10.10.11.20/24, NAS의 eth2에서 10.10.11.21, 연결이 정상입니다(ping, LUN 매핑 등).
서버에 10.10.11.20/24, 서버에 10.10.11.21이 있는 eno3과 4(Centos의 로드 밸런싱 모드로 설정하는 것이 좋음)와 NAS(eth2 및 3 균형 tldb 모드)의 조합을 사용하려고 하면 NAS /24 바인딩시 연결이 되지 않습니다.
서버에서 NetworkManager를 사용할 때 때때로 연결이 작동하지만 핑이 9패킷 동안 지속되다가 종료됩니다. 그래서 저는 NetworkManager(중지 및 비활성화)를 제거하기로 결정하고 ifcfg 파일 편집으로 이동했습니다.
ifcfg-team0:
DEVICE=team0
DEVICETYPE=Team
TEAM_CONFIG="{\"runner\": {\"name\": \"loadbalance\"}}"
BOOTPROTO=none
IPADDR=10.10.11.20
PREFIX=24
NAME=team0
ONBOOT=yes
NM_CONTROLLED=no
Slaves:
ifcfg-team0-eno3:
DEVICE=eno3
DEVICETYPE=TeamPort
TEAM_MASTER=team0
NAME=team0-eno3
ONBOOT=yes
NM_CONTROLLED=no
ifcfg-team0-eno4:
DEVICE=eno4
DEVICETYPE=TeamPort
TEAM_MASTER=team0
NAME=team0-eno4
ONBOOT=yes
NM_CONTROLLED=no
teamdctl team0 state:
setup:
runner: loadbalance
ports:
eno3
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
eno4
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
ifconfig team0:
team0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.11.20 netmask 255.255.255.0 broadcast 10.10.11.255
inet6 fe80::a94:efff:fe58:70f0 prefixlen 64 scopeid 0x20<link>
ether 08:94:ef:58:70:f0 txqueuelen 1000 (Ethernet)
RX packets 7 bytes 707 (707.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 131 bytes 8329 (8.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
마침내 route -n
:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.10.10.138 0.0.0.0 UG 0 0 0 eno2
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eno2
10.10.11.0 0.0.0.0 255.255.255.0 U 0 0 0 team0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eno1
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eno2
169.254.0.0 0.0.0.0 255.255.0.0 U 1004 0 0 ens4f0
169.254.0.0 0.0.0.0 255.255.0.0 U 1005 0 0 eno3
169.254.0.0 0.0.0.0 255.255.0.0 U 1006 0 0 eno4
169.254.0.0 0.0.0.0 255.255.0.0 U 1007 0 0 ens4f1
169.254.0.0 0.0.0.0 255.255.0.0 U 1008 0 0 ens4f2
169.254.0.0 0.0.0.0 255.255.0.0 U 1009 0 0 ens4f3
169.254.0.0 0.0.0.0 255.255.0.0 U 1011 0 0 team0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
NAS에서
ifconfig
::
bond0 Link encap:Ethernet HWaddr 24:5E:BE:26:6F:60
inet addr:10.10.11.21 Bcast:10.10.11.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:1105 errors:0 dropped:574 overruns:0 frame:0
TX packets:105005 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:103142 (100.7 KiB) TX bytes:6566084 (6.2 MiB)
eth0 Link encap:Ethernet HWaddr 24:5E:BE:26:6F:5E
inet addr:10.10.10.12 Bcast:10.10.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:503686 errors:0 dropped:77 overruns:0 frame:0
TX packets:370782 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:83802168 (79.9 MiB) TX bytes:248700488 (237.1 MiB)
Memory:91400000-9141ffff
eth1 Link encap:Ethernet HWaddr 24:5E:BE:26:6F:5F
UP 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)
Memory:91300000-9131ffff
eth2 Link encap:Ethernet HWaddr 24:5E:BE:26:6F:60
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:3361082 errors:0 dropped:34 overruns:0 frame:0
TX packets:380048 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5024263161 (4.6 GiB) TX bytes:45039739 (42.9 MiB)
Memory:91200000-9121ffff
eth3 Link encap:Ethernet HWaddr 24:5E:BE:26:6F:61
UP BROADCAST NOTRAILERS RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:776 errors:0 dropped:461 overruns:0 frame:0
TX packets:54162 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:73093 (71.3 KiB) TX bytes:3934987 (3.7 MiB)
Memory:91100000-9111ffff
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1238295 errors:0 dropped:0 overruns:0 frame:0
TX packets:1238295 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:352816577 (336.4 MiB) TX bytes:352816577 (336.4 MiB)
route -n
:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.10.10.138 0.0.0.0 UG 0 0 0 eth0
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.10.11.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
ifcfg에 뭔가를 추가해야 합니까? LACP(802.3ad) 및 Balance-alb 모드도 시도했지만 성공하지 못했습니다.
답변1
서버와 NAS를 연결하는 Cisco 스위치에서 LACPI 및 VLAN을 올바르게 설정하여 해결되었습니다.