Code Monkey home page Code Monkey logo

hetzner-proxmox-pfsense's Introduction

hetzner-proxmox-pfsense

I did not really like the NAT solutions recommended for Proxmox/SmartOS on Hetzner. The perfectionist in me wanted to have the hypervisor behind the same firewall as the VM's. This is how I managed to implement pfSense with 1 NIC (1 IP) in Proxmox using PCI passthrough.

P.S. This was written with pfSense 2.3 in mind. Version 2.4 do not use the same installer and do not offer the option of enabling serial-console. I suggest you consult https://doc.pfsense.org/index.php/Installing_pfSense for an alternative solution.

step 1: install proxmox

Request a LARA (their nickname for KVM/IPMI) session. I had a flash drive installed since exploring SmartOS earlier, so I just dd'ed the .iso from the linux rescue system. Either that or request them to mount the iso in the LARA (KVM/IPMI) session.

step 2: install openvswitch

edit /etc/apt/sources.list.d/pve-enterprise.list

#deb https://enterprise.proxmox.com/debian/pve stretch pve-enterprise
deb http://download.proxmox.com/debian/pve stretch pve-no-subscription
apt update
apt upgrade
apt install openvswitch-switch

step 3: enable pci passthrough

edit /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"

edit /etc/modules

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
update-grub
reboot

step 4: create pfsense vm

  • Create a VM with 1 virtio interface.
  • Boot vm and install as EMBEDDED.
  • Shutdown VM after first reboot.
  • Enable autostart in options of VM.
  • Locate your ethernet card using "lspci". The address should be in the form of: 04:00.0.

edit /etc/pve/qemu-server/VMID.conf

serial0: socket
hostpci0: 04:00.0

step 5: change hypervisor network

edit /etc/network/interfaces

auto lo
iface lo inet loopback

auto vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge
        ovs_ports int0

allow-vmbr0 int0
iface int0 inet static
        address  10.0.11.2
        netmask  255.255.255.0
        gateway  10.0.11.1
        ovs_type OVSIntPort
        ovs_bridge vmbr0
        ovs_options tag=11

edit /etc/hosts

127.0.0.1 localhost.localdomain localhost
10.0.11.2 xxx xxx pvelocalhost
reboot

step 6: configure pfsense

  • Back to LARA, use 'qm terminal VMID' to connect to pfsense VM.
  • Finish initial setup.
    • WAN -> em0 -> v4/DHCP4: ${external_ip}/${cidr}
    • LAN -> vtnet0.11 -> v4: 10.0.11.1/24 (vlan 11 in this case)
  • Enter shell (option 8), disable pf 'pfctl -d'
  • Go to https://${external_ip} and System -> Advanced -> Networking check 'Disable hardware checksum offload'. (Not sure why, but that hindered me from connecting to webui/ssh on hypervisor.)
  • Setup port forwardring or vpn to your liking..

step 7: profit

hetzner-proxmox-pfsense's People

Contributors

pekare avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hetzner-proxmox-pfsense's Issues

Additional IPs and IPv6?

Hi, I am interested in this setup.

I wanted to know if it is possible to use additional IPs on pfSense, and if it is eventually possible to have the IPv6 subnet to be usable.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.