From mboxrd@z Thu Jan 1 00:00:00 1970 From: "suresh" Date: Thu, 28 Feb 2002 12:30:35 +0000 Subject: Re: [LARTC] Newbie question Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Hi Ard, Actually i need to distribute the traffic to two different routers. So I tried to send traffic from 172.16.1.0/24 to a.b.c.d and another network through w.x.y.z Thanks Suresh > On Wed, Feb 27, 2002 at 04:29:23PM +0530, suresh wrote: > > I have two Internet link and two LAN networks > > I have Redhat-7.1 linux-2.4.17 kernel and 2 NICs > > In eth0 172.16.1.1 and eth0:1 192.168.1.1 > > in eth1 are public ips of isps as eth1 a.b.c.d and eth1:0 w.x..y.z > > > > I want do source routing using ip rule command. > > > > echo 200 isp1 >> /etc/iproute2/rt_tables > > ip rule add from 172.16.1.0/24 table isp1 > > ip rule ls > > 0: from all lookup local > > 32765: from 172.16.1.0/24 lookup isp1 > > 32766: from all lookup main > > 32767: from all lookup default > > > > ip route add default via a.b.c.d dev eth1 table isp1 > > ip route flush cache > > > > Its work fine when request comes from 172.16.1.0 netwok > > > > When i add > > ip route add default via w.x.y.z dev eth1 > > > > to forward request from another lan network it works fine > > but req from 172.16.1.0 does not work > > > > if i remove > > ip route del default via w.x.y.z dev eth1 > > > > its work well. > > > > Did i leaveout anything in configuration? > Yep: by adding the rule: > ip rule add from 172.16.1.0/24 table isp1 > everything *WILL* go to table isp1. > In my experience everything even local traffic that matches the rule > will go to the isp1 table, and hence will be routed to the gateway. > > Use a normal routing table for isp1: > For instance: > ip route add 172.16.1.0/24 dev {right device} scope link > to make sure that you can still route back to 172.16.1.0... > > Anyway: tcpdumping all of your interfaces will make you clear what is > actually happenning. > > Thinking about it: it only contains a default route, which means, it > only knows that it should route to that default gateway. > The default is I guess some sort of end point in a routing table. > > -- > Telegraaf Elektronische Media http://wwwijzer.nl > http://leerquoten.monster.org/ http://www.faqs.org/rfcs/rfc1855.html > Let your government know you value your freedom. Sign the petition: > http://petition.eurolinux.org/ _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/