Re: routing with multiple default routes

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

 



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.

--
bill davidsen <davidsen@xxxxxxx>
 CTO TMR Associates, Inc
 Doing interesting things with small computers since 1979

-
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