大网数据广告活动
服务器运维问答

wierd arp issue with 2 interafces sharing same subnet

· 52CE 我爱测

I have two linux machines connected through a switch. bothe machines run linux RHEL 7.3 kernel 3.10.0-327.el7.x86_64 one of the machines is connected with both ports to the switch and the other with one port. both ports share sam…

问题原文

原帖链接 · user664174 · CC BY-SA 3.0

I have two linux machines connected through a switch.

bothe machines run linux RHEL 7.3 kernel 3.10.0-327.el7.x86_64

one of the machines is connected with both ports to the switch and the other with one port.

both ports share same subnet.

ifconfig machine 1
ens3f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 6.6.6.2  netmask 255.255.255.0  broadcast 6.6.6.255
        ether 34:9a:17:aa:28:1b  txqueuelen 1000  (Ethernet)

ifconfig machine 2

ens1f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 6.6.6.11  netmask 255.255.255.0  broadcast 6.6.6.255
    ether 34:9a:17:65:55:5d  txqueuelen 1000  (Ethernet)

ens3f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 6.6.6.12  netmask 255.255.255.0  broadcast 6.6.6.255
    ether 34:9a:17:aa:26:1b  txqueuelen 1000  (Ethernet)

i flushed the arp tables using

ip -s neigh flush

then i run a tcp server on machine 1 (with one port), and a tcp client that binds to a specific device (device ens3f1 with ip 6.6.6.12) on machine 2. i see this in the arp table of the server (machine1)

ip neigh show
6.6.6.12 dev ens3f1 lladdr 34:9a:17:65:55:5d REACHABLE
10.224.12.254 dev eno1 lladdr 00:00:5e:00:01:01 REACHABLE
6.6.6.11 dev ens3f1  FAILED

as you can see in the arp table i see a connection between ip 6.6.6.12 and mac 34:9a:17:65:55:5d but in the ifconfig you see this data is not correct. after running agian the clinet with bind to the other port (6.6.6.11) i see this arp table

6.6.6.12 dev ens3f1 lladdr 34:9a:17:65:55:5d REACHABLE
10.224.12.254 dev eno1 lladdr 00:00:5e:00:01:01 REACHABLE
6.6.6.11 dev ens3f1 lladdr 34:9a:17:65:55:5d REACHABLE

here you can see both ip's has the same mac!! doe's anyone know how to solve this issue? this is the tcpdump in the two machines

tcpdump: listening on ens1f1, link-type EN10MB (Ethernet), capture size    65535 bytes
17:36:39.309925 34:9a:17:aa:28:1b (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has ***** (Broadcast) tell 6.6.6.2, length 46
17:36:39.309931 34:9a:17:65:55:5d (oui Unknown) > 34:9a:17:aa:28:1b (oui Unknown), ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Reply ****** is-at 34:9a:17:65:65:5d (oui Unknown), length 28

tcpdump -i ens3f1 -e -vv
tcpdump: listening on ens3f1, link-type EN10MB (Ethernet), capture size 65535 bytes
17:36:39.309941 34:9a:17:aa:28:1b (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has r-aa-nitro01.rdmz.labs.

Thanks!!

已采纳解答

原帖链接 · user664174 · CC BY-SA 4.0

at the end i did this settings

$ sysctl -w net.ipv4.conf.[DEVICE].arp_announce=1
$ sysctl -w net.ipv4.conf.[DEVICE].arp_ignore=2
$ sysctl -w net.ipv4.conf.[DEVICE].rp_filter=0
$ sysctl -w net.ipv4.conf.[DEVICE].arp_filter=0

i got from http://jefflane.org/v2/technology/multiple-nics-on-the-same-subnet-avoiding-arp-flux/

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-09-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。