PVE (Proxmox VE) Multi-port Identification
About: |
This is a post about network card (multiple ports) identification in the
PVE
system. Through theethtool
command, you can easily find the corresponding location of each network port.
Operation Steps: |
Take
Intel EXPI9402PTBLK 82571GB Network Adapter
as an example
Install the ethtool
command
apt update && apt install ethtool -y
ethtool
can be used to view network device driver parameters and hardware configuration.
Check the device name of the network card in the PVE
server
ip -c a
Where
enp1s0f0
andenp1s0f1
are the two network ports of the network card, corresponding toMAC
addresses00:24:81:7e:ce:cb
and00:24:81:7e:ce:ca
respectively.
Method A |
Use
ethtool
to identify the device name and corresponding network port location in thePVE
system.
Enter the following command to find the physical network port (network port with indicator) of the first device name enp1s0f0
ethtool --identify enp1s0f0
Enter the following command to find the physical network port (network port with indicator) of the second device name enp1s0f1
ethtool --identify enp1s0f1
Method B |
If the network card does not support the
ethtool --identify
command (indicator) for identification, the following method can be used.
Enable the two network ports enp1s0f0
and enp1s0f1
separately
ifup enp1s0f0
ifup enp1s0f1
Insert the network cable (Cat5e
) into one of the network ports of the network card (Intel EXPI9402PTBLK 82571GB
) and the other end of the network cable into another powered network port, such as a switch, router, computer, etc.
At this time, enter the command to view the network port status
ethtool enp1s0f0
As shown in the figure, Link detected: yes indicates that the found network port is enp1s0f0
.
On the contrary, it shows Link detected: no, indicating the network port enp1s0f1
without a cable.
Device Location |
When directly passing a specified network port,
ethtool
can easily find the location of the network port in thePVE
system.
View all physical network cards and locations of the server
lspci | grep -in 'eth'
View the location of the first network port enp1s0f0
ethtool -i enp1s0f0
View the location of the second network port enp1s0f1
ethtool -i enp1s0f1
As shown in the figure, the location of the first network port
enp1s0f0
is01:00.0
, and the location of the second network portenp1s0f1
is01:00.1
.
Finally, pass through the specified network card or network port in the virtual machine.
Conclusion: |
Using
ethtool
to identify multiple network ports of a network card is really convenient.
Finally, a corresponding table can be made to facilitate future lookups.
Physical Network Card | MAC Address | PVE Device Name | Device Location (for passthrough) | VM Name |
---|---|---|---|---|
1st Port | 00:24:81:7E:CE:CB | enp1s0f0 | 01:00.0 | LAN |
2nd Port | 00:24:81:7E:CE:CA | enp1s0f1 | 01:00.1 | WAN |
Reference: |
Related: |