LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 06-24-2005, 01:59 PM   #1
MPowers
LQ Newbie
 
Registered: Jun 2005
Posts: 25

Rep: Reputation: 15
Two-way NAT routing


Hello,

I have network like that:


(CLIENT1) (CLIENT2)

((( MY ROUTER)))

(Gateway-192.168.0.1) (Gateway-192.168.0.2)



Client 1 and 2 now is using an internet connection with iptables NAT from gateway-1. But the main idea is to make some ports (ex.6667) from client1 to be forwarded to gateway2's internet connection.

How I can do that?
 
Old 06-24-2005, 02:24 PM   #2
SirGertrude
Member
 
Registered: May 2004
Location: Missouri
Distribution: Gentoo
Posts: 59

Rep: Reputation: 15
Depends... Are you saying that your router is the gateway with both IP addresses bound to a single or multiple interfaces, or are you saying that your router is a separate entity from the two gateways?

If your router is the gateway with two IP addresses you can use "iptables -j SNAT" to define what traffic leaves what IP.

If your router sends traffic to one of two external gateways you are looking at policy routing.
 
Old 06-24-2005, 02:35 PM   #3
MPowers
LQ Newbie
 
Registered: Jun 2005
Posts: 25

Original Poster
Rep: Reputation: 15
The gateways is another computers on another interfaces
 
Old 06-24-2005, 03:24 PM   #4
SirGertrude
Member
 
Registered: May 2004
Location: Missouri
Distribution: Gentoo
Posts: 59

Rep: Reputation: 15
This means you will need to do policy routing. I recommend using the firewall mark in iptables and routing packets based on this mark.

Here is a good reference site: http://www.compendium.com.ar/policy-routing.txt

Section 6 talks about the fwmark method.

Another good resource I found on Google: http://www.monkeynoodle.org/comp/net...ing-HOWTO.html

Hope this helps
 
  


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
nat routing vaat Linux - Networking 11 02-16-2005 10:02 AM
routing through nat booyah Linux - Networking 3 01-17-2004 08:40 PM
real routing under nat routing nothingmuch Linux - Networking 4 10-27-2003 03:11 PM
Routing behind NAT bax *BSD 5 04-26-2003 05:38 PM
Routing and nat Morning_Star Linux - Networking 5 02-11-2003 11:31 AM

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

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