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 09-20-2007, 01:38 PM   #1
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Rep: Reputation: 30
Port Forwarding For Router


Hiya

i have centos4 and i have configured it as a router with load balance n failover, this machine is connected to internal lan with private ip range 192.168.x.x, my linux macine has a direct ADSL internet with static ip i would like to enable port forward so that i can access my private lan network.Can someone please tell me how to do it thanks in advance.
 
Old 09-20-2007, 04:38 PM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, Minix, OpenBSD, Slackware, SuSE
Posts: 1,757

Rep: Reputation: 79
I would think you could use DNAT:
Code:
# iptables -t nat -A PREROUTING -p tcp -d 10.10.20.99 --dport 80 -j DNAT --to-destination 10.10.14.2
http://linux-ip.net/html/nat-dnat.html
http://www.netfilter.org/documentati...O-6.html#ss6.2
 
Old 09-20-2007, 09:32 PM   #3
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
# iptables -t nat -A PREROUTING -p tcp -d 10.10.20.99 --dport 80 -j DNAT --to-destination 10.10.14.2

is 10.10.20.99 private lan ip from source to destination (10.10.14.2) ?
 
Old 09-21-2007, 01:09 PM   #4
bsdunix
Senior Member
 
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, Minix, OpenBSD, Slackware, SuSE
Posts: 1,757

Rep: Reputation: 79
The addresses and port is an example.

When the firewall receives port 80 traffic destined for IP aaa.bbb.ccc.ddd it routes it to IP bbb.ccc.ddd.eee
 
Old 09-25-2007, 02:10 PM   #5
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
k thanks bro
 
  


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
port forwarding on Belkin 4-port Cable/DSL Gateway Router sycamorex Linux - Networking 5 03-05-2007 03:27 PM
Router port forwarding troubleshoot andresesfm Linux - Networking 1 09-22-2006 04:26 AM
Port forwarding on a wireless router. impulse() Linux - General 4 05-18-2006 05:20 PM
Forwarding port 80 to two hosts from a Linksys router ridertech Linux - Networking 1 08-19-2004 12:56 PM
router port forwarding/ssh epoo Slackware 7 12-30-2003 03:02 PM


All times are GMT -5. The time now is 11:45 AM.

Main Menu
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