ifupdown

May 31, 2019
11
0
6
47
In an effort to solve a totally unrelated problem, I've foolishly installed ifupdown2 via instructions here https://pve.proxmox.com/wiki/Network_Configuration and this command:

# apt install ifupdown2

I've since decided I want to restore ifdown and have done:

# apt-get purge --auto-remove ifupdown2

After rebooting, my host has no network connectivity.

I can get networking up by manually doing:

# ifup vmbr0

but how can I restore it so that it automatically starts networking and fix whatever other damage was caused by installing ifupdown2?




EDIT:
I reinstalled ifupdown2 and now networking starts and stops without problem.

How can I safely remove ifupdown2 and restore ifupdown? Or, is it safe to leave ifupdown2 installed?
 
Or, is it safe to leave ifupdown2 installed?

It normally is, we know quite a few users which use it, I also have it on some clusters of mine without bigger issues.

How can I safely remove ifupdown2 and restore ifupdown?

The correct way to move from ifupdown2 to ifpudown would be the same way as you did the other direction around:

apt install ifupdown

You should get an output like:
Code:
...
The following additional packages will be installed:
  ifenslave
Suggested packages:
  ppp rdnssd
The following packages will be REMOVED:
  ifupdown2
The following NEW packages will be installed:
  ifenslave ifupdown
0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
Need to get 97.8 kB of archives.
After this operation, 1,257 kB disk space will be freed.
Do you want to continue? [Y/n]
 
The correct way to move from ifupdown2 to ifpudown would be the same way as you did the other direction around:

apt install ifupdown

That‘s what I did. The only thing extra is I removed ifupdown2. Is that not possible?
 
The only thing extra is I removed ifupdown2. Is that not possible?

Actually it should be, as apt tries to pull in ifupdown again. So either the package state was off in another way on your system, or you had only bad luck with a masked networking.service..
 
Really appreciate the help.
Unfortunately, every time I put back ifupdown it causes the system to hang upon reboot because it can’t mount some of my LAN bindmounts because there is no connectivity.
What else can I look at?
 
Unfortunately, every time I put back ifupdown it causes the system to hang upon reboot because it can’t mount some of my LAN bindmounts because there is no connectivity.

You need to tell the system manager that those bindmount need network for mounting/unmounting - then it can know that it has to issue the unmout operation before it stops the network.

It could be enough to add the _netdev mount option, normally that's enough for sure, but the systemd version of Debian seems to have sometimes a bit of a issue nonetheless. If you run still into it you could try:
* writing your own mountunit (that's how we fixed it for our provided CephFS integration), e.g.:

Code:
# cat /etc/systemd/system/mnt-pve-cephfs.mount
[Unit]
Description=/mnt/pve/cephfs
DefaultDependencies=no
Requires=system.slice
Wants=network-online.target
Before=umount.target remote-fs.target
After=systemd-journald.socket system.slice network.target -.mount remote-fs-pre.target network-online.target
Conflicts=umount.target

[Mount]
Where=/mnt/pve/cephfs
What=192.168.30.64,192.168.30.65,192.168.30.66:/
Type=ceph
Options=name=admin,secretfile=/etc/pve/priv/ceph/cephfs.secret,conf=/etc/pve/ceph.conf

See https://www.freedesktop.org/software/systemd/man/systemd.mount.html for details, e.g. mount unit needs to be named like path, but slsashes are dashes (use systemd-escape -p /path/to/mount tool to convert to that syntax)
* update to systemd from buster-backports

But as said, try first to just add the "_netdev" option to the mount, then you see if you need to go more complicated :)

Hope that helps.
 
Should all of this be necessary because I’ve installed and then removed ifupdown2?

Perhaps it’s best to just leave ifupdown2?
 
So I figured it out...

The sequence to completely remove ifupdown2 and go back to ifupdown:

(starting with ifupdown2 already installed)

# apt install ifupdown
# apt-get purge --auto-remove ifupdown2
# apt install --reinstall ifupdown

The reinstall of ifupdown appears to be necessary because the purge of ifupdown2 must remove some scripts that are shared between the two binaries.
 
Should all of this be necessary because I’ve installed and then removed ifupdown2?

No, that post was for an orthogonal issue. You said you have some bind mounts using NFS, and depending on how you mount those it could be necessary to tell the systemd init manager about those mounts being on the network.
That was not related to ifupdown directly, it could be a problem independently of which network management tool one uses.

If you figured it out with the purge only your mounts may get recoginzed correctly already after all.

Anyway, glad you figured it out.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!