Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Jan 2014 17:41:35 +0100
From:      Jan Bramkamp <crest@rlwinm.de>
To:        freebsd-arch@freebsd.org
Subject:   Re: Default gateway lost after netif restart
Message-ID:  <52C6E83F.5050802@rlwinm.de>
In-Reply-To: <52BC5177.70903@hostek.com>
References:  <52BC5177.70903@hostek.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52C6E83F.5050802>