Virtual Pfsense vrbridge1

Hi

I’ve got a virtual pfsense box. I’ve been the last few weeks trying to cut my power usage down, and as a result, I’m also getting rid of a switch.

To have the same effect, I’ve passed through to pfSense, a 4 port network card, and bridged these together. I can then plug my devices into it and they connect together and through WAN

As it is only a 4 port…To save a much needed port, I’ve made the server talk to pfSense through a virtual bridge.
This works well. It can use DHCP, and access WAN without problems

The problem I am having is that - The server is unable to ping/access other devices on the LAN.

The other devices do not have this problem - talking to each other, but are unable to ping the server

My network XML is something like this…Am I missing something?

<network>
  <name>lanLink</name>
  <uuid>11111-etc-etc-111-etc</uuid>
  <bridge name="virbr1" stp="on" delay="0"/>
  <mac address="00:01:02:03:04:05"/>
</network>

First thing that comes to mind is firewall rules. Have you made sure that the vbridge allows all traffic?

The pfsense box is able to ping it…So presumably that is OK?

Not necessarily, the PFSense router should be able to but that doesn’t mean that it isn’t isolated from the LAN.

Also, double check that it is on the same DHCP server and subnet as the lan if you have a flat network.

It seems to be.

I have set it up the same as the other LAN ports, it is also present in the DHCP list. same 24 subnet.

I’ve allowed all on the server firewall for now, and still the same…I’ve put the same rule for allow across all the LANs on pfSense

As the configuration is the same on the pfsense firewall/interface setup I wondered if it might be something I am missing from the network XML? That’s why I pasted that over…Routing mode or something?

You should keep in mind that a switch chip in a modern switch is really efficient. However a router using a CPU needs to do a lot of work to copy the packets between interfaces (usually referred to as bridging). I’d posit that the power usage in terms of CPU will be higher than a small 8 port switch.

A dumb 8 port switch will be the best. If you need vlans look into a cheap mikrotik or unifi flex mini switch.

I’ve got something like a 20 port switch. It uses around 15w of power. The rest of the system doesn’t budge from around 50w with/without any networking

Strangely, if I add ip route add 192.168.212.0/24 via 192.168.212.1 (bridged LAN IP) I can get ping responses back. The same works for other machines to ping the server

OK, so I got this working.

First, set the routed mode to ‘Open’ and you shouldn’t have any problems

For some reason, the passed bridge did not like sitting in the same bridged LAN interface on pfSense. As soon as it was using it’s own IP range/own DHCP service, it had no problems.

I still don’t understand why though, if anyone can help on that

Interesting for sure

I’m a little confused at the exact topology you had. So pfsense had a pcie card it controlled, and you setup those four ports as a pfsense bridge. You also had a libvirt bridge sitting on your real host (with VMs). Then pfsense had a virtual port going to the bridge in libvirt.

I see two bridges here, did you add that virtual port in pfsense onto the bridge as the four port card? Otherwise the two bridges aren’t connected together.

A diagram might help here.

Let me clarify

pfsense has the PCI card, these are bridged together through pfsense

The server has a bridge libvirtd ‘open’ network which is passed as a virtio NIC

Adding the virtio NIC to the LAN bridge does not allow communication between other lan devices and the virtual nic

Adding the the virtio NIC to it’s own subnet allows the communication, though obviously with correct firewall rules

Maybe Pfsense/freebsd tries to be smart and offloads to the nic driver part of the bridging, and packets from the hardware bridge (the 4 port pci card) do not ‘cross’ to the virtual bridge?
Have you tried to disable all hardware offloads to the 4 port card?

To be fair, when I had recently turned off those disables in pfSense, as I’d previously only passed through a single port as a virtio. So perhaps it could be doing something like that

I guess it doesn’t really make sense to test it out, obviously the hardware offloading is of benefit if that’s what it is doing? (Is there a way to check this?) I’d also have to swap over the configuration…It is a little cleaner, but I’ve done it now, lol

To troubleshoot this I’d be looking at two tools:

  1. MAC address table of your bridge, “bridge fdb” on linux. This is a database of what MAC addresses have been shown out which ports, similar to a mac address table on a cisco switch. Both sides should have MAC addresses for the other side, pointing out the right interface.
  2. Packet capture on the linux bridge and pfsense bridge, this will allow you to see if requests / replies aren’t getting to the other side.

Out of curiosity, what was the make/model of the switch you decommissioned?
Are you aware that the more power efficient quad network cards still draw 4-5W continously (10W for old intel NICS) , and that is almost double what an 8 port gigabit managed switch draws when populated with 4 active nic connections?

From the pfsense docs:

VirtIO Driver Support
The FreeBSD kernel used by pfSense® software includes VirtIO drivers built into the kernel. No special action is necessary to enable the drivers.

Disable Hardware Checksum Offloading
With the current state of VirtIO network drivers in FreeBSD, 
it is necessary to disable hardware checksum offload 
to reach systems (at least other VM guests, possibly others) 
protected by pfSense software directly from the VM host. 
1 Like

That probably is the case, but I do need it for a second connection to the MOBO.

I guess I could grab a single card, which is more power efficient, but I do also use it for multipath, and obviously would have to make a purchase.

It is something like this:

Ethernet controller: Intel Corporation 82571EB/82571GB Gigabit Ethernet Controller (Copper) (rev 06)…A quad version…One on the server, one my main PC

Maybe I could do some testing, and remove if necessary. With two systems that could be 20W

Strange…Perhaps this would have allowed it to work if it was all bridged together.

It is however working with it enabled (But under another subnet), currently…