Linux, two fiber interfaces connected to each other – routing

Posted on

Linux, two fiber interfaces connected to each other – routing – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, routing, ip-routing, , .

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.

Solution :

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”.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *