Pfsense VMware ESXi
Pfsense VMware ESXi
Pfsense VMware ESXi
ESXi 5.5
AUGUST 23, 2014
Prerequisites:
Think of the private address range you want
Private addresses are:
Lets Start!
Currently your setup may look similar to something like
this:
Our modem becomes independent of the router. pfSense becomes the router living as a VM on our
ESXi host. A switch may not be needed, but theyre great to have.
pfSense as a virtual machine will sit between your modem and switch to act as
a router. It will be able to provide IP addresses to both physical and virtual
machines via its DHCP server (or you can set the IP manually). One network
card on your ESXi host will connect to the modem (WAN) while the other
connects to the your switch (LAN). Without a switch, you will only be able to
connect one host to your network as there is only one connection!
Installation
1. Set up a LAN and WAN switch in the vSphere client. One NIC (network
card) will be the LAN and one NIC will be the WAN. The LAN NIC will act as a
router to your VMs as well as anything connected to the switch. The WAN will
be connected to your modem to access and provide Internet connectivity to
your LAN.
Two vSwitches using two different network cards. One network card is responsible for the local
network and one is dedicated to the wide area network (Internet)
Give the names WAN and LAN corresponding to the which ever NIC is
connected to the Modem (WAN) and Switch (LAN).
2. Create a new Virtual machine with the follow settings:
3. Load the pfSense ISO image into the VM and boot from it.
Straightforward enough. Make sure to boot from the CD/DVD drive.
4. Go with the default boot (number 1) or let the timer run down.
6. Accept all the default settings and wait for it to finish installing.
Continued in Part 2: Install pfSense on ESXI 5.5 where we will configure the
new installation.
When prompted for a WAN connection, provide it with the NIC connected to the
WAN. You can find the MAC address of the NIC and match it up with what
pfSense sees (e.g. em1)
Confirm the interfaces (y) and wait for pfSense finish its configuration and bring
you to the main menu.
10
2. Connect to pfSense
At this point, you will not be able to access the pfSense web interface because
you are still connected to your original router as your
gateway/modem/router/access point and it is currently providing your with an IP
address. We want pfSense to provide us with an IP address instead. Unplug the
WAN device (modem, router, access point) from your switch so you have a LAN
without Internet connectivity. You may also lose connectivity to the vSphere
Client just reconnect or have it restart its networking to gain a new IP from
DHCP. Release/Renew IP addresses for your computer by unplugging and
replugging their cables, and pfSense should provide you with an IP address! If it
does not, make sure pfSense is operating on correct network adapter (LAN)
and there is not other device on the network that can provide you with an
address (other routers, modems and access points).
After the changes, your network should look like this:
11
12
Run through the setup as you see fit. General the defaults will do for now. When
you arrive at the Configure LAN Interface do not provide your new private
address (e.g. 10.0.0.1) as of yet. We will finish the wizard first. Click Reload
and pfSense will restart temporarily. If it does not redirect you after 5 minutes,
just go to 192.168.1.1 in a new window.
At this point you may either change the LAN IP to your own private range or add
the WAN interface (Part 3) if you are happy with the 192.168.1.1 range.
Click Interfaces in the top menu bar than LAN. Provide the new Static IPv4
address you prefer e.g. 10.0.0.1/24 than click Save. DO NOT APPLY
CHANGES. You will also need to setup your new DHCP range before
continuing.
DO NOT APPLY CHANGES
Click Services in the top menu bar then DHCP Server. Provide the new range
for your DHCP Server. Remember to leave your last address as a Broadcast
address (e.g. 10.0.0.255 for 10.0.0.1/24). I placed half of my addresses into
13
DHCP. Hit Save then return the Interfaces -> LAN page and Apply your
changes.
You lose access to pfSense after a little while. Unplug and replug your network
cable to get a new address within your new DHCP range.
Verify your new network details and access pfSense once again at its new IP
(e.g. 10.0.0.1)
In Part 3: Install pfSense on ESXi 5.5 we will configure the WAN (Internet)
connection for your LAN.
14
Find and enable the option in the web interface to disable NAT (network
address translation) to turn the device into a simple modem. This
activatesBridge Mode. You have have to search your devices manual to find
this option and see if it supports it. Restart the device if prompted before
continuing.
16
Turn off WiFi on your modem router. It is almost useless when in bridge mode.
17
You can plug in your WAN connection now. Plug a cable from your bridged modem router to the ESXi
host running pfSense. Make sure it is into the network card you have specified as your WAN.
18
Your network is ready. Having a switch allows you to have more LAN connections. pfSense has now
become your router, firewall, DHCP and DNS server.
If successful, you should get an Internet connection! Log back into pfSense and
verify your WAN connection has an IP address. If you do not for whatever
reason, go into Interfaces -> WAN and give pfSense a hostname under DHCP
client configuration.
In Part 4, we will be wrapping up the installation with some necessities.
Now that our pfSense installation is set up and working, we will have to wrap up
our installation with a few necessities such as VMware Tools. You can find
follow along our installation in Part 1, Part 2 and Part 3.
VMware Tools are available for FreeBSD, if you selected it as the virtual
machines operating system. VMware Tools are important for increasing
performance by allowing it to interact better with its hypervisor. It is extremely
important in pfSense because it offers 10Gbp network cards via the vmxnet3
driver.
Ensure your pfSense can access the internet.
1. Access the pfSense shell
Either through the console (option number 8) or by enabling Secure Shell (SSH)
within System -> Advanced. Connect to pfSense via any SSH utility you have if
you prefer SSH (e.g. Putty).
Enable SSH in within the pfSense web interface via System -> Advanced
For 32 bit:
1
For 32 bit:
20
Use Putty to SSH into pfSense. Putty makes it easier to copy and paste code instead of typing it
which almost always leads to spelling mistakes
21
I am running the 64 bit version of pfSense. This lets VMware know which version of VMware Tools to
install.
If it fails to install the first time, run the final line again for a reinstall.
Remove the leftovers after the installation:
1 rm -f /etc/vmware-tools/not_configured
22
4
5 echo '/usr/local/etc/rc.d/vmware-tools.sh restart' >> /usr/local/etc/rc.d/000-ldconfig.sh
6
7 echo '/usr/local/bin/vmware-config-tools.pl -d' >> /usr/local/etc/rc.d/000-ldconfig.sh
8
9 chmod a+x /usr/local/etc/rc.d/000-ldconfig.sh[/sourcecode]
As bad as this is script is, it seems to fix the problem where the vSphere Client
says it is not running even though everythng else says it is (terminal commands,
guest VM options, VMXNET3 working). VMware Tools also does not start
because it wants to run through setup again. Hopefully this fixes all of that.
6. Add the VMXNET3 network cards
Shutdown the VM either through the shell (type exit then choose option 6) and
add the VMXNET3 NICs as desired to replace your WAN and LAN network
cards.
23
You have to shutdown the virtual machine first before removing and adding network adapters. Make
sure the adapter type is VMXNET3. Note the MAC addresses as well.
pfSense will notify you there is a network interface mismatch by swapping the network cards.
You will have to enter vmx3f0 or vmx3f1 depending on the interface (not the
entire name). Make sure you link the correct network adapter to the correct
interface. Check the MAC addresses like we did in Part 2.
24
Specify the network adapter which has been allocated for both your WAN and LAN. They will be
either vmx3f0 or vmx3f1.
Link the MAC addresses to the VMs settings if you are unsure which is the LAN
and WAN.
8. Make sure everything is working!
VMware Tools should be successfully installed natively on pfSense
25
When finished, pfSense will return to its usual screen retaining all your previous changes and IP
addresses.
10Gbps networking!
Credits:
https://doc.pfsense.org/index.php/VMware_Tools
http://www.v-front.de/2013/06/how-to-install-or-update-VMware-tools.html
26
Ending thoughts:
Our installation may be finished but pfSense offers many more features than
such a router, firewall, DNS and DHCP server. In the future I will cover a range
of popular features, packages and guides for pfSense that I feel arent covered
well enough.
28
29