LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-04-2003, 09:16 PM   #1
pembo13
Member
 
Registered: May 2003
Location: Caribbean
Distribution: Fedora Core2
Posts: 403

Rep: Reputation: 30
Simple enough...iptables..port forwarding


Hi guys,

I just wanted a little help.

Could someone give me some sample IPTABLES lines to do port forwading of ports 7750:7751 for both UDP and TCP, to a machine (192.168.100.11).

The router/firewall has:
-eth0 as the internal NIC on IP 192.168.100.1
and
-eth1 as the external NIC on a dynamic IP

And also, isn't #IPTABLE --check suppose to be the command to do rule checking with ITPABLES? If not, what is it to do rule checking please?

Thanks Alot
 
Old 07-05-2003, 12:10 PM   #2
TheOther1
Member
 
Registered: Feb 2003
Location: Atlanta, GA
Distribution: RHAS 2.1, RHEL3, RHEL4, SLES 8.3, SLES 9, SLES9_64, SuSE 9.3 Pro, Ubuntu, Gentoo
Posts: 335

Rep: Reputation: 32
Try:
iptables --check [chain]
to test this packet on chain

Try man iptables to see all commands
 
Old 07-18-2003, 11:05 PM   #3
pembo13
Member
 
Registered: May 2003
Location: Caribbean
Distribution: Fedora Core2
Posts: 403

Original Poster
Rep: Reputation: 30
Portforwading???????
Somebody....Anybody....HELP!!!!!!
 
Old 07-19-2003, 02:22 AM   #4
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 47
use

iptables -t NAT
 
Old 07-19-2003, 03:08 AM   #5
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
Yopu may have already sorted this but a rule like the following should work

iptables -t nat -A PREROUTING -p tcp --dport 7750:7751 -i eth1 -j DNAT --to 192.168.100.11

any connection to eth1 on ports 7750 or 7751 will be passed through to 192.168.100.11 (just change tcp fpr udp for the udp part).

Rich
 
  


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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 08:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 01:08 PM
iptables on router: simple port forwarding not working hamish Linux - Networking 1 10-27-2005 07:06 AM
Simple iptables forwarding 8080 -> 80 gstarrett Linux - Networking 3 03-17-2004 01:52 PM
How can I do simple port forwarding on RH9? yetalu Linux - Networking 4 07-14-2003 08:44 PM


All times are GMT -5. The time now is 12:53 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration