# Service netif restart



## azathoth (Oct 4, 2017)

Sometimes I use deluge and leave it overnight and I wake up and find my net connection not working. Probably some bandwidth shaping by my ISP. So I run `service netif restart` and nothing. I reboot and everything works. Am I doing something wrong?

I should not have to reboot a FreeBSD box to restart networking and get a DHCP IP right?

Home router 11.1 amd64 desktop 6 core 16 GB ram.


----------



## SirDice (Oct 4, 2017)

azathoth said:


> So I run  service netif restart and nothing. I reboot and everything works. Am I doing something wrong?


Nothing wrong, just forgetting a step. After `service netif restart` you also need to run `service routing restart`. The reason is because netif shuts down the interfaces, which automatically removes any and all routes referring to those interfaces too. Restarting the routing script fixes them again.


----------



## azathoth (Oct 4, 2017)

SirDice said:


> Nothing wrong, just forgetting a step. After `service netif restart` you also need to run `service routing restart`. The reason is because netif shuts down the interfaces, which automatically removes any and all routes referring to those interfaces too. Restarting the routing script fixes them again.



ah haa!!

(there is no command that does both?)


----------



## SirDice (Oct 4, 2017)

azathoth said:


> (there is no command that does both?)


Only if you create one yourself. The rc(8) scripts do have some order and dependency linking but those really only deal with the ordering of the scripts during boot. It would indeed have been nice if dependent scripts got automatically triggered but this doesn't happen so you'll need to take care of this yourself.


----------

