0

I have a Linux box with two fiber interfaces connected to each other. Is there any way to set up routing in a way that would actually send the packets over the link? So far it looks like when two interfaces are on the same machine, there is no way to connect between them except via loopback.

grk
  • 3
  • 1

2 Answers2

0

To the best of my knowledge TCP/IP stack will short-circuit any communication between any local interfaces. Therefore no package will ever be sent or received over the link.

Paweł Brodacki
  • 6,451
  • 19
  • 23
0

With just the native TCP/IP stack and properly configured interfaces, the host will choose the best route to the final destination, which in this case does not involve sending the packets over the fiber for unicast traffic. It is possible to send broadcast traffic over the link or setup routes to generate traffic which can be seen by sniffers such as tcpdump or wireshark if you just need to verify interface functionality.

It is possible to have another process (vm/test suite/etc) with it's own IP stack setup to bypass the host's stack. In my experience, this requires an interface to be set to promiscuous and the process will need to be running as root. This allows that process to see all traffic arriving on the interface, in addition to being able to directly send out packets on the wire.

It is important that the Linux host itself does not have the same network configuration on any interface as this process is using so that it appears as a 2nd host on the network. Otherwise it will short circuit traffic between the two interfaces. Assuming that is not the case, the other interface which is talking to the process will not know it is really talking to the same machine and will send packets across the link to reach the "2nd host".

hallsa
  • 138
  • 4