T
T
Templar3d2022-03-18 19:31:22
iptables
Templar3d, 2022-03-18 19:31:22

How to redirect from one ip to another without hiding your ip?

Task. When connecting to port 2222, redirect to ip 1.2.3.4 and port 22, but so that the real ip of the clients (more than 1) can be seen on the server 1.2.3.4
With this redirection:

-A PREROUTING -p tcp -m tcp --dport 2222 -j DNAT --to-destination 1.2.3.4:22
-A POSTROUTING -j MASQUERADE

because of the MASQUERADEip of the client is substituted. What to replace MASQUERADE?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2022-03-18
@q2digger

Remove the line with a masquerade, on the host where you are sending, configure the routes correctly. On the host where you are redirecting, make sure that routing is enabled.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question