Linux-Noob Forums

Full Version: iptables redirect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Guest


A local ISP blocks port 25 so mail users cannot use my smtp server. I need to redirect port 2525 to 25 so my users can bypass this.

 

Ive done this on bsd servers but cant get it to stick with iptables on linux. I have use different variations but here is one of the commands i have tried:

 

iptables -t nat -A PREROUTING -i eth0 -p tcp -dport 2525 -j REDIRECT --to-port 25

 

any help would be most appreciated.

 

cool beans.

 

questorX


/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 2525 -j DNAT --to 192.168.0.10:25

 

this will forward all incoming tcp traffic on the eth0 interface to port 2525 over to internal machine 192.168.0.10 on port 25