Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | None |
Time | 1m |
Ubuntu Linux restart network command
Open shell or terminal and type the command as follows:
$ sudo /etc/init.d/networking restart
You can also use the following command:
$ sudo service networking restart
Sample outputs:
* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces * Reconfiguring network interfaces... * Disconnecting iSCSI targets ...done. * Stopping iSCSI initiator service ...done. resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything. * Disconnecting iSCSI targets ...done. * Stopping iSCSI initiator service ...done. resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything. resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything. * Starting iSCSI initiator service iscsid ...done. * Setting up iSCSI targets ...done. ssh stop/waiting ssh start/running, process 45886 resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything. * Setting up iSCSI targets ...done. ssh stop/waiting ssh start/running, process 45946
You can use this command on remote Ubuntu Linux server without any problem, but make sure you pass only restart option. This command also accepts start and stop options:
The start and stop option
To start or stop service:
$ sudo /etc/init.d/networking start
$ sudo /etc/init.d/networking stop
🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.
🐧 14 comments so far... add one ↓
🐧 14 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Thanks for the tips, i already tried on my ubuntu ultimate 1.4 and working good. Thank you
Thanks for this tip it helped me loads. I am really grateful to people like yourself who bother to give up your time to help us newbies out. :)
Thanks a lot for the tip, it helped me heaps!!
how to restart option over ssh?
Ok, that works. But my network is not automatically started on reboot. I have to do it manually every time. How do I start it automatically every time I boot in the system.
Milind, I had the same problem and tracked it down to: https://bugs.launchpad.net/ubuntu/+source/wpasupplicant/+bug/114310
The solution, for me, was to follow the workaround instructions on their page and modify the “/etc/rc.local” file to include the line “sh /etc/init.d/networking restart” just before “exit 0”.
Hope that helps.
I get the following message:
* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
Is there any alternative to do the same remotely ?
#sudo service networking {restart/stop/start}
haha, stopt networking via ssh. ten minues i had to realize there can’t be any chance of a ping :D
not correct at all.
Ubuntu 14.04 does not recognize any commands on this page. Only way I could stop networking services was telinit 0 … or unplug the ethernet cable.
I shoudl have written “respond” rather than “recognize”.
my computer restart automatically when using internet and media player .
I am using ubuntu 12.04 and it’s ping is break automatically then i have restart the network service then ping is running