From owner-freebsd-net@FreeBSD.ORG Sat Sep 25 07:55:05 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 47EB116A4CE for ; Sat, 25 Sep 2004 07:55:05 +0000 (GMT) Received: from smtp05.web.de (smtp05.web.de [217.72.192.209]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09C5043D48 for ; Sat, 25 Sep 2004 07:55:05 +0000 (GMT) (envelope-from Waldemar.Kornewald@web.de) Received: from [80.134.87.206] (helo=[80.134.87.206]) by smtp05.web.de with asmtp (TLSv1:RC4-MD5:128) (WEB.DE 4.101 #44) id 1CB7OZ-00032h-00; Sat, 25 Sep 2004 09:55:04 +0200 Message-ID: <41552400.1000608@web.de> Date: Sat, 25 Sep 2004 09:53:36 +0200 From: Waldemar Kornewald User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: FreeBSD-net References: <4152A184.9020301@web.de> In-Reply-To: X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Waldemar.Kornewald@web.de X-Sender: Waldemar.Kornewald@web.de Subject: Re: creating default route in kernel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2004 07:55:05 -0000 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