LinuxQuestions.org
Review your favorite Linux distribution.
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-26-2007, 02:50 PM   #1
dorthensensens
LQ Newbie
 
Registered: May 2007
Posts: 3

Rep: Reputation: 0
Question Iptables forwarding to a second public IP address. Possible?


I need to forward tcp traffic through an openswan IPSEC connection to an external public IP address not located on the same network.

e.g.

Clients >> cisco firewall >>>>internet ipsec traffic>>>> Openswan >>> Internet>>>Public IP address.

The reason we need to go to the openswan server first rather than a direct connection to the public IP address is that the client doesn't want to modify or add any new servers on their site and the client terminals are not to have any internet access except for certain sites (I've setup a squid proxy for that).

I only have control over the openswan server. It has one ethernet card (eth0). If this is too complicated, perhaps someone can help we with a simpler situation where I send tcp packets to One public IP address (no IPSEC) which then gets forwarded to a second public IP address on a different server. Any help would really be appreciated.

The distribution used is FC6

Thank you

Last edited by dorthensensens; 05-26-2007 at 02:51 PM.
 
Old 05-28-2007, 08:48 AM   #2
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
From my limited experience w/ iptables, I'd say "Probably yes."

The key is the FORWARD table. The Q is if you have the inclination to do the learning curve.

What resources have you already discovered on the web?
 
Old 05-28-2007, 10:29 AM   #3
dorthensensens
LQ Newbie
 
Registered: May 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by archtoad6
From my limited experience w/ iptables, I'd say "Probably yes."

The key is the FORWARD table. The Q is if you have the inclination to do the learning curve.

What resources have you already discovered on the web?
I've searched through a few years worth of openswan mail lists posts and most people are dealing with internal port/ip forwarding to various class c subnets.

I've followed various online tutorials on iptables. The howto's that seem to almost do what I would like deal with NAT'd networks which, again, does not seem to help me (although I may simply be misunderstanding what I am to understand).

I will no try to see if I can find a detailed resource of the FORWARD tables unless of course someone has a link to a reputable location.

Thank you
 
Old 05-28-2007, 02:31 PM   #4
dorthensensens
LQ Newbie
 
Registered: May 2007
Posts: 3

Original Poster
Rep: Reputation: 0
I go this working thanks to http://www.crhalpin.org/project/netfilter.html

The info that pointed me to the right direction was that forwarded packets required the following "path":


forwarded

nat/PREROUTING -> filter/FORWARD -> nat/OUTPUT -> nat/POSTROUTING

Once I add a rule for each step above. All worked as expected.
 
Old 05-29-2007, 05:08 AM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
Glad you solved it, doesn't surprise me that it was that complicated.
 
Old 08-21-2007, 01:53 PM   #6
scarty
LQ Newbie
 
Registered: Aug 2007
Posts: 2

Rep: Reputation: 0
HELP!! Forward to second public IP

I have a similiar situation. I added a rules for each step. But still can not port forward. I am using one nic on a public IP. Need to forward to another public IP.

Quote:
Originally Posted by dorthensensens View Post
I go this working thanks to

The info that pointed me to the right direction was that forwarded packets required the following "path":


forwarded

nat/PREROUTING -> filter/FORWARD -> nat/OUTPUT -> nat/POSTROUTING

Once I add a rule for each step above. All worked as expected.
 
Old 08-21-2007, 02:51 PM   #7
scarty
LQ Newbie
 
Registered: Aug 2007
Posts: 2

Rep: Reputation: 0
OK, nevermind. I fixed the rules and it works!

Quote:
Originally Posted by scarty View Post
I have a similiar situation. I added a rules for each step. But still can not port forward. I am using one nic on a public IP. Need to forward to another public IP.
 
  


Reply

Tags
solution


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/Address forwarding with iptables with one network interface. Nextrastus Linux - Networking 5 09-18-2013 09:55 AM
I need an understanding of public IP address Mearth Linux - Networking 5 02-22-2007 08:45 PM
how to get public ip address openbysource Linux - Networking 1 02-22-2006 11:21 PM
forwarding Public IP address in BIND DNS on RedHat Linux EL3 pudhiyavan Linux - Networking 0 05-19-2005 04:16 AM
freeswan and public address c0c0deuz Linux - Networking 0 08-13-2003 10:42 PM


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

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