My router (pfSense
) is inside a VM on my server. I have 2 NICs. One of them is PCI passed through to the pfSense
VM (this is where the WAN is plugged) and the other (enp5s1
) is bridged with with all the VMs (including pfSense
) (this is the LAN one that is connected to manged switch TL-SG108E).
So from pfSense
POV I have 2 NICs. 1 passed through that the internet comes from (WAN) and 1 virtual (that is bridged with enp5s1
) which goes to the switch (LAN).
Now I created a VLAN in pfSense and added it in Interface Assignments
VLAN Interfaces:
vtnet0 (lan) 11 Gaming VPN Network
Interface Assignments:
Interface Network Port
WAN re0 (98:de:d0:83:00:3e)
LAN vnet0 (fe:54:00:ae:b2:2c)
VLAN11 VLAN11 on vtnet0 - lan (Gaming VPN Network)
In the normal use case where pfSense is running on it’s own device my switch would pick the VLAN (when I select the VLAN number it should display it’s name meaning it detected it) but in my use case it doesn’t.
How should I configure my host OS (Rocky Linux) so that the VLAN get passed through the bridge (so that my switch detects them)?
Here is my host net conf:
ip link
(MACs are obfuscared buf if they’re the same originally they are the same here)
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: enp5s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP mode DEFAULT group default qlen 1000
link/ether 90:e2:ba:11:ff:32 brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 90:e2:ba:11:ff:32 brd ff:ff:ff:ff:ff:ff
5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
link/ether 52:54:00:00:51:df brd ff:ff:ff:ff:ff:ff
6: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000
link/ether 52:54:00:00:51:df brd ff:ff:ff:ff:ff:ff
7: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN mode DEFAULT group default qlen 1000
link/ether fe:54:00:bd:11:2d brd ff:ff:ff:ff:ff:ff
8: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN mode DEFAULT group default qlen 1000
link/ether fe:54:00:3e:d1:82 brd ff:ff:ff:ff:ff:ff
9: vnet2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN mode DEFAULT group default qlen 1000
link/ether fe:54:00:ae:b2:2c brd ff:ff:ff:ff:ff:ff
10: vnet3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN mode DEFAULT group default qlen 1000
link/ether fe:54:00:cc:22:3d brd ff:ff:ff:ff:ff:ff
ip addr
(MACs are obfuscared buf if they’re the same originally they are the same here)
3: enp5s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
link/ether 90:e2:ba:11:ff:32 brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 90:e2:ba:11:ff:32 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.50/24 brd 192.168.0.255 scope global noprefixroute br0
valid_lft forever preferred_lft forever
inet6 ...
5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:00:51:df ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
6: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:00:51:df brd ff:ff:ff:ff:ff:ff
7: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:bd:11:2d brd ff:ff:ff:ff:ff:ff
inet6 ...
8: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:3e:d1:82 brd ff:ff:ff:ff:ff:ff
inet6 ...
9: vnet2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:ae:b2:2c brd ff:ff:ff:ff:ff:ff
inet6 ...
10: vnet3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:cc:22:3d brd ff:ff:ff:ff:ff:ff
inet6 ...
I found this post that suggests:
creating vlan sub interface attach to a bridge and connect to the pfsense respective vlan interface
Now if I understood it correctly I should do nmcli con add type vlan con-name enp5s1.77 dev enp5s1 id 11 master br0 connection.autoconnect yes
. But when I do that all the devices connected to the switch (i.e. everything connected to enp5s1
) lose connection. The server (pfSense VM host) is OK because it’s connected to pfSense VM via bridge (vnet2
→ br0
)