Setting up a guest network with the EdgeRouter Lite

I recently purchased a Ubiquiti Networks EdgeRouter Lite to act as the router to my home network. As this box is only a router and not a WiFi access point, I'm using my Apple Time Capsule as an access point. By doing this and not using the Time Capsule, I lost the ability to have a separate guest network that wouldn't interact with my main network and wouldn't have access to my internal resources. After a bit of searching, I found out that the Time Capsule (and Airport Extreme)'s guest network uses a VLAN tag of 1003. A VLAN is a virtual LAN designed to separate traffic without physically separating it. I knew that the EdgeRouter Lite was extremely powerful and could do all kinds of wacky things with a VLAN; the question was just how could I do it.

I've been dabbling with Linux networking for almost 20 years, so firewall, DNS, DHCP, etc. don't scare me. It was just a matter of putting the right pieces in the right places without having to resort to the command line.

Here's what I did:

  1. From the Dashboard, click Add Interface and select VLAN.

    Screen Shot 2015 07 05 at 1 59 24 PM

  2. Set up the VLAN as 1003 and attach it to the physical interface of your LAN. Give it an IP address in the range of a private IP block, but make sure you end it in a /24 to specify the proper subnet (I originally did /32 as I though it was supposed to be the exact IP address).

    Screen Shot 2015 07 05 at 1 59 56 PM

  3. Click on the Services tab. Click Add DHCP Server. Set it up similar to the image below.


    Screen Shot 2015 07 05 at 2 00 48 PM

  4. Click on the DNS tab under services. Click Add Listen interface and select the VLAN interface. Make sure you hit save.

    Screen Shot 2015 07 05 at 2 01 25 PM

At this point, you should be able to connect to your Guest Network and connect to the Internet. However, you'll be able to access the EdgeRouter as well as other devices on your LAN. Next thing you have to do is secure the VLAN.

  1. Click on Firewall/NAT and then click on Add Ruleset. This is for packets coming into the router destined for somewhere else (not the router). Set up the default policy for Accept. Click Save.

    Screen Shot 2015 07 05 at 5 00 24 PM

  2. From the Actions menu next to the Ruleset, click Interfaces.


    Screen Shot 2015 07 05 at 5 11 50 PM

  3. Select your VLAN interface and the in direction.


    Screen Shot 2015 07 05 at 5 12 44 PM

  4. Click Rules and then Add New Rule. Click on Basic and name it LAN. Select Drop as the Action.


    Screen Shot 2015 07 05 at 5 14 38 PM

  5. Click Destination and enter 10.0.1.0/24 or whatever your LAN IP range is. Then click Save. This will drop all packets from the VLAN destined for your LAN. Save.


    Screen Shot 2015 07 05 at 5 14 52 PM

  6. Repeat 1 and 2 above (name it GUEST_LOCAL). From the Interface, select the VLAN interface and the local direction. However, set up the default policy as Drop.

  7. Add a new rule. Set it to Accept on UDP port 53.


    Screen Shot 2015 07 05 at 5 18 22 PM
    Screen Shot 2015 07 05 at 5 18 28 PM

  8. Save.

Now you can test this by connecting to the guest network and accessing the Internet. Then try connecting to a device on your LAN or connecting to the EdgeRouter Lite. Both actions should fail.

I've tested this and it is working well on my network; if I've missed anything, please let me know!