| View previous topic :: View next topic |
| Author |
Message |
Kenji Miyamoto Veteran


Joined: 28 May 2005 Posts: 1302 Location: Looking over your shoulder.
|
Posted: Sat Apr 26, 2008 11:13 pm Post subject: Simple IPTables: Port Forwarding (SOLVED) |
|
|
I know this has been talked about again and again, but a search on Google doesn't provide any clear, simple solutions to port forwarding under IPTables. This is the 'normal' port forwarding as in under NAT routers: port X on a machine routes to port Y on another machine behind the NAT, and traffic flows both ways (through NAT). How would I do this? _________________ "So they turn the 'For every new Windows you have to buy new hardware' around to 'For every new hardware you have to buy a new Windows'."
Kawa-kun!
Last edited by Kenji Miyamoto on Sun Apr 27, 2008 8:59 am; edited 1 time in total |
|
| Back to top |
|
 |
Inodoro_Pereyra Veteran


Joined: 03 Nov 2006 Posts: 2076 Location: En la otra punta del cable
|
Posted: Sun Apr 27, 2008 12:59 am Post subject: |
|
|
Lets suppose you want to port forward 4662 TCP (edk) to 192.168.0.50 and your router wan interface is ppp0:
| Code: | iptables -A FORWARD -i ppp0 -o ethX -p tcp --dport 4662 -j ACCEPT #This line only if you have a DROP, then ACCEPT policy.
iptables -A PREROUTING -p tcp --dport 4662 -i ppp0 -j DNAT --to 192.168.0.50:4662 #this one will do the trick |
Where ethX should be replaced with your lan network adapter name.
Regards. _________________ ¿Osas enfrentarte a Maikel Yacson?. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|