About a year ago, I was looking around at building a pfSense server to replace my Netgear Nighthawk as I was bringing in some new hardware and wanted to create a couple of VLANs and setup some more advanced routing and such.
I did some research and stumbled across the apu1c4 which seemed like it would be perfect for my needs. pcengines also carries all the other components including case to build a very small device with a lot of power. Note that the below guide walks through the setup specifically with a machine running OS X 10.10. Instructions for writing the pfSense image for other Operating Systems can be found here while instructions for consoling to the device from other Operating Systems can be found here.
Here is a list of all the components you would need to order:
- One of either the apu1d (2GB of memory) or the apu1d4 (4GB of memory)
- One power adapter (Note that PC Engines makes adapters for the EU and UK
- One case (They do have other colors available however black is recommended by manufacturer for heat reasons)
- One mSata SSD Drive (16GB) or larger depending on your use case (storing large amounts of logs for example)
- One Null Modem cable
- One USB to Serial cable (this one I know works with OS X)
Building the server
- Follow this guide here which shows how to install the head spreader and insert the board into the bottom of the case. (Ensure you first remove the hex screws on the serial port)
- Install the mSATA drive by inserting it into the socket on the board.
- Close the case, and screw the hex nuts back in.
- Download a copy of pfSense here. When prompted choose AMD64 for the Architecture, Live CD with Installer (on USB Memstick) for the Platform, and Serial for the console.
- Using diskutil list find your usb device. In the below example, I have inserted a 16GB USB drive.
123456789101112131415161718→ diskutil list/dev/disk0#: TYPE NAME SIZE IDENTIFIER0: GUID_partition_scheme *500.3 GB disk01: EFI EFI 209.7 MB disk0s12: Apple_CoreStorage 499.4 GB disk0s23: Apple_Boot Recovery HD 650.0 MB disk0s3/dev/disk1#: TYPE NAME SIZE IDENTIFIER0: Apple_HFS Macintosh HD *499.1 GB disk1Logical Volume on disk0s2FEF9B781-C12B-46DA-812A-F18C6670605FUnlocked Encrypted.../dev/disk4#: TYPE NAME SIZE IDENTIFIER0: FDisk_partition_scheme *16.0 GB disk41: DOS_FAT_32 WININSTALL 16.0 GB disk4s1
- In the above output, you can see that my usb drive is at /dev/disk4. We need to unmount disk4s1 however before we can write to the device.
12→ diskutil unmount disk4s1Volume WININSTALL on disk4s1 unmounted
- We can now dd our pfSense install image to our thumb drive. Note that instead of using /dev/disk4. We are using /dev/rdisk4. In short /dev/rdisk will allow more direct access to the USB device and thus much better performance for writing our image.
1234→ gzip -dc pfSense-memstick-serial-2.2.2-RELEASE-amd64.img.gz| sudo dd of=/dev/rdisk4 bs=16k15152+1 records in15152+1 records out248258560 bytes transferred in 56.025501 secs (4431171 bytes/sec)
- Plugin your USB to Serial Adapter, and connect the serial cable to the adapter and to the serial port on the pfSense box.
- Plugin your USB drive that has the pfSense image into the pfSense box.
- From terminal run ioreg -c IOSerialBSDClient | grep usb which show your usb to serial cable connected. If it doesnt, check that you don’t need special drivers installed.
- The output from the above command should show you an IODialinDevice such as /dev/tty.usbserial
- In Terminal run the following to attach to the console device
1screen /dev/tty.usbserial 115200
- Connect the power cord to the pfSense box.
- After a minute or two the device should boot and you can start configuring the device following this guide here.
- Port mapping is from left to right. re0, re1, re2 respectively.