Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Leon Nunes
Leon Nunes

Posted on

     

Pfsense as a KVM router and Firewall.

My current homelab network setup is currently in a bridged mode with my router this means I can simply start a new VM and its accessible via LAN as my Raspberry Pi acts as a DHCP/DNS server.

To test out how PFSense works I decided to setup a PFSense VM with two networks,One for the WAN(My Router) and one for the LAN(The VM's Using new network).

What is PFSense?
You can read about ithere

This is how the PFSense KVM domain looks

pfsense.sh

#!/bin/bashvirt-install --connect qemu:///system \        --name="pfsense-router" \        --cdrom pfSense-CE-2.5.1-RELEASE-amd64.iso \        --disk path="pfsense-test.qcow2",size=4,bus=virtio,format=qcow2 \        --memory=1024 \        --graphics vnc,listen=0.0.0.0 \        --os-variant "freebsd10.0" \        --vcpus 2 \        --cpu host \        --os-type linux \        --network network=br0,model=virtio \        --network network=pfsense-router-net,model=virtio \        --console pty,target_type=serial \        --noautoconsole
Enter fullscreen modeExit fullscreen mode

The default Network is what I use for creating the VM's under the PFsense
network.
The following is how the PFsense router default network looks like

custom-network.xml

<network>  <name>pfsense-router-net</name>  <uuid></uuid>  <forward mode='nat'>  </forward>  <bridge name='virbr9' stp='on' delay='0'/>  <dns enable='no'/>  <mac address='52:54:00:a5:08:cb'/>  <ip address='192.168.123.1' netmask='255.255.255.0'>  </ip></network>
Enter fullscreen modeExit fullscreen mode

Setup this network using your command line

sudovirsh net-define custom-network.xml
Enter fullscreen modeExit fullscreen mode

Note:Setting<dns enable='no'> disables the use of libvirts DHCP server.

Once the installation is done the only problem I found was the WAN interface blocks all incoming connections, and you have to access the PFSense router via the LAN interface.
You can followthis to disable the same
Or you can simply create a new VM with a browser and access the same. When you create a new VM make sure you give it the network you created above.

That's all folks

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

He/Him. Dabbling in Service Meshes, API Gateways and Devops/Hardware/Homelabs
  • Location
    Remote
  • Education
    Doesn't Matter
  • Pronouns
    he/him
  • Work
    Customer Sucess Engineer
  • Joined

More fromLeon Nunes

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp