3

When I upgraded my cloud server from Debian 8 to Debian 9.12, I lost all network connectivity. I can neither ping the server nor ping anything from the server.

If I try to add a default gateway, I get SIOCADDRT: Network is unreachable

If I type netstat -anr, I get an empty list

There may be other obvious things I should try, but I am clearly not that knowledgeable.

Thanks for any help or guidance.

ip a
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

2: ens3: <BROADAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
     link/ether 00:16:3c:4e:a4:c8 brd ff:ff:ff:ff:ff:ff

/ect/network/interfaces contains:

source /etc/network/interfaces.d/*
#The loopback network interface
auto lo
iface lo inet loopback

#The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet dhcp

There are no files in /etc/network/interfaces.d/*

2
  • 1
    Please provide your /etc/network/interfaces file, along with any files residing in /etc/network/interfaces.d, and the output of the ip a command.
    – Lacek
    Jun 15, 2020 at 12:37
  • Thank you. I have added the requested information to my question. Jun 15, 2020 at 12:59

2 Answers 2

6

It seems that during the upgrade process your network device got renamed. Change every occurrence of enp0s3 to ens3 in /etc/network/interfaces, and it should get the IP address from the DHCP server.

1
  • Thank you so much! Made that change and rebooted and now everything works. Jun 15, 2020 at 15:26
4

This is caused by the configuration option net.ifnames=1 which is enabled by default in Debian 9.

You can either:

  • Update the interface name(s) in /etc/network/interfaces
  • Set the net.ifnames=0 as a kernel parameter

See https://wiki.debian.org/NetworkInterfaceNames for more details

1
  • 2
    To clarifty, setting net.ifnames=0 will return the host to having an eth0 interface which would leave OP in the same place with an interface mismatch in the config. However this will stop the host changing interface name in the future if the kernel driver changes, so is a good solution.
    – Criggie
    Jun 15, 2020 at 21:01

You must log in to answer this question.

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