0

I have a system with custom hardware hooked up to 2 different ethernet ports on the same system. The interfaces are configured on the same subnet because the hardware (FPGA-based) has a hardcoded IP address linked to the configuration of the hardware. I don't want the configuration to be sensitive to which port the device is connected.

The devices respond to ARP requests made by the computer, which works seemlessly if there is one device. However, if there are two devices connected, the ARP requests for the second device are only sent out the interface that the first one is connected to, thus the device cannot be communicated with via a standard socket.

At first glance, this seems to be like the reverse of the problem seen here. The solutions there do not appear to work.

Any suggestions to make linux send ARP requests on a particular subnet out over all of the interfaces on the same subnet?

A Summary of the setup:

eth2 - IP: 192.168.1.102, Subnet:255.255.255.0, Gateway: 192.168.1.0

eth3 - IP: 192.168.1.103, Subnet:255.255.255.0, Gateway: 192.168.1.0

Device IP Addresses:

192.168.1.2, 192.168.1.3

dfreese
  • 101

3 Answers3

0

If I understand your setup correctly - although I'm not sure I do, I believe the solution is to bridge eth2 and eth3 (so that it acts like a switch) and then create br0 for 192.168.1.102 and create a virtual interface br0:1 for 192.168.1.103

The exact specifics for setting up a bridge can be found here.

I do note that this means that the device with the hard coded IP address will be able to see all the other devices (ie as if it were plugged into a common switch - and I am not sure if this is a problem. I've not done it, but if it is a problem you should be able to firewall it off using ebtables.

davidgo
  • 5,964
  • 2
  • 21
  • 38
0

In such a strange configuration, I would just configure the arp and routing tables manually.

ip neigh add to 192.168.1.2 dev eth2 lladdrr DEVICEMAC1 permanent
ip neigh add to 192.168.1.3 dev eth3 lladdrr DEVICEMAC2 permanent
ip route add to 192.168.1.2/32 dev eth2
ip route add to 192.168.1.3/32 dev eth3

substituting the proper mac addresses for DEVICEMAC 1 and 2.

sciurus
  • 12,493
  • 2
  • 30
  • 49
0

I believe one my previous questions might be of help: ARP responds with single MAC address on Linux server with multiple interfaces on the same network

Check out the first response.

sardean
  • 833
  • 3
  • 14
  • 34