Re: routing to 2 different Internet connections

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rimas,

This pseudo-code may not be the correct solution for you, but it should 
help you get on the right track...there is documentation out there to help 
you figure out what you need to do--good luck!

# -- are you following the LARTC two-link howto?
#    http://lartc.org/howto/lartc.rpdb.multiple-links.html#AEN261
#    make sure you set up default routes in two separate routing tables

ip route add default via $ETH0_GW table eth0.link
ip route add default via $ETH2_GW table eth2.link

# -- add rules to the RPDB in order from most general to most specific
#    

ip rule add from 10.105.105.0/24 table eth2.link

ip rule add from 10.105.105.100 table eth0.link
ip rule add from 10.105.105.101 table eth0.link
ip rule add from 10.105.105.102 table eth0.link
ip rule add from 10.105.105.103 table eth0.link
ip rule add from 10.105.105.104 table eth0.link
ip rule add from 10.105.105.105 table eth0.link

As I mentioned above, Rimas, you'll want to look at the split access howto 
of the LARTC HOWTO.  If that's not enough to make sense of it, you'll need 
to refer to the iproute2 manual, which is available as HTML here:

  http://defiant.coinet.com/iproute2/ip-cref/

Post to the list with more specific questions if you have them....and 
hopefully somebody else with a more elegant solution will post in the 
interim.

Ciao for now,

-Martin

 : Hi folks,
 : 
 : I have iptables rules:
 : iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
 : iptables -A POSTROUTING -t nat -o eth2 -j MASQUERADE
 : That will masquerade all packets going out of the two external interfaces.
 : 
 : How to make a routing with iproute2 to direct packets from 
 : 10.105.105.100-105 via eth0 and to direct packets from the rest of and
 : 10.105.105.0/24 via eth2 ?
 : 
 : Thanks in advance
 : 
 : Rimas
 : 

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux