1

I'm trying to configure a ubuntu server network.

[Edit] My ifconfig:

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
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
address 192.168.15.141
netmask 255.255.255.0
gateway 192.168.15.1

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?

4
  • 1
    Please edit your question and add output of ifconfig terminal command.
    – Pilot6
    Commented Sep 5, 2017 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
    Commented Sep 5, 2017 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? Commented Sep 5, 2017 at 17:58
  • Ens160 is the name of the Ethernet. Change the settings from eth0 to match that name instead.
    – Terrance
    Commented Sep 5, 2017 at 19:03

1 Answer 1

4

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

auto lo
iface lo inet loopback

auto ens160
iface ens160 inet static
address 192.168.15.141
netmask 255.255.255.0
gateway 192.168.15.1
dns-nameservers 192.168.15.1 8.8.8.8

Restart the interface:

sudo ifdown ens160 && sudo ifup -v ens160

Did you connect?

ping -c3 www.ubuntu.com

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .