I
I
ibn_maksimys2018-09-25 13:45:37
linux
ibn_maksimys, 2018-09-25 13:45:37

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

3 answer(s)
V
vreitech, 2018-09-25
@fzfx

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.

R
Ruslan Fedoseev, 2018-09-25
@martin74ua

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.

P
pfg21, 2018-09-25
@pfg21

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 question

Ask a Question

731 491 924 answers to any question