VLANs Mark 3

My second attempt at applying VLANs has been generally successful and since that time I have been iterating to improve it. Notably I have:

Networks

Network VLAN Subnet
LAN 1 192.168.1.1/22
IoT 20 192.168.20.1/22
Work 30 172.16.6.1/24
Perimeter 40 192.168.40.1/22

This table shows the configuration of each of the networks and the associated VLAN ID. I’m also using the default UniFi guest network which is automatically managed.

Firewall

The LAN firewall rules have been somewhat expanded to account for these new VLANs. Notable features:

Rule Name Action Enabled Source Destination Advanced
2000 All established/related Accept all true Any Any Match Established
Match Related
2001 Accept all NTP requests IPv4 Accept all true IPv4:
  192.168.0.0/16
Ports:
  123
2002 Local to Work deny Drop all true IPv4:
  192.168.0.0/16
Network Work
(IPv4 Subnet)
2003 Work to Local deny Drop all true Network Work
(IPv4 Subnet)
IPv4:
  192.168.0.0/16
2004 LAN allow Accept all true Network LAN
(IPv4 Subnet)
Any Match New
Match Established
Match Related
2005 Drop invalid Drop all true Any Any Match Invalid
2006 IoT to LAN deny Reject all true Network IoT
(IPv4 Subnet)
Network LAN
(IPv4 Subnet)
2007 IoT to Perimeter deny Reject all true Network IoT
(IPv4 Subnet)
Network Perimeter
(IPv4 Subnet)
2008 Sonos UDP allow Accept udp true Network Perimeter
(IPv4 Subnet)
Ports:
  1901
  1900
  6969
2009 Sonos TCP allow Accept tcp true Network Perimeter
(IPv4 Subnet)
Ports:
  3400
  3401
  3500
2010 Perimeter to LAN deny Reject all true Network Perimeter
(IPv4 Subnet)
Network LAN
(IPv4 Subnet)
2011 Perimeter to IoT deny Reject all true Network Perimeter
(IPv4 Subnet)
Network IoT
(IPv4 Subnet)
2012 IoT allow Accept all true Network IoT
(IPv4 Subnet)
Any Match New
Match Established
Match Related
2013 Perimeter allow Accept all true Network Perimeter
(IPv4 Subnet)
Any Match New
Match Established
Match Related
2014 Work allow Accept all true Network Work
(IPv4 Subnet)
Any
2015 Local deny Drop all true Any Network LAN
(IPv4 Subnet)
Match New

I have a few firewall rule groups to make managing ports and address ranges easier.

Name Type
NTP Port Port Group 123
Local Networks IPv4 IPv4 Address/Subnet 192.168.0.0/16
Sonos UDP Port Group 1901 1900 6969
Sonos TCP Port Group 3400 3401 3500

Issues

This has been running pretty smoothly since configured. It’s also survived a hardware transition from a UniFi Security Gateway to a UniFi Dream Machine Pro. There have only been a couple of glitches:

Documenting the configuration

All the tables in this post were generated by the UniFi Markdown Extractor I wrote as a test application for my UniFi client library.


  1. I’ve just noticed this is a consequence of the rule ordering but it’s harmless in this case. ↩︎

  2. Hue bridges are in my experience prone to issues up to and including just not working out of the box. ↩︎

  3. Repeatedly pushing your new products in the app for the existing products is a good way to get me to consider alternatives. ↩︎