Friday, 23 August 2013

How to do port forwarding/redirecting on Debian?

How to do port forwarding/redirecting on Debian? References I have two questions. Question 1: My debian machine has interface eth3 with ip 192.168.57.28. If someone tries to connect to 192.168.57.28:1234 how do I redirect the request to another machine: 192.168.57.25:80? Question 2: If my debian machine has two interfaces: eth3 with 192.168.57.28 and ppp0 with some dynamic IP and someone tries to connect via ppp0 on port 1234, how do I redirect the request to 192.168.57.25:80? I have tried this: $ iptables -t nat -A PREROUTING -p tcp --dport 1234 -j DNAT --to-destination 192.168.57.25:80 $ echo 1 > /proc/sys/net/ipv4/ip_forward but it doesn\'t work.

No comments:

Post a Comment