Answer the question
In order to leave comments, you need to log in
How to disable network address redirection to 127.0.0.1 in linux?
There are two programs I have written for linux (Ubuntu 18.04) that communicate over the network. When running them on different devices, you can track the traffic between them using tcpdump. When I run them on one computer, instead of communicating through the interface I specified (for further traffic mirroring on the switch), all traffic is redirected by the system to loopback, is it possible to disable such optimization somehow?
Answer the question
In order to leave comments, you need to log in
as long as the destination IP address, which is indicated in the headers of the packets being sent, belongs to the same host from which the sending is taking place, and the same subnet as the sender's address, your packets will not leave the host.
I would put each program in a separate vlan with a separate subnet and configure IP routing on the switch (if it can, of course) or on a separate machine.
Alternatively, you can use containerization or virtualization.
within the same server, you won't force a package between two programs to leave the server.
Virtualka, with a network forwarded inside, included in a separate switch port.
rough hack - to prescribe programs to communicate not with localhost (127.0.0.1) but with some address on the network.
at this address, set the redirection of packets back to the source computer to the appropriate ports of both programs or whatever.
ps what's stopping you from mirroring/sniffing traffic directly on the local computer interface with these two programs??
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question