CURRENT: "service netif restart" looses default route

Hartmann, O. ohartman at mail.zedat.fu-berlin.de
Thu Oct 6 13:53:04 UTC 2016


On Thu, 6 Oct 2016 09:27:53 +0200
Oliver Peter <lists at peter.de.com> wrote:

> On Wed, Oct 05, 2016 at 06:47:48PM +0200, O. Hartmann wrote:
> > 
> > Today, I checked on two servers of ours running both a recent
> > CURRENT (i.e. FreeBSD 12.0-CURRENT #43 r306701: Wed Oct  5 06:40:40
> > CEST 2016) via "service netif restart" the upcoming network and
> > realised that the default route is lost then!
> > 
> > I'm able to config the route via "service routing restart" - or
> > manually as I did otherwise. But I recall that I did a simple
> > "service netif restart" in 11-CURRENT recently and that worked.
> > 
> > Has there been a change? What is now the official way to restart
> > network?  
> 
> Since the past couple of years on every new FreeBSD I put this in
> motd for my linux colleagues and coworkers:
> 
> 	Network:
> 	        To apply changes you have made to the network:
> 	        # /etc/rc.d/netif restart && /etc/rc.d/routing restart
> 
> Perhaps we could introduce a wrapper to be used with:
> 	# service network restart
> 
> 	oliver at local ~ % cat /etc/rc.d/network
> 	#!/bin/sh
> 
> 	# PROVIDE: network
> 	# REQUIRE: netif routing
> 	# KEYWORD: nojailvnet
> 
> 	. /etc/rc.subr
> 	. /etc/network.subr
> 
> 	name="network"
> 	start_cmd="network_start"
> 	stop_cmd="network_stop"
> 
> 	network_start()
> 	{
> 	    /etc/rc.d/netif start
> 	    /etc/rc.d/routing start
> 	}
> 
> 	network_stop()
> 	{
> 	    /etc/rc.d/netif stop
> 	    /etc/rc.d/routing stop
> 	}
> 
> 	load_rc_config $name
> 	run_rc_command $*
> 
> 

I'm sorry that my sloppyness brought up this discussion.

I recall that I tried to hunt down a bug and did lots of "service netif
restart". But on a local network with all essential servers on the same
net, I never faced a problem with routing.

If life gets too easy, people start digging for the reason of a problem
too deep when the framework does too much stuff automated ...

The knowledge of the fact that I also have to restart routing via a
script is sufficient for me - also the fact to know that netif restart
doesn't restart routing. 

Regards,
Oliver


More information about the freebsd-current mailing list