1

I have Ubuntu server (Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-47-generic x86_64)) installed on a laptop.

Since I installed the server I have had this problem; when I reboot the system i do not have any internet connection. I dont care about wireless, it's wired.

I always have to do:

ifconfig eno1 up
dhclient eno1

when running ip addr after above commands it looks like this, before eno1 is also down

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
   valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 38:ea:a7:ed:5c:73 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.49/24 brd 192.168.2.255 scope global eno1
   valid_lft forever preferred_lft forever
inet6 fe80::3aea:a7ff:feed:5c73/64 scope link
   valid_lft forever preferred_lft forever
3: wlo1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 9c:2a:70:6a:9f:eb brd ff:ff:ff:ff:ff:ff

How can I make so it does this by itself?

edit: why does it not do this by itself? Seems like something that i should not have to do every time i reboot the system.

Zanna
  • 70,465

3 Answers3

3

The usual way to set up networking in a server is /etc/network/interfaces. The file probably contains a guess as to a workable configuration, but, with the introduction of persistent naming, the usual ethernet interface, eth0, is incorrect. In your case, as you can see, it is eno1. My ethernet interface is enp0s25.

I suggest that you edit the file to add your details:

sudo nano /etc/network/interfaces

For a server, so that you can ssh and ftp to the machine, I suggest you use a static IP address. Check in the administration pages of your router or access point to find the range of addresses used for DHCP; select an address for your static server outside that range. Let's reconfigure for a static IP:

sudo nano /etc/network/interfaces

Change the file to:

auto lo
iface lo inet loopback

auto eno1
iface eno1 inet static
address 192.168.1.125
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 192.168.1.1 

Save and close nano. Usually, the router address is fine for DNS. You may add other, faster servers if you wish. Substitute your settings here as needed.

Get the system to re-read the file and use the changes:

sudo ifdown eno1 && sudo ifup -v eno1

Did you connect?

ping -c3 www.ubuntu.com
chili555
  • 60,188
0

I have the same problem on my virtual machine. After edit /etc/network/interfaces, still unsolved. Finally, found that I don't have 'ifupdown' in my Ubuntu. After 'apt install ifupdown', problem solved.

network depends on ifupdown

Frank Wang
  • 207
  • 2
  • 10
0

Edit /etc/network/interfaces so that cotains these two lines:

auto eno1 
iface eno1 inet dhcp
SuB
  • 4,229
  • 5
  • 24
  • 33