i have an issue with my network setting and i need a port forwarding a bit advanced.
I need : - All packets that arrive on my public_ip on port 54321 to be forward on port 12345 but i don't want any translation when it come from localhost.
Thanks
i have an issue with my network setting and i need a port forwarding a bit advanced.
I need : - All packets that arrive on my public_ip on port 54321 to be forward on port 12345 but i don't want any translation when it come from localhost.
Thanks
Try using REDIRECT of iptables
.
iptables -t nat -I PREROUTING -d <public ip> -p tcp --dport 54321 -j REDIRECT --to-port 12345
If you need udp
, just change the protocol.