SmartOS as a Home Router
Posted by Dave Eddy on May 31 2015 - tags: techFor the last couple of years I’ve used PFSense as my home router. It’s been great - it’s easy to manage with the web interface, and really easy to add features like an OpenVPN server, bandwidth monitoring, etc.
But, I like to manage all of my servers and zones at home using Chef, and my router has always been left out as it required being configured manually through the web interface. So now, I’ve replaced PFSense with 2 SmartOS zones: 1 for NAT and the other for DHCP - both managed by Chef, and both monitored with Nagios. This also had the added effect of reducing two physical servers at home down to one, for a cheaper power bill.
There are 3 steps required to configure a SmartOS server as a home router replacement.
- Add the External Interface
- Create the NAT Zone
- Create the DHCP Zone
1. Add the External Interface
The first thing is to ensure that you have 2 (or more) NICs on the SmartOS server - one for the external network (The Internet) and one for the internal network that will be behind NAT. To list the interfaces run
root - datadyne sunos ~ # dladm show-phys -m
LINK SLOT ADDRESS INUSE CLIENT
rge0 primary f4:6d:4:X:XX:XX yes rge0
e1000g0 primary 0:4:23:XX:XX:XX yes e1000g0
Cross-referencing this information with output from ifconfig(1M) reveals that
the e1000g0 interface is not currently in use, and can be used as the external
interface.
root - datadyne sunos ~ # ifconfig e1000g0
ifconfig: status: SIOCGLIFFLAGS: e1000g0: no such interface

