Using "/etc/rc.d/netif start"

Jason Helfman jhelfman at
Tue Mar 29 18:23:19 UTC 2011

On Tue, Mar 29, 2011 at 10:40:19AM -0700, Nerius Landys thus spake:
>First off, I'm on 9.0-CURRENT-i386, but I don't think that will make a
>difference for purposes of my question.  I think the freebsd-current
>folks are expecting questions that are much harder than this one.
>I'm trying to use /etc/rc.d/netif to bring down and bring back up all
>network interfaces, because I'm trying to get the correct entries in
>/etc/rc.conf for testing some extra network cards.
>So right now, my /etc/rc.conf looks like this:
>ifconfig_em0="inet netmask"
>/etc/resolv.conf looks like this:
>domain  i
>I'm basically in a LAN.  When I boot up this "elmer.i" machine,
>everything works well.
>Then, I do the following two commands:
>  /etc/rc.d/netif stop
>  /etc/rc.d/netif start
>After these, I'm still able to ping a raw IP LAN address such as
>  However, two problems start occurring:
>1. I cannot ping an IP address that is outside of my LAN, e.g.
>> ping
>PING ( 56 data bytes
>ping: sendto: No route to host
>2. DNS (via nameserver) won't work at first, but starts
>to magically work when I for example enable sshd and log in to elmer
>from another host on the LAN
>So the nut of my question is, I think "/etc/rc.d/netif stop" stops
>some additional things such as packet routing that the corresponding
>"/etc/rc.d/netif start" command won't start back up.  So what is the
>best way to bring down the network and bring it back up again for
>purposes of testing /etc/rc.conf syntax?

In my experience, I've found it best to restart 'routing,' as well.

/etc/rc.d/routing restart


Jason Helfman
System Administrator
E4AD 7CF1 1396 27F6 79DD  4342 5E92 AD66 8C8C FBA5

More information about the freebsd-questions mailing list