PVE cannot access the background after adding network card and the network is not connected

Share

In order to improve the transmission speed of the LAN, a PCI-E 2.5G network card (8125) was added to the NAS of the PVE system. After restarting, it was found that the machine was disconnected, unable to enter the background, and the soft route could not be connected.

reason

The console binding and network bridging of PVE depend on the interface name of the network card.

After adding a new network card (or adjusting the IOMMU group), the interface name of the original bridge network card may change, so the port may be confused or even the management may be lost.

resolvent

1. Enter the shell

Mode 1: External display or IPMI access the shell

External display of PVE machine or IPMI, directly enter shell (recommended)

Mode 2: Find the background management port and enter the background shell

If the network card is added on the basis of the original one, there is usually a network interface that can access the PVE background.

When there is no external display or IPMI, in order to access the shell, you need to find the network port bound to the PVE management background first. As mentioned earlier, the name of the network card has changed, so the network interface bound to the management background has also changed, so you need to find the port manually.

First, change the PC IP to and manage the background Other IPs of the same network segment Then unplug the network cable of the original PVE machine management network interface, use this network cable to directly connect the PC and other PVE network interfaces, change the PVE network interfaces one by one, and try to access the management background one by one until you find an accessible network interface.

After entering the management background, open the shell on the web page.

If all network cards cannot be accessed, it is recommended to find a display in mode 1.

2. Obtain the correspondence between the network interface and the network interface name

Successfully enter the shell and execute the command to view the current network card name and model:

 lspci | grep -i ethernet

The execution results are as follows:

The address at the beginning of the above picture is the PCI bus address in hexadecimal. According to the relevant rules (hexadecimal to decimal), the corresponding network card names are enp3s0, enp6s0, enp11s0, enp12s0.

Match the interface name and network port location according to the actual hardware situation. Take my D1581 motherboard as an example:

The motherboard has dual network ports. The chip in the north is Crab 8111, and the chip in the south is Intel I210; The PCI-E 2.5G network card chip added later is RTL8125 with dual network ports.

Therefore, the corresponding relationship is:

  • Mainboard Ethernet port 1: enp11s0
  • Mainboard Ethernet port 2: enp12s0
  • PCI-E network card -2.5G # 1: enp3s0
  • PCI-E network card -2.5G # 2: enp6s0

For other motherboards, we can judge according to the circumstances here.

3. Modify the management port binding

If you want to use the previous port as the management port, you need to modify the network port binding.

Mode 1: Shell modification

First view the network configuration:

 cat /etc/network/interfaces

The static bridge with management IP is the current management port.

 auto vmbr2 iface vmbr2 inet static address 192.168.1.100/24 gateway 192.168.1.1 Bridge ports enp67s0 # The bound physical network port, modify it; bridge-stp off bridge-fd 0

Modify the configuration file, change the bridge ports to the target network card, and then refresh the network with the following command.

 systemctl restart networking

Connect to the target network port and check whether it can be connected.

Mode 2: PVE WEB background modification

If an accessible management port is found, access the PVE WEB background, find the original management bridge at the node's network, and modify the port to the network port to be used:

4. Add a new network port

My machine does not engage in network card direct connection. It uses Linux Bridge+virtual machine bridge to complete network interworking. In order to use the new network card, you need to add two new bridges:

5. Modify the soft route interface

My machine uses OpenWrt for soft routing. In order to use this dual port 2.5G network card conveniently, I need to modify the soft routing interface.

Prefer to assign a new interface bridge to the OpenWrt virtual machine:

Then, in the OpenWrt management panel, modify the physical settings of the interface LAN, and check the newly added bridge interface:

After modification, save the application.

6. Verification and others

Through the above settings, the PVE machine successfully recovers the connection, and each virtual machine starts to work normally.

The PC network cable is directly connected to the 2.5G network card interface, and can normally obtain the IP assigned by the soft route and access the network:

After adding a 2.5G network card, you can save a lot of time when transferring data from PC to NAS:

The content described in this article is actually in 2021. Since the actual operation has passed for several months, there are occasional omissions and errors in the content, and you are welcome to point out and supplement in the form of comments.

In addition, the RTL8125, a common 2.5G Crab network card chip, has never had a network port or a network port loss on my PVE. As for ESXi's use of the 8125 network port or a network port loss, I am really not sure.

PCI-E x1 does not run at 2.5G of dual network ports, and the bandwidth is insufficient. This need not be mentioned again, because 99% of the cases in actual use are single ports.