From owner-freebsd-arch@FreeBSD.ORG Fri Jan 3 16:41:29 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4F29178 for ; Fri, 3 Jan 2014 16:41:29 +0000 (UTC) Received: from mail.rlwinm.de (mail.rlwinm.de [IPv6:2a01:4f8:140:72e1::ac16:e45e]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8AB1D7D for ; Fri, 3 Jan 2014 16:41:29 +0000 (UTC) Received: from hexe.rlwinm.de (p57A7DF07.dip0.t-ipconnect.de [87.167.223.7]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.rlwinm.de (Postfix) with ESMTPSA id 7F3ED6761 for ; Fri, 3 Jan 2014 16:41:28 +0000 (UTC) Message-ID: <52C6E83F.5050802@rlwinm.de> Date: Fri, 03 Jan 2014 17:41:35 +0100 From: Jan Bramkamp User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-arch@freebsd.org Subject: Re: Default gateway lost after netif restart References: <52BC5177.70903@hostek.com> In-Reply-To: <52BC5177.70903@hostek.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jan 2014 16:41:29 -0000 On 26.12.2013 16:55, Alex Long wrote: > I am new to FreeBSD so I apologize if this is the wrong place to post > this. But there is a flaw in the logic regarding restart of the netif > service. I understand that after restarting the netif service, you have > to manually restart the routing service. The problem is that if you are > configuring a machine remotely and you have to restart the netif service > for whatever reason, your defaut gateway is lost, thus preventing you > from restarting the routing service and you lose connectivity to the > machine. > > Now I get around this by creating a shell script that does both and just > executing that script. This works but it is sloppy in my opinion. It > does not makes sense to restart a network service and lose ANY network > functionality (i.e. your routes) once it comes back up. While annoying to find out that way it makes sense. The netif script deals with interfaces and by implication with directly connected routes. It doesn't deal with static routes. If you restart it interface it temporarily looses all its addresses. This flushes their directly connected routes and the hull created over the next hop relation. Restarting first netif than routing should solve your problem. Make sure that no SIGHUP will kill you script.