LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-20-2003, 11:45 AM   #1
jglazner
LQ Newbie
 
Registered: Aug 2003
Posts: 17

Rep: Reputation: 0
Iptables Forwarding Help!!


Hi,

we have a mac on the network runnign timbucktu on port 407. the problem is that it is behind our firewall. I need to setup port forwarding so that all traffic destined for that port goes to that pc.

I am running RH 9 and iptables. i edited the iptables and added this line:

-A PREROUTING -i eth0 -p tcp -m tcp -d *.*.*.* --dport 407 -j DNAT --to 10.10.1.243:407

but when i try to telnet to it does nothing. it doesn't give me any errors or anyting it just says trying ....

ethereal on it and it is sending SYN packets over and over but never gets a response? how can i correct this problem?
 
Old 10-20-2003, 04:59 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
A couple of thoughts...

You don't need the -d definition in the PREROUTING unless you have more than 1 ip number on the interface

Which rules precede this one?
Specific rules like this should be in the beginning of the ruleset rather than -A adding them to the end...

Practise using -j LOG entries before each DNAT, eg
-A PREROUTING -i eth0 -p tcp --dport 407 -j LOG --log-prefix "nat_in " to watch that packets are arriving

Packets can still die later in the FORWARD chain...
Make sure there is a rule to allow this port, eg
-I FORWARD 3 -p tcp --dport 407 -d 10.10.1.243 -j ACCEPT

Of course, just adding these rules can break your firewall too, depending on the existing rulesets.
If you have edited /etc/sysconfig/iptables directly, be aware there is a special syntax it expects and DNAT --to is not correct there.
Always better to do it from a command line until you are satisfied it works, then do service iptables save to keep them stored. The command line adds the rule immediately whereas /etc/sysconfig/iptables additions require iptables to be restarted to activate the rules.

A recommended tutorial.

Last edited by peter_robb; 10-20-2003 at 05:02 PM.
 
Old 10-20-2003, 05:04 PM   #3
jglazner
LQ Newbie
 
Registered: Aug 2003
Posts: 17

Original Poster
Rep: Reputation: 0
thatnks for the tuturial. that helped.
 
  


Reply



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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
help with iptables and forwarding laclac01 Linux - Networking 1 10-23-2005 07:16 AM
iptables forwarding... AnalyticaL Linux - Networking 5 09-28-2004 08:55 AM
iptables and forwarding rincewind Linux - Networking 2 03-30-2004 11:23 AM
IP forwarding through iptables harshalupatel Linux - Networking 0 06-18-2003 01:29 PM

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

All times are GMT -5. The time now is 03:16 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