[SOLVED] PVE 4.1 how to passthrough Nic to LXC

elurex

Active Member
Oct 28, 2015
204
13
38
Taiwan
Anyone knows how to pass sr-iov VF Nic to LXC in pve 4.1?

The VF nic highlight in *** are the ones that I want to pass to LXC
Code:
root@pve-dol1:/sys/class/net/eth6/device#  lspci |grep Eth
03:00.0 Ethernet controller: Intel Corporation Ethernet Connection X552/X557-AT 10GBASE-T
03:00.1 Ethernet controller: Intel Corporation Ethernet Connection X552/X557-AT 10GBASE-T
05:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
05:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
***05:10.1 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
***05:10.3 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
***05:10.5 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
***05:10.7 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
07:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
07:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

I know first I must set in /etc/pve/lxc/CTID.conf

lxc.cgroup.devices.allow = c XXX:* rwm (where xxx = major *=minor ids)
lxc.mount.entry = /dev/eth0 dev/eth0 none bind,optional,create=file

but I cannot find any VF eth NIC under pve host's /dev/
 
  • Like
Reactions: hookx
I don't know... why do you would like to do this? This make for me no sense. Make an extra bridge with an specific interface and assign this to your LXC.
 
AFAIK they should show up on the host in `ip link` / `ifconfig`, so you should be
able to pass the interface via lxc.network.type+lxc.network.link:
eg. if it's enp5s16f1 (which I think would be the default these days for your pci ids):

lxc.network.type: phys
lxc.network.link: enp5s16f1

Note that the order is important, first .type, then .link.
 

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!