LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-25-2003, 03:27 PM   #1
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Rep: Reputation: 30
Question Perplexing routing question...


or maybe not, for you...

Picture this...

I have a firewall server acting as my LAN's connection to the WAN. It has TWO connections to the WAN with one being the default route for the box.

Lets say I have two networks in my lan: 192.168.1.0/24 and 192.168.2.0/24. I want the 1 network to utilize the firewalls default connection to the WAN whereas I want the 2 network to utilize the other (non-default route) connection.

I have look at SNAT and DNAT via iptables but haven't found a solution as the only thing I can translate is either an address or port and not an interface.

Any ideas to get me moving in the right direction?

Thanks in advance!
 
Old 09-25-2003, 11:53 PM   #2
tyler0123
Member
 
Registered: Aug 2003
Posts: 134

Rep: Reputation: 16
tell the router to forward through the non-gateway device if the source network is the network you want to use that route. so if the source is from net 192.168.2.x/24(assuming non-gateway allowed network), forward through eth1(assuming non-gateway nic).
 
Old 09-27-2003, 12:10 PM   #3
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Original Poster
Rep: Reputation: 30
ok... how though? what mechanism?

iptables? routing table?

From what I've seen, you can't specify a source network via the route command when adding/removing routes.
 
Old 09-28-2003, 03:01 AM   #4
tyler0123
Member
 
Registered: Aug 2003
Posts: 134

Rep: Reputation: 16
through iptables you can specify a source network, so if the source network is the one you want to go to other network, then say if source is that one, use the preferred nic to forward stuff to, and same for other network with gateway nic.
 
Old 09-29-2003, 11:07 AM   #5
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Original Poster
Rep: Reputation: 30
you cannot translate interfaces with iptables...

Using DNAT, the packet gets modified prior to the routing decision. Changing the destination address won't do me any good in this case. It's not like changing a MAC header, the destination IP needs to stay the same.

Using SNAT, the packet gets modified after the routing decision. So it doesn't matter what is happening to the packet becuase it is already headed for the wrong gateway.

And simply creating a rule like:

iptables -A FORWARD -s 192.168.2.0/24 -d 0.0.0.0/0 -o (secondary WAN interface) -j ACCEPT

Doesn't shape traffic in any way... it would only allow it in the case that I actually got this to work.

feel free to point out where I am wrong if this is the case...

thanks regadless though...

Last edited by WeNdeL; 09-29-2003 at 11:09 AM.
 
Old 10-01-2003, 09:48 AM   #6
Bambi
Newbie
 
Registered: Aug 2003
Location: Toronto, Canada
Distribution: RedHat
Posts: 13

Rep: Reputation: 0
My first post ever, and I somewhat newbie-sh
Is it not routing.
Like:
route add -net 192.168.1.0 netmask 255.255.0.0 ethA
route add -net 192.168.2.0 netmask 255.255.0.0 ethB
 
  


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
Perplexing question (just for fun) Phyrexicaid General 11 11-13-2005 01:35 PM
Perplexing Problem eqisow Linux - General 7 08-17-2005 12:02 PM
Perplexing wireless routing problem Gerr Linux - Wireless Networking 8 03-30-2004 08:55 AM
perplexing modules composition... renegade69 Linux - Laptop and Netbook 6 10-15-2003 10:05 AM
Perplexing question reguarding sound in Xwindows. Cecil Linux - Software 2 06-26-2003 04:43 PM

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

All times are GMT -5. The time now is 04:58 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
Open Source Consulting | Domain Registration