using rtnetlink to modify routing table

using rtnetlink to modify routing table

Post by tech.. » Tue, 19 Dec 2000 18:02:27


currently, i'm trying to use rtnetlink to modify the kernel's routing

i tried to compile the sample code found at

 // opening the netlink socket to communicate with the kernel
    if (rtnl_open(&rth) < 0)
        fprintf(stderr, "cannot open rtnetlink\n");

 // sending the packet to the kernel.
    if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)

however the compiler is unable to reference rtnl_open()....
i think i have already included all the necessary header files

anyone has any idea?

Sent via


1. route insists on using dns, ifconfig on modifying the routing table... please help me!

Sorry for the cross-posting -- but I really need you help!

Dear Guys,

nsswitch reads to translate hostnames just by "files". host.conf too....

"route add -host anyhost dev anydev"

wants to talk to the name server..... I straced it... and it really
queries bind for anyhost and nothing more..... although libnss_files
gets loaded, afterwards libns_dns gets loaded.

"ping anyhost" does NOT behave like this... it just uses files as it

Does anyone know why route always uses dns!? Is this a bug perhaps, or a
bug in the resolver.... this behavior appears only with route of SuSE
Linux -gt 6.0.

btw: does anyone know why ifconfig modifies the routing table if you set up a new
device?! for instance

 ifconfig ippp4 dstaddr

yields a route in the kernel to dev ippp4. Isn't that strange!?

thank you in advance,

2. Best - Log file analizer?

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

4. Comprehensible Kernel Installation Guide v.5

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

6. how to do a physical copy of a tape?

7. ifconfig modifies routing table

8. free_area_init_node fix (for non discontigmem direct use)

9. Routing and rtnetlink

10. IP Route RTNETLINK Error: File Exists

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

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

13. system problem with not used ipv6 module and routing table , alpha machine kernel 2.2.19