Re: routing with multiple default routes

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

 



The problem is that I do not really use gateways in this setup.  It is
possible that I do have static routes but no default gateways.
These are "point-to-point" PPP connections.  

I guess I screwed up when I said "metric" and "route" in the same
sentence.  What I meant to say was "metric" and "interface" it may be
the same though.

Here is my if-up and if-down programs that are ran by pppd after LCP
packets are negotiated successfully.  The comments explain exactly why
we use that program and what it does.  I run pppd with the demand option
on the remote and on the server.  The both have the same address so when
the server dials the remote the device ends up with 2 ppp interfaces
with the same addresses after LCP negotiation.  To keep packets moving
if-up downs the other interface and when the link dies if-down ups the
one that was taken down.  

Code: http://demo.opsdc.com/bidir.c

You could write the same thing in Perl or whatever but our device does
not have the luxury of running scripting languages.

What I would like to do is throw in a 3rd PPP interface.  The 3rd being
vtun using PPP.  We use vtun now but not with this demand concept.  I
might just need to setup my test bed again and see if I can have any
luck.

Feel free to use the code.  Modify or enhance.  Send me back anything
that needs fixing.

Chris

On, 2007-07-04 at 19:41 -0400, Bill Davidsen wrote:
> Christopher Fowler wrote:
> > On Tue, 2007-07-03 at 16:25 -0400, Charlie Brady wrote:
> >   
> >> Google for "linux policy routing" and/or go to 
> >> http://www.policyrouting.org/ and http://artc.org/howto/. 
> >>     
> >
> > This brings up a question in regards to something I tried a few years
> > ago.  Is there a way to use metrics on the routes?
> >
> >   
> That's a good question, and the answer is "sort of." I was setting the 
> defaults like this:
> 
>     RPolicy1="src ${ext_p_IP} via ${ext_p_gate} dev ${ext_i1}"
>     ip route add default ${RPolicy1} metric 2 table mail.in
> 
> (assume I have set the values in the script above, ext_p_IP is the 
> static IP, etc. Then I set the route which is fast and sheap but uses 
> DHCP for the IP:
> 
>     RPolicy2="via ${ext_s_gate} dev ${ext_s_nic}"
>     ip route add default ${RPolicy2} metric 1
> 
> where the secondary IP comes from IPfromNIC after the DHCP has been started.
> > I have system that use demand mode PPP to communicate between the server
> > and them.  the if-up and if-down script actually looks for the other ppp
> > interface and takes it down.  I wanted to use vtun that uses pppd and
> > then only use the modem when the tunnel was down.  All my attempts
> > failed and everything pointed to me needing to use metrics.
> >   
> 
> I did some diddling with this back when I still had a fallback to dial, 
> through an ISP who would give me a static IP. I had a somewhat similar 
> setup, and had the dial line set to "demand" startup. I gave it up, the 
> incoming mail melted even bonded modems.
> 
> Anyway, the important thing is that the setup above doesn't work, the 
> metric gets lost off the "metric 2" setting. However, if I set it with 
> the old route command "route add default gw x.x.x.x dev eth1 metric 2" 
> it sets and stays set. I haven't chased that part yet, I'm fighting the 
> original problem, and it really only matters if the fast NIC goes down.
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux