LinuxQuestions.org
Visit Jeremy's Blog.
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 07-18-2002, 02:18 AM   #1
gofauna
LQ Newbie
 
Registered: Jul 2002
Posts: 6

Rep: Reputation: 0
Port Forwarding under Mandrake /w iptables


I'm using Mandrake 8.2 with iptables and not those weird $IPTABLES thingy I've been seeing a lot of. Just what are they anyways?

My problem is that I want to forward port 6112 from the outside world to 192.168.1.3 (both are using eth0). What exactly do I need?

My current config consists of:

modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward

#[Basic Routing]
/sbin/iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE

THAT'S IT!! It works for anything the windows client use, like ICQ, Web browsingm, etc. But if I were to foward a port 6112, I was told that I need DNAT for incomming and SNAT for outgoing. Also one more question: Can I forward 1 port over a range of internal IPs? Just what would happen if it does work? And is it possible for a packet that is forwarded to port 6112 be redirected to EITHER of the many windows client that is connected to the Linux box? (eg, 2 different windows clients uses port 6112 to contact with the outside world, any way to modify the incomming packets, headers, etc so it fowards to client 1 or client 2 accordingly?)

Thanks a bunch!!
 
Old 07-18-2002, 10:00 AM   #2
turnip
Member
 
Registered: Jul 2002
Posts: 143

Rep: Reputation: 15
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 6112 -j DNAT --to 192.168.1.3

And do that for udp as well

You can only forward one port to one ip one time.
Oh and you do not need any snat rules.

Last edited by turnip; 07-18-2002 at 04:30 PM.
 
Old 07-18-2002, 04:32 PM   #3
htimst
LQ Newbie
 
Registered: Nov 2001
Distribution: RedHat 7.2
Posts: 24

Rep: Reputation: 15
Quote:
I'm using Mandrake 8.2 with iptables and not those weird $IPTABLES thingy I've been seeing a lot of. Just what are they anyways?
Many users define /sbin/iptables as a variable in their firewall scripts soas not to keep typing /sbin. $IPTABLES and /sbin/iptables are thus the same thing provided the defintion exists.

Cheers!
 
  


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
iptables port forwarding MadTurki Linux - Networking 6 01-05-2004 01:03 PM
port forwarding with iptables David_99 Linux - Security 5 12-09-2003 08:37 PM
Iptables - Port Forwarding luivm Linux - Networking 3 05-19-2003 02:30 PM
iptables port forwarding hawk4eye Linux - Security 2 02-07-2003 04:47 AM

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

All times are GMT -5. The time now is 08:08 PM.

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