I'm trying to configure a ubuntu server network.

[Edit] My ifconfig:

lo: flags=73 mtu 65536

inet netmask

inet6 ::1 prefixlen 128 scopeid 0x10

loop txqueuelen 1000 (Loopback Local)

RX packets 352 bytes 26160 (26.1KB)

RX erors 0 dropped 0 overruns 0 frame 0

TX packets 352 bytes 26160 (26.1KB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

I edited the /etc/network/interfaces file and here is how it is:

auto lo
auto eth0
iface eth0 inet static

I'm trying to restart the server and I'm using:

sudo ifdown --exclude=lo -a && sudo ifup --exclude=lo -a

This command is an answer from this link: How to restart the networking service?

And I'm getting the following error:

Cannot find device "eth0" Failed to bring up eth0.

I'm pretty lay in configuring a server, so I have no idea what's going on.

Can someone help me please?

  • 1
    Please edit your question and add output of ifconfig terminal command. – Pilot6 Sep 5 '17 at 17:21
  • The Ethernet port might be named something like enp3s0 or something like that. Try the output of ifconfig -a so it shows all ports detected on the system. – Terrance Sep 5 '17 at 17:28
  • So, I don't know how to copy and paste and I have to write everything down. I got ens160: flags=4098<BROADCAST,MULTICAST> mtu... is it helpful? – Gabriel Augusto Sep 5 '17 at 17:58
  • Ens160 is the name of the Ethernet. Change the settings from eth0 to match that name instead. – Terrance Sep 5 '17 at 19:03

I suggest that you amend your /etc/network/interfaces file to read:

auto lo
iface lo inet loopback

auto ens160
iface ens160 inet static

Restart the interface:

sudo ifdown ens160 && sudo ifup -v ens160

Did you connect?

ping -c3 www.ubuntu.com
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.