I had a (headless) server running 18.04LTS. On it ran some standard software: Apache, Docker, SSH, etc.
I ran do-release-upgrade
and after a seemingly normal set of questions and actions, a reboot was required. After the reboot, I lost all connection to it. Sites didn't load, SSH timed out. Ubuntu 19.10 is installed, but nothing works.
Via the VPS hoster interface I am able to log in from a browser.
How can I configure my server to be connected to internet (without being connected to internet)
Basic flow:
- I boot, login,
sudo su
ip a
shows for eth0
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:xx:xx:xx:xx:27 brd ff:ff:ff:ff:ff:ff
ip link set dev eth0 up
thenip a s eth0
changes to
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:xx:xx:xx:xx:27 brd ff:ff:ff:ff:ff:ff
inet6 fe80:xx:xx:xx:xx:xx:xxx/64 scope link
valid_lft forever preferred_lft forever
- Adding the network with
ip addr add [my ipv4 address]/22 dev eth0
changes it to
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:xx:xx:xx:xx:27 brd ff:ff:ff:ff:ff:ff
inet [my ipv4 address]/22 scope scope eth0
valid_lft forever preferred_lft forever
inet6 fe80:xx:xx:xx:xx:xx:xxx/64 scope link
valid_lft forever preferred_lft forever
dkpg-reconfigure network-manager
givesnetwork-manager is broken or not fully installed
. I tried this because at some point, I regained connectivity viadkpg-reconfigure network-manager
only to lose it some minor updates and reboots later.
Important files
/etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
/etc/resolv.conf
# [Contains only comments, no config]
/etc/init.d/networking
does not exist
Commands unavailable:
dhclient
,ping
,netstat
,ifup
,ifdown
,mtr
,ifconfig
,arp
,route
,ethtool
,nmcli
More things I tried
- Installing network-manager or dhclient from cache: There are no deb-files in /var/cache/apt/archives. There's still a
lock
file though. - Trying to see the difference between no connection and not resolving the DNS. I used
echo 1234 | netcat -v 8.8.4.4 80
sinceping
is missing, and got aNetwork is unreachable
, so it's not just the DNS. - Mounting a volume, so I can load missing files that way. Sadly, couldn't
mount
becausenfs-common
isn't installed, it seems. - Querying the networking service:
Unit networking.service could not be found.
- Checking the status of
systemd-networkd.service
: it's active and running, but in logs it only reportseth0: Gained IPv6LL
thenEnumeration completed
. Nothing on IPv4. Will check that German wiki page now.
sudo cat /var/log/apt/term.log
can show you what happened during the upgrade. Whilesudo cat /var/log/boot.log
can maybe tell you something about some startup issues. Did you trysudo dpkg --reconfigure -a
andsudo apt-get install -f
aftersudo apt update
? Are your /etc/apt/sources.list entries set correctly? Had a look whatsudo tasksel
tells about installed meta packages? – starkus Mar 30 '20 at 13:06term.log
shows I removednetwork-manager
, after I fixed the connectivity, right before I lost it again, probably as part of removing gnome. I cannot reinstall though without internet. I run on OpenStack so will look into mounting a volume... – TacoV Mar 31 '20 at 13:17sudo apt-get --no-install-recommends install network-manager
would fix your dependencies issues. But without connection I'm not sure if it gets installed from the archives. But you could trysudo dpkg -i /var/cache/apt/archives/network-manager*.deb
. In this case I'm not sure if the network-manager-gnome also gets installed, but you could complete the line before the* in a way that it won't. You could trysudo dhclient eth0
, ornmcli dev status
andnmcli con up YOURCONNECTION
. Thedhclient
opinion would be used if network-manager is not installed. – starkus Mar 31 '20 at 16:39sudo dpkg -i /var/cache/apt/archives/isc-dhcp-client*.deb
. – starkus Mar 31 '20 at 17:22sudo systemctl status networking.service
tell you? Are you able to start it? Doessudo systemctl start systemd-networkd.service
help you somehow? This page is in german language, but maybe worth to read through: wiki.ubuntuusers.de/systemd/networkd – starkus Mar 31 '20 at 17:27