From owner-freebsd-stable@FreeBSD.ORG Sun Dec 2 22:14:10 2007 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E001B16A473 for ; Sun, 2 Dec 2007 22:14:10 +0000 (UTC) (envelope-from wolfgang@lyxys.ka.sub.org) Received: from saturn.lyxys.ka.sub.org (saturn.lyxys.ka.sub.org [IPv6:2001:5c0:8521:1:240:63ff:fed8:ce97]) by mx1.freebsd.org (Postfix) with ESMTP id 71A0D13C45A for ; Sun, 2 Dec 2007 22:14:09 +0000 (UTC) (envelope-from wolfgang@lyxys.ka.sub.org) Received: from juno.lyxys.ka.sub.org (juno.lyxys.ka.sub.org [IPv6:2001:5c0:8521:0:20f:feff:fe0e:7312]) by saturn.lyxys.ka.sub.org (8.14.2/8.14.2) with ESMTP id lB2ME8E7005142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Dec 2007 23:14:08 +0100 (CET) (envelope-from wolfgang@lyxys.ka.sub.org) Received: from juno.lyxys.ka.sub.org (localhost [127.0.0.1]) by juno.lyxys.ka.sub.org (8.14.2/8.14.2) with ESMTP id lB2ME8l0053984; Sun, 2 Dec 2007 23:14:08 +0100 (CET) (envelope-from wolfgang@lyxys.ka.sub.org) Received: (from wolfgang@localhost) by juno.lyxys.ka.sub.org (8.14.2/8.14.2/Submit) id lB2ME8OJ053983; Sun, 2 Dec 2007 23:14:08 +0100 (CET) (envelope-from wolfgang@lyxys.ka.sub.org) X-Authentication-Warning: juno.lyxys.ka.sub.org: wolfgang set sender to wolfgang@lyxys.ka.sub.org using -f Date: Sun, 2 Dec 2007 23:14:08 +0100 From: Wolfgang Zenker To: area =?utf-8?B?ZGFtYWnihKI=?= Message-ID: <20071202221408.GA52496@lyxys.ka.sub.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i Organization: private site X-Greylist: Sender is SPF-compliant, not delayed by milter-greylist-3.0 (saturn.lyxys.ka.sub.org [IPv6:2001:5c0:8521:1:240:63ff:fed8:ce97]); Sun, 02 Dec 2007 23:14:08 +0100 (CET) Cc: freebsd-stable@freebsd.org Subject: Re: /etc/rc.d/netif wont add default gateway X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2007 22:14:11 -0000 Hi, * area damaiā„¢ [071202 21:42]: > whenever i run /etc/rc.d/netif it will read rc.conf and add the pc IP and > netmask but it wont read the default gateway resulting lost connectivity to > internet > # -- my /etc/rc.conf : > defaultrouter="192.168.1.1" > hostname="msc.edu" > ifconfig_rl0="inet 192.168.1.9 netmask 255.255.255.0" > [..] > # -- while issuing /etc/rc.d/netif restart: > [root@msc ~]# /etc/rc.d/netif restart > Stopping network: lo0 rl0 plip0 pfsync0 pflog0. > [..] what happens is that "/etc/rc.d/netif restart" first runs "/etc/rc.d/netif stop". This stops all network interfaces. Now the kernel routing system gets notified that these interfaces are no longer available and deletes all routes that use this interfaces. After that "/etc/rc.d/netif start" runs and the interfaces become available again. Every time a network interface becomes available, the kernel adds a route to the immedialtely connected network (which is determined by interface address and netmask). So stopping an interface has the side effect of clearing ALL routes going through this nterface, while starting an interface has only the side effect of adding a route for the net that is locally connected to this interface. The kernel can not add the default route on its own again because all information about this route had been deleted ehrn the interface went down. To add non-local routes (including the default route) you could now run "/etc/rc.d/routing start" Wolfgang