Routing and rtnetlink

Routing and rtnetlink

Post by dmurph.. » Fri, 12 Jan 2001 07:45:25

I'm using Red Hat 6.2 with the 2.2.14 kernel.

Is there a way to dump the entire routing table (displayed when you type
"ip route") to an application using rtnetlink?  I've looked at the man
pages for it, and didn't see anything that looked like it would work.

Any help is greatly appreciated.


Sent via


1. rtnetlink: network unreachable for Routing for multiple uplinks using ip route add

Dear all,
after playing around and having the same problems on all linux
versions I have at hand and not finding a solution in the net I ask
for your help.

Problem: Want to set up a router with multiple uplinks to the
Checked documentation at several places, but all examples given will
not work!
Always get rtnetlink: network is unreachable.

Have tried this with IPCop 1.4.5, SUSE Prof. 9.1 same effect.

OK now the details:

For ISP 1 (all IP addresses not the real ones!)

For ISP2

/etc/rt_tables: (added at end)
200 T1
201 T2

Routing table empty but loopback device when I start:
ip route add dev eth0 src table T1
ip route add default via table T1
Error Message: rtnetlink: network is unreachable

ip route add dev eth1 src table T2
ip route add default via table T2
Error Message: rtnetlink: network is unreachable

If I use the commands without the table T1/T2 I am able to set the
route. But later it doesn't work.
I took the commands from
   Linux Advanced Routing & Traffic Control HOWTO
   Chapter 4.2
And crosschecked with
    Redundant Internet Connections Using Linux from

Same effect.
Kernel on Suse9.1:  2.6.4-52
Kernel on IPCop:    2.4.29

Kernel configured with:

ip version:
    Suse:  iproute2-ss020116
    ipcop: iproute2-ss010824

Any clues?

Thanks in advance

2. ; xterm

3. using rtnetlink to modify routing table

4. detect being ping?

5. IP Route RTNETLINK Error: File Exists

6. How to know whether my system got Java virtual machine installed?

7. IPv6-over-IPv4: "RTNETLINK answers: No route to host"-Error

8. ATI Graphics Ultra PLUS ?

9. RTNETLINK answers: Invalid argument when adding route... help!

10. Matrox Mystique ands X.

11. rtnetlink replacement for SIOCSIFHWADDR

12. rtnetlink, setting gateway on eth1 fails