LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2007, 04:14 PM   #1
sandy
Member
 
Registered: Aug 2002
Location: Mumbai,India
Distribution: Linux Mint 12, Gentoo
Posts: 230

Rep: Reputation: 30
Question Problem with port forwarding


Here's the setup : I have got 2 LANS ( lets call them external and internal )

Router A:
eth1 - 10.5.1.14 ( connects to external LAN )
eth0 - 10.1.11.4 ( connects to internal LAN )

I have a webserver running on the internal LAN machine (IP: 10.1.1.11) on port 8080 and would like it to be accessible from 10.5.0.0 network by some kind of natting. I went through lots of guides and finally came up with the solution :

Quote:
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 8080 -j DNAT --to 10.1.1.11 ( or --to 10.1.1.11:8080 )
iptables -A FORWARD -i eth1 -o eth0 -p tcp -d 10.1.1.11 --dport 8080 -j ACCEPT
But surprisingly this is not working. when I do telnet on 8080 port of 10.5.1.14 , I get a "connection refused". Can somebody please help me to find out where I might have gone wrong ?

Thanks in advance...
san
 
Old 10-29-2007, 05:01 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
You need to put this in front of all your FORWARD rules:
Code:
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
 
  


Reply

Tags
port forwarding



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
port forwarding problem! shio Linux - Networking 3 10-16-2007 05:16 AM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Port Forwarding problem Koven Linux - Networking 8 10-08-2006 08:42 PM
port forwarding problem bruj3w Linux - Networking 3 08-13-2004 08:13 PM
port forwarding problem roueleader Linux - Newbie 9 06-11-2002 04:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:11 AM.

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