How to restart network in ubuntu server 14.04.04?

31,635

Solution 1

Ifdown ethx ; ifup ethx

Should do it

"service networking restart" isnt working in ubuntu, because other services are dependent on it, theres a more complete answer here https://askubuntu.com/questions/561046/why-is-service-networking-restart-not-working-in-14-04

Solution 2

You are probably using Network-Manager so that would use:

sudo service network-manager restart

When in doubt try:

sudo ifdown <interface>
sudo ifup <interface>

That should work, if doing this over ssh combine the commands:

sudo ifdown <interface> && sudo ifup <interface>

Give that a try.

Looks like this issue is related to the following:

http://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1301015

Share:
31,635

Related videos on Youtube

zarker
Author by

zarker

Updated on September 18, 2022

Comments

  • zarker
    zarker over 1 year

    I tried using service network restart and /etc/init.d/networking restart, what command could I use now?

    • Silent-Bob
      Silent-Bob almost 8 years
      Please add what happened when you executed those commands and what you expected instead.
    • zarker
      zarker almost 8 years
      service network restart network: unrecognized service
    • Mark Plotnick
      Mark Plotnick almost 8 years
      What is the output of service --status-all 2>&1 | grep network
    • Bobu
      Bobu almost 8 years
      I'm curious if you are seeing this issue: bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1301015
  • zarker
    zarker almost 8 years
    service network-manager restart network-manager: unrecognized service
  • zarker
    zarker almost 8 years
    I changed dns server,it didn't work
  • Bobu
    Bobu almost 8 years
    Did you try: sudo service network-manager restart
  • zarker
    zarker almost 8 years
    Yes,but that‘s server edition,could not find network-mamager