Re: creating default route in kernel

From: George V. Neville-Neil (gnn_at_neville-neil.com)
Date: 09/24/04

  • Next message: Waldemar Kornewald: "Re: locking & iovecs"
    Date: Fri, 24 Sep 2004 11:29:25 +0900
    To: Waldemar Kornewald <Waldemar.Kornewald@web.de>
    
    

    At Thu, 23 Sep 2004 12:12:20 +0200,
    Waldemar Kornewald wrote:
    >
    > Hi,
    > could you please tell me how I can create a default route from within
    > the kernel? I am a member of the Haiku (OS) networking team and
    > maintainer of the PPP stack and for dial-on-demand support there must be
    > a default route which does not work. BTW, we use a port of your netstack
    > (from the 4.x releases, I think).
    > Which values should the default route get (netmask, destination, etc.)
    > and which function(s) should I call (our PPP stack lives in the kernel)?

    If you look at src/sys/net/route.c you will find a function (in
    -CURRENT) called rtrequest1(). Read through that routine to see how
    to do an RTM_ADD.

    You will need a destination and netmask, yes. The destination for the
    default route is 0 and you need to set the gateway to the correct
    gateway.

    For debuggging this you should have something listening to a routing
    socket and printing out the messages. In userland on FreeBSD we do
    this with "route monitor", see the route(8) man page for more
    information.

    Later,
    George

    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"


  • Next message: Waldemar Kornewald: "Re: locking & iovecs"

    Relevant Pages

    • Re: Routing with windows 2000
      ... netmask Specifies a subnet mask value for this route entry. ... gateway Specifies gateway. ... ie. cost for the destination. ...
      (microsoft.public.win2000.general)
    • Re: how to interpret route command
      ... That *IS* my gateway. ... Column 1 (Destination) is where you want to get. ... matches anything and is called the "default" route. ... generally because it is on the same network segment ...
      (comp.os.linux.networking)
    • Re: Cannot access Linux computer from outside LAN
      ... You can use the 'route -n' command for that. ... Kernel IP routing table ... sencond line means that any other address is reached by using gateway ...
      (comp.os.linux.networking)
    • NETDEV WATCHDOG: eth0: transmit timed out (was Re: Getting d-link DFE-530TX NIC working)
      ... > the kernel, and my new kernel boots! ... according to the output of ifconfig and route. ... But then when I try to ping the gateway, ... NETDEV WATCHDOG: eth0: transmit timed out ...
      (Debian-User)
    • RTM_LOSING: Kernel Suspects Partitioning
      ... I have the following setup: ... because all packets to C through B are being routed to B's default gateway. ... Now I've looked through the kernel and it appears that in netinet/in_pcb.c the ... the kernel and found that the route to redirect the packets (which I presume ...
      (freebsd-net)