On Mon, Feb 12, 2001 at 10:17:24PM +1030, David Purton wrote: > On Mon, 12 Feb 2001, Wichert Akkerman wrote: > > > ip route add 0.0.0.0/0 dev eth0 metric 1 > > > > Slightly off topic, but can anyone explain to me what the metric field > does - the man page is bit brief for my level of understanding in these > things :) > > > $ man route > > metric M > set the metric field in the routing table (used by > routing daemons) to M.
metric ::= the "cost" of the interface Let's say you have two interfaces to the outside world. Both are 10 Mb half duplex ethernet. eth0 is provider A, the preferred provider. eth1 is provider b who you do not prefer (they drop packets, charge by the byte, whatever). When configuring the interfaces you assign eth1 a larger metric than eth0. Presumably you run a routing protocol like RIP, OSPF or IS-IS (just kidding). The routing protocol can use your "hint" to always prefer provider A when that link is up. The issue can become quite complex depending on what kind of routing you are trying to do. Fortunately most linux users get no closer to routing than setting up a masquerade box. HTH, -- Nathan Norman - Staff Engineer | A good plan today is better Micromuse Inc. | than a perfect plan tomorrow. mailto:[EMAIL PROTECTED] | -- Patton
pgpaMv9YDdYCS.pgp
Description: PGP signature