LinuxQuestions.org
Help answer threads with 0 replies.
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 03-30-2004, 06:23 PM   #1
gbg
Member
 
Registered: Aug 2003
Location: Lisbon Portugal
Distribution: Red Hat 9
Posts: 55

Rep: Reputation: 15
Unhappy Firestarter or IPTables config?


Lets look at the scenario:

- Linux Box with 2 NICS (eth0 & eth1)
- Connect internet over eth0 and a cable modem
- NAT to eth1 (10.0.0.x)
- Power Book G4 manually configured 10.0.0.2 (default gw - 10.0.0.1)

So far so good.

Now I am running XPlane (a ver nice flight sim for mac os x) + XsquawkBox. I need to install RogerWilco (up and running). But the problem starts here, I need to outside connections reaches the Mac (10.0.0.2) On port 3782. I must create a rule (in iptables, I suppose) that forwards incoming tcp/udp connections on port 3782 to my private network 10.0.0.2. Ok, I am a newbie in iptables conf. Any helps?

Thank you.
 
Old 03-30-2004, 07:44 PM   #2
eccles23
Member
 
Registered: Jun 2003
Location: Australia
Distribution: Gentoo/kernel 2.6.2
Posts: 45

Rep: Reputation: 15
try this (on your gateway box):

# iptables -v -t nat -A PREROUTING -i eth0 -p tcp --dport 3782 -j DNAT --to-destination 10.0.0.2:3782
# iptables -v -t nat -A PREROUTING -i eth0 -p udp --dport 3782 -j DNAT --to-destination 10.0.0.2:3782

that should work.

oh actually... it will need to go before any of the reject rules. so either insert it into the script you use that sets up the rules at bootup, or use '-I' (insert) rather than '-A' (add) to put it at the start of the PREROUTING rules.

must be run as root of course.

[in english, it says "if packets recieved from the internet (eth0) are destined for port 3782 and are tcp or udp, then before doing anything else with them, change their destination IP address to 10.0.0.2 and port to 3782"...]

Last edited by eccles23; 03-30-2004 at 07:48 PM.
 
Old 03-31-2004, 06:44 AM   #3
gbg
Member
 
Registered: Aug 2003
Location: Lisbon Portugal
Distribution: Red Hat 9
Posts: 55

Original Poster
Rep: Reputation: 15
No more no less!!! I have built that rule, but was using -A instead of -I. BTW after I create a new Chain (-N Flag) 2 min past and the chain/rule disapears.

Very much appreciated for your useful help!
 
  


Reply


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
Firestarter config issues... headcase Linux - Networking 3 06-21-2005 07:57 AM
Iptables? firestarter? Santa Atrocity Fedora 5 02-23-2005 05:15 PM
iptables and firestarter question shilo Slackware 7 02-04-2005 12:18 AM
securing using firestarter or iptables PennyroyalFrog Linux - Security 3 10-13-2004 01:36 PM
firestarter iptables PennyroyalFrog Linux - Newbie 1 10-10-2004 03:08 PM

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

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