In kernel routing table vs. /sbin/ip vs. /sbin/route

In kernel routing table vs. /sbin/ip vs. /sbin/route

Post by Dave Zarzyck » Tue, 08 Jan 2002 05:30:18



Using /sbin/route, I can add multiple default routes like so:

/sbin/route add -net default gw 192.168.0.1
/sbin/route add -net default gw 192.168.0.2

But I cannot do the same with /sbin/ip:

/sbin/ip route add default via 192.168.0.1
/sbin/ip route add default via 192.168.0.2
RTNETLINK answers: File exists

Given that /sbin/ip is the more powerful and modern tool, I'm lead to
believe that /sbin/route might be leaving the in kernel routing table in a
weird state.

My two simple questions are as follows:

1) Which tool is more correct?

2) What is the behavior of the kernel when multiple default routes are
defined?

Thanks,

davez

--
Dave Zarzycki
http://zarzycki.org/~dave/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

In kernel routing table vs. /sbin/ip vs. /sbin/route

Post by Martin Schew » Tue, 08 Jan 2002 06:40:08


Hi,


> Using /sbin/route, I can add multiple default routes like so:

> /sbin/route add -net default gw 192.168.0.1
> /sbin/route add -net default gw 192.168.0.2

> But I cannot do the same with /sbin/ip:

> /sbin/ip route add default via 192.168.0.1
> /sbin/ip route add default via 192.168.0.2
> RTNETLINK answers: File exists

$ /sbin/ip route append default via 192.168.0.2

Quote:> Given that /sbin/ip is the more powerful and modern tool, I'm lead to
> believe that /sbin/route might be leaving the in kernel routing table
> in a weird state.

> My two simple questions are as follows:

> 1) Which tool is more correct?

RFC1122 says having several _default_ routes is okay.

Quote:> 2) What is the behavior of the kernel when multiple default routes are
> defined?

The kernel will make dead gateway detection to select the right one for
you.

Regards,
                Martin

  application_pgp-signature_part
< 1K Download

 
 
 

1. /sbin/route fails under slackware 1.2.0 with UMSDOS kernel

Hello everyone,

I have recently installed Slackware 1.2.0 with the UMSDOS kernel on my
lab's 486 machine.  First off - nice job everyone!  I am trying to set
up networking and am having a problem.  2 days of FAQ reading and
kernel recompiling have been no help.  I have localized the problem
down to the running of the /sbin/route command.  The command

/sbin/route add -net 127.0.0.0      

in rc.inet1 fails with the error message:  "SIOCADDRT: Invalid argument"

Later route commands on the ethernet card give similar errors.
ifconfig seems to execute without a problem.  I recompiled the kernel
to make sure that TCP support was included.  I'm really stuck at this
point and if anyone could offer any help or suggestions I would really
appreciate it.

Thanks,

-Chris

2. Where to get these include files?

3. /sbin/route warning after kernel upgrade

4. Indoctrination from the source:

5. /sbin/route broken/changed in 2.0.x Kernel(?)

6. [5/4] make get_pid_list() scan the PID bitmap

7. Linux vs OS2 vs NT vs Win95 vs Multics vs PDP11 vs BSD geeks

8. multiprocessor

9. Q about the IP routing table and the routed

10. How Do Routing Table Entries Get Added to Routing Table at Bootup?

11. /usr/sbin/traceroute ha1 ksh: /usr/sbin/traceroute: not found

12. help with /sbin and /usr/sbin permissions

13. /sbin/sh and /sbin/sh