I spent quite a bit of time researching solutions for virtual routers. I’m definitely not a r/s expert, so I wanted something that was easy to setup, and still provided lots of tools for troubleshooting. Initially I setup the lab using vyos router, and it met my needs. But I since switched to pfsense, and it’s absolutely amazing. Plus it comes with a pretty sweet firewall. So my guide here, will be a tutorial on how to deploy pfsense and configure it for home lab purposes. If you already have a router in mind, or a physical router, feel free to skip these steps.
Initial config and disable firewall in pfsense cli
GUI configuration of pfsense – Initial config of firewall
Setting up the Interfaces
Firewall rules for each of the interfaces
I’m not going to go through each of the edit screens on how to add firewall rules, since I have shown examples in the above screenshots. Instead i’m just going to post screenshots of the firewall rules that I have added for each interface. In some instances I have just added a blanket allow all from any to any because its my home lab and pfsense is not my actual internet firewall š If you want to keep it more secure, go for it.
Configure DHCP – Optional, but recommended
I would recommend setting up 50 or so IPs to be used for DHCP. It makes spinning up new vms in vcenter a little easier since it will auto select and IP, get the correct dns server, domain name, etc. Configure these on all the interfaces EXCEPT The WAN (Internet) interface.
Optional: Parse the xml and skip the step by step guide
This is my backup config. It probably won’t load for you if you try and do a system restore since I’ve removed cert info and passwords, etc. But if you prefer to parse this and setup pfsense, i’m making it available.
5 thoughts on “Home Lab – Virtual Router in your home lab – pfsense”
How do you configure pfsense to give out only .5 addresses to a new VM’s that are being build, Please.
Check out the Configure DHCP ā Optional, but recommended section. It talks about adding DHCP to the subnets.
When your VM spins up in vcenter, point the DNS to default gateway IP address and if you’ve configured the dhcp it will assign an IP address.
I had to rebuild my lab and i am running in to an issue. my set up as follows.
I have created a virtual switch for each “vlan” and port group that is assigned to that switch. I am installing pfsense. Every time i attach additional nics to it vLAN10 and so on pfsense will not get WAN ip address. If i remove those nic’s and just have one VM Network, i get an WAN ip address via DHCP.
Matt,
First, thank you so much for these guides. Its really helpful in getting someone like me off the ground.
I think that in your screenshots where you’re creating the VM, the interface should be “VM Network” instead of vLAN10-Management. If I create the router with vLAN10-Management as the first interface, it considers that the WAN interface and doesn’t get a reachable IP.
Please feel free to delete this comment if I’m wrong.
Also, if you want to add another step for completeness, I had to disable the DHCPv6 and RA services on the LAN interface before it would let me disable IPV6 on that interface.
How do you configure pfsense to give out only .5 addresses to a new VM’s that are being build, Please.
Check out the Configure DHCP ā Optional, but recommended section. It talks about adding DHCP to the subnets.
When your VM spins up in vcenter, point the DNS to default gateway IP address and if you’ve configured the dhcp it will assign an IP address.
I had to rebuild my lab and i am running in to an issue. my set up as follows.
I have created a virtual switch for each “vlan” and port group that is assigned to that switch. I am installing pfsense. Every time i attach additional nics to it vLAN10 and so on pfsense will not get WAN ip address. If i remove those nic’s and just have one VM Network, i get an WAN ip address via DHCP.
Matt,
First, thank you so much for these guides. Its really helpful in getting someone like me off the ground.
I think that in your screenshots where you’re creating the VM, the interface should be “VM Network” instead of vLAN10-Management. If I create the router with vLAN10-Management as the first interface, it considers that the WAN interface and doesn’t get a reachable IP.
Please feel free to delete this comment if I’m wrong.
Also, if you want to add another step for completeness, I had to disable the DHCPv6 and RA services on the LAN interface before it would let me disable IPV6 on that interface.
Thank you again!