Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-02-2004, 10:29 AM   #1
Registered: Feb 2004
Posts: 37

Rep: Reputation: 15
Iptables -- Port Forwarding

i am using Slackware with IPTABLES latest version ..i have a webserver( inside my lan and i am forwarding my external traffic(say 213.130.x.x static IP) at 80 to my internal webserver at the same port

i use the following rule for it

$IPT -A FORWARD -p tcp -i ppp0 -d --dport 80 -j ACCEPT
$IPT -t nat -A PREROUTING -p tcp -i ppp0 -d 213.130.x.x --dport 80 -j DNAT --to

its working perfectly and forwarding all traffic 2 my internal IP of other internet users

but the problem is that i cant browse my website on internal server ( from any other computer on LAN

can u guys tell me where am i doing wrong


Old 06-02-2004, 10:50 AM   #2
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
your web server and local are located in network?
if it is so i think it wont work.

if your webserver and local network are in different networks, i think u can do that with followings:
iptables -t nat -A PREROUTING -s local_net/subnet -d 213.130.x.x -p tcp --dport 80 -j DNAT --to
iptables -t nat -A POSTROUTING -s -d local_net/subnet -p tcp --sport 80 -j SNAT --to linux_local_net_interface_ip
Old 06-02-2004, 11:14 AM   #3
Registered: Feb 2004
Posts: 37

Original Poster
Rep: Reputation: 15
thankx maxut
i will try it
Old 06-03-2004, 03:29 PM   #4
LQ Newbie
Registered: Dec 2003
Location: Germany
Distribution: Gentoo
Posts: 27

Rep: Reputation: 15
Can you reach your webserver by using the ip address, not the URL? Ensure, taht the URL is resolvable via DNS.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables port forwarding geoff3425 Slackware 13 12-20-2011 11:50 AM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 08:35 PM
IPTables port forwarding.. NeoTech Linux - Networking 2 01-03-2005 12:27 PM
port forwarding with iptables David_99 Linux - Security 5 12-09-2003 09:37 PM
IPTABLES port forwarding sal_paradise42 Linux - Networking 5 10-25-2003 05:11 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration