Ubuntu – the preferred method to restart networking in Ubuntu and Debian

debianUbuntuubuntu-11.04

When I restart the network using:

/etc/init.d/networking restart

I get this warning:

 Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces

So what's the best way to restart the network after making changes now?

This problem also applies to Debian as the netbase package is inherited from debian.

Best Answer

It is just saying that the restart option is going away

/etc/init.d/networking stop; /etc/init.d/networking start

Note there is one line only! That is important when running network restart through the network.