creating default route in kernel

Waldemar Kornewald Waldemar.Kornewald at web.de
Sat Sep 25 00:55:05 PDT 2004


George V. Neville-Neil wrote:
>>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.

The normal default route works correctly. The problem is just that I
cannot create an undefined default route (because one cannot know the
gateway while being disconnected).
Using a temporary gateway (10.10.10.1) or just 0 did not work when I
tried it, but now I am in the process of changing the way dial-on-demand
is handled and cannot test it. :(
Maybe our port of your old netstack is buggy. I hope all problems will 
be gone with the new port.

Bye,
Waldemar




More information about the freebsd-net mailing list