View previous topic :: View next topic |
Author |
Message |
Kenji Miyamoto Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/108568614c11b737d3e30.jpg)
Joined: 28 May 2005 Posts: 1452 Location: Looking over your shoulder.
|
Posted: Sun Apr 27, 2008 4:13 am 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? _________________ [ Kawa-kun, new and improved!! ]
Alex Libman seems to be more of an anarchist than a libertarian.
Last edited by Kenji Miyamoto on Sun Apr 27, 2008 1:59 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Inodoro_Pereyra Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/92378496348d685bd147ab.gif)
Joined: 03 Nov 2006 Posts: 2631 Location: En la otra punta del cable
|
Posted: Sun Apr 27, 2008 5: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. _________________ Mi Blog.
Si no fuera por C, estaríamos escribiendo programas en BASI, PASAL y OBOL. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
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
|
|