Main home router on a VM using pfSense

Discussions related to using VirtualBox on Windows hosts.
Post Reply
NikServrAsks
Posts: 1
Joined: 8. Dec 2021, 15:56

Main home router on a VM using pfSense

Post by NikServrAsks »

Hello I want to build a home router on my server using pfSense in VirtualBox but I have almost no experience working with VirtualBox networking. Main problem I faced was that my host machine was still able to get internet directly from my real router( temporarily placed in my home ) bypassing my pfSense router. Second problem is that all of my other vm were able to connect to pfSense web GUI but don't have internet access.
For virtual router i used 3 adapters:
first bridge adapter for WAN
second bridge adapter for LAN (for other devices such as AP ad TVs)
third is Internal network for connection with other VMs
I will appreciate it if someone can help me with my problem or maybe can tell me how to achieve this result by using other methods
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Main home router on a VM using pfSense

Post by scottgus1 »

It sounds like you want a pfSense VM to be the whole house router for your house's LAN, including the host PC.

Keep in mind that this will require your host PC to be running in order for any house PC or device to use the LAN or the internet. You might look into getting a small-form-factor PC and direct-installing pfSense on it.

In your proposed project, you'd need two network adapters in the host, and a physical network switch to distribute the pfSense-controlled network traffic.

Also note that Virtualbox Bridged does not always work with a Wi-Fi adapter, see Virtualbox Networks: In Pictures: Bridged Adapter. Wired Ethernet adapters in the host will work better for this project.

Here is the basic layout:

Internet > host adapter #1 (Bridged, other bindings disabled) > pfSense WAN
pfSense LAN > host adapter #2 (Bridged, maybe static IP address) > network switch > LAN computers

The details:

Internet comes from your existing modem into one host network adapter. The VM network adapter set for pfSense's WAN is Bridged to this host network adapter.

In the Windows host, go to this adapter's Bindings and uncheck everything except "Virtualbox NDIS# Bridged Networking Adapter". This will ensure that only Virtualbox Bridged can use this adapter, not the host:

Image

The VM network adapter set for pfSense's LAN is Bridged to the other host network adapter. Connect the network switch to this adapter. The IP address for this adapter could be DHCP-provided (which will come from pfSense's LAN) or you may have to set a static IP address in the pfSense LAN IP range and gateway. The host will connect to the LAN through this Bridged adapter. (Note that Bridged only works when there is something active plugged into the adapter, so the switch mentioned next must remain connected.)

Connect your other computers etc to the network switch. You can also include a Wi-Fi router configured as an access point, so you can have pfSense-controlled Wi-Fi in your LAN. All the computers and the Wi-Fi devices should get IP addresses and gateway from pfSense.

One thing about pfSense, as I report in Virtualbox Networks: In Pictures: "Sandbox", It may be necessary to toggle a couple settings in pfSense: DNS Resolver and DNS Forwarder
Post Reply