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 05-14-2005, 03:10 PM   #1
Introx
LQ Newbie
 
Registered: Apr 2004
Posts: 11

Rep: Reputation: 0
Mapping ports with iptable? please help, urgent!


okey gurus... I need help with iptable, and I'm a bit noob on this area..

This is the problem: I have a debian box as a router in my home,
the kernel version is 2.6.8-1-686 and I got all necessary modules loaded.

The real problem is that my working-computer is, yes windows XP my job is graphics and animations, on the network with the IP 10.0.0.100 and I need port 3389 and 21 to that PC.. I have no clue whatsoever how I'm going to manage this and that's why I'm asking you gurus..

ip to router: 10.0.0.1
ip to me: 10.0.0.100

needed ips: 3389, 21

please help, I need this quick :s , thanks,


André.
 
Old 05-15-2005, 02:13 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
To forward ports from the linux router to the windows machine add the following:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 21 -j DNAT --to-destination 10.0.0.100
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 3389 -j DNAT --to-destination 10.0.0.100

iptables -A FORWARD -i eth0 -o eth1 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -p tcp --dport 3389 -j ACCEPT
iptables -A FORWARD -i eth1-o eth0 -j ACCEPT

For the above rules I've used eth0 as the external interface on the linux router and eth1 as the internal interface conneting to the LAN. Verify those are correct before add the rules. Also enable paket forwarding with: echo "1" > /proc/sys/net/ipv4/ip_forward

If port forwarding wasn't what you're trying to do, then explain in more detail what you'd like to accomplish
 
Old 05-16-2005, 07:50 AM   #3
Introx
LQ Newbie
 
Registered: Apr 2004
Posts: 11

Original Poster
Rep: Reputation: 0
It worked perfectly thanks caveman
 
  


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
boot sector and lilo collapse !!!!! URGENT URGENT URGEN !!!!! frelihm Linux - Software 21 12-02-2009 10:21 AM
Urgent: Opening ports for passive FTP connections in smoothwall? orange400 Linux - Networking 2 05-27-2004 05:15 AM
Mapping USB Dev Files to Ports rg500g Linux - Hardware 2 05-14-2004 05:33 PM
Urgent Urgent !!!! Mozilla Keeps All Your Deleted Emails !!!! odin123 Linux - Software 2 01-31-2004 02:22 AM
physical scsi channel mapping to scsiX device node mapping, how to configure manually drthornt Linux - Hardware 3 02-09-2003 11:50 AM

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

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