Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CURRENT: "service netif restart" looses default route

32 views
Skip to first unread message

O. Hartmann

unread,
Oct 5, 2016, 12:48:14 PM10/5/16
to FreeBSD CURRENT

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?

Kind regards,
Oliver

Trond Endrestøl

unread,
Oct 5, 2016, 1:50:54 PM10/5/16
to O. Hartmann, FreeBSD CURRENT
I see something similar on stable/11, r306639. During boot this system
can't add its IPv6 default route. I need to add it manually
afterwards. Note, this is on XenServer 7.0.0, so maybe the hypervisor
play a certain role.

Oct 4 13:23:24 <console.info> [WITHHELD] kernel: add host 127.0.0.1: gateway lo0 fib 0: route already in table
Oct 4 13:23:24 <console.info> [WITHHELD] kernel: add net default: gateway 128.x.y.z
Oct 4 13:23:24 <console.info> [WITHHELD] kernel: Additional inet routing options: gateway=YES.
Oct 4 13:23:24 <console.info> [WITHHELD] kernel: add host ::1: gateway lo0 fib 0: route already in table
Oct 4 13:23:24 <console.info> [WITHHELD] kernel: add net fe80::: gateway ::1
Oct 4 13:23:24 <console.info> [WITHHELD] kernel: add net ff02::: gateway ::1
Oct 4 13:23:24 <console.info> [WITHHELD] kernel: add net ::ffff:0.0.0.0: gateway ::1
Oct 4 13:23:24 <console.info> [WITHHELD] kernel: add net ::0.0.0.0: gateway ::1
Oct 4 13:23:24 <console.info> [WITHHELD] kernel: route: writing to routing socket: Network is unreachable
Oct 4 13:23:24 <console.info> [WITHHELD] kernel: add net default: gateway 2001:x:y:z::1 fib 0: Network is unreachable

Also, why do the startup scripts attempt to add additional routes for
127.0.0.1 and ::1? I see that behaviour on both head and stable/11.

--
+-------------------------------+------------------------------------+
| Vennlig hilsen, | Best regards, |
| Trond Endrestøl, | Trond Endrestøl, |
| IT-ansvarlig, | System administrator, |
| Fagskolen Innlandet, | Gjøvik Technical College, Norway, |
| tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, |
| sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. |
+-------------------------------+------------------------------------+
_______________________________________________
freebsd...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Allan Jude

unread,
Oct 5, 2016, 1:54:20 PM10/5/16
to freebsd...@freebsd.org
As far as I am aware, this has always been this way, at least with
FreeBSD 6.0 and later. When you delete the interfaces, the route goes
away, then you recreate the interfaces but not the routes.

--
Allan Jude

Oliver Peter

unread,
Oct 6, 2016, 3:34:06 AM10/6/16
to FreeBSD CURRENT
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@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 $*


--
Oliver PETER oli...@gfuzz.de 0x456D688F

Hartmann, O.

unread,
Oct 6, 2016, 10:18:21 AM10/6/16
to Oliver Peter, FreeBSD CURRENT, alla...@freebsd.org
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

Pete Wright

unread,
Oct 6, 2016, 12:40:49 PM10/6/16
to Oliver Peter, FreeBSD CURRENT


On 10/6/16 12:27 AM, Oliver Peter 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

<snip code - which i think looks good>

I think this is a great idea - especially as it would make it easier for
dev's and other novice admin's to use freebsd as a development platform.

cheers,
-pete


--
Pete Wright
pe...@nomadlogic.org
nomadlogicLA

Ngie Cooper

unread,
Oct 6, 2016, 5:58:17 PM10/6/16
to Pete Wright, Oliver Peter, FreeBSD CURRENT

> On Oct 6, 2016, at 09:40, Pete Wright <pe...@nomadlogic.org> wrote:
>
>> On 10/6/16 12:27 AM, Oliver Peter 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
>
> <snip code - which i think looks good>
>
> I think this is a great idea - especially as it would make it easier for dev's and other novice admin's to use freebsd as a development platform.

Special casing would need to be done with DHCP, btw..

Also, what about IPv6 (rtsol/rtsold, etc)?

Thanks!
-Ngie

Trond Endrestøl

unread,
Oct 7, 2016, 6:52:24 AM10/7/16
to FreeBSD CURRENT
On Wed, 5 Oct 2016 19:50+0200, Trond Endrestøl wrote:

> Oct 4 13:23:24 <console.info> [WITHHELD] kernel: add net default: gateway 2001:x:y:z::1 fib 0: Network is unreachable

This problem was due to a typo, sorry for the noise.

> Also, why do the startup scripts attempt to add additional routes for
> 127.0.0.1 and ::1? I see that behaviour on both head and stable/11.

It might be worth investigating this issue further, since this
behaviour is absent on stable/10.
0 new messages