[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debian Xen bookworm upgrade - vm interface naming scheme change from eth0 to enX0





On Sat, Jul 29, 2023, 06:47 David W. Hodgins <davidwhodgins@xxxxxxxxx> wrote:
On Sat, 29 Jul 2023 08:02:02 -0400, Chris Myers <chrismyers81@xxxxxxxxx> wrote:

> I upgraded my first Xen host to bookworm this morning. That seemed to go
> fine (so far...it's only been online for an hour.)
>
> After upgrading the first VM to bookworm, the networking service wouldn't
> start up. Looking at the logs it was because instead of being named eg.
> "eth0", the interfaces are now named eg. "enX0".
>
> Doing some poking around on the internet, it seems to have been a change
> with systemd - https://github.com/systemd/systemd/releases/tag/v250
>
>     * The predictable naming logic for network interfaces has been extended
>       to generate stable names from Xen netfront device information.
>
> Mostly sharing to make others aware; most of my VMs will be fine but I have
> one critical firewall VM with a dozen network interfaces that's going to be
> ... interesting.

You can add the kernel boot option net.ifnames=0 to go back to eth0.

The reason systemd made that change is that in some cases where there are
multiple network interfaces, the order they are detected is not guaranteed
by the hardware. If that happens eth0 may switch with eth1.

Regards, Dave Hodgins

Just because you can doesn't mean you should.  I would like to help you move on to the new normal, if you're interested in that.  I have not used interface names directly for a while.  You may review this config for Debian ifupdown2.


If I have more than one interface, I create a lacp bond across all similar speed interfaces.  I then refer to bond0 or whatever the interface name is rather than an individual interface.

For systems with a single interface, I will either hard code the interface name into /etc/network/interfaces (replace any eth0 you have with the new interface name), or create a bridge on the interface.

I also tend to be a heavy user of VLANs.  I like to think of each CIDR as unique and exclusive on a given broadcast domain.  

If you're curious about how to migrate to the new syntax, I recommend taking a look at what is no longer referred to as the "iproute2 cheat sheet":
I'll include the content of the example interfaces file inline for reference.


I recall using [1] to find the files which needed to have the eth0 replaced with the new interface name.

[1] grep -rsil eth0 /etc

If you wanted to shoot from the hip, you could

sed -i -e 's/eth0/enp1s0/' $(grep -rsil eth0 /etc)

But I'd probably take a backup and do it in multiple steps if I were to do it in production.  During a scheduled maintenance window.  After letting your boss know ;-)

C.J.

__END__
auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet manual

auto enp2s0
iface enp2s0 inet manual

auto enp3s0
iface enp3s0 inet manual

auto enp4s0
iface enp4s0 inet manual

auto bond0
iface bond0 inet static
        bond-miimon 100
        bond-lacp-rate 1
        bond-mode 802.3ad
        bond-miimon 100
        bond-slaves regex (enp.s0)

auto vmbr0
iface vmbr0 inet static
        bridge-vlan-aware yes
        bridge-ports bond0
        bridge-stp on
        bridge-fd 0
        bridge-vids 78,79,101,179,201,279,401,600,601

auto int
iface int inet static
        address 100.64.79.64/24
        vlan-id 179
        vlan-raw-device vmbr0

auto biz
iface biz inet static
        address 23.REDACTED.200/26
        route 23.REDACTED.0/24 23.REDACTED.193
        vlan-id 101
        vlan-raw-device vmbr0

auto ha
iface ha inet static
      address 10.64.79.64/24
      vlan-id 279
      vlan-raw-device vmbr0

auto six
iface six inet static
        address 2602:REDACTED:1337::0.0.0.200/64
        gateway 2602:REDACTED:1337::1
        vlan-id 600
        vlan-raw-device vmbr0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.