[SOLVED] USB network interface remains inactive after reboot

Aug 31, 2022
3
0
1
My PVE node is a fully updated enterprise 7.2 PVE on a Supermicro A1SRi-2758F.

My problem regards a USB3 2.5Gbps RJ45 dongle connected via a motherboard USB3 socket.

On first connecting the dongle, I define it's network by using the PVE GUI. After hitting "Apply Configuration" the network works as it should.

If I now reboot, whilst leaving the dongle plugged in, then the dongle's network remains inactive. The only way I can get it work is to use the GUI to edit only the Comment of the interface and then hit "Apply configuration".

My understanding is that the GUI "Apply configuration" button corresponds to the CLI command ifupdown2. But it seems that the command ifupdown2 is not accessible by root.

Can somebody help me answer the following questions:
1) How can I ensure that the dongle's network is always brought up after a reboot?
2) For PVE 7.2 (enterprise) from the CLI how do I force a restart/reload of the PVE network?

For completeness I should add the dongle uses a Realtek r8156 chip which uses the r8152 kernel module. I am using the most recent r8152 source provided by Realtek. I generated the r8152.ko module using dkms running on a separate machine with PVE 7.2 no-subscription. I have installed the RealTEK provided udev rule file. I have verified that the module r8152 is loaded correctly by udev during boot on detection of the dongle. I do not have my problem when using the dongle on a debian 11 with the appropriately dkms built r8152 module.
 
I can now answer my own question 2).

It seems that the way to reload the network configuration from the CLI is to:
systemctl reload networking.service

Regarding my question 1) I guess that the problem is that when udev triggers on my dongle it fails to action a reload of the network configuration.

As a workaround to my problem, I guess I just need to invoke "systemctl reload networking.service" at a suitable point after udev triggers on my device. Maybe an additional udev rule would work?
 
I can now answer my own 1) question.

By examining the udev events when I plug in the dongle I identified what seems to be a candidate trigger to use. When the udev rule triggers it starts a systemd service which executes the network reload.

Here is the udev rule (80-r8152.rules):
Code:
ACTION=="move", SUBSYSTEM=="net", ENV{ID_USB_DRIVER}="r8152", ENV{ID_NET_DRIVER}="r8152", TAG+="systemd", ENV{SYSTEMD_WANTS}="r8152@%k.service"

Here is the systemd unit (/etc/systemd/system/r8152@.service):
Code:
# This is a template /etc/systemd/system/r8152@.service for a r8152 dongle.

[Unit]
Description=reloads the network configuration whenever the USB3 2.5Gbps RJ45 is plugged in

[Service]
Type=oneshot
ExecStartPre=/usr/bin/udevadm settle
ExecStart=/usr/bin/systemctl reload networking.service

[Install]
WantedBy=multi-user.target

For the moment it works. Though it would be nice to know what is the correct udev event to use in the udev trigger rule.
 
Last edited:

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!