Firewall Policy Cleanup#
After the management VLAN was working, firewall rules were simplified using the newer UDM SE policy editor. The new policy engine is more robust and easier to work with to create enhanced and dynamic rules. My only fear is that I might get used to using this new policy engine and one day run into having to create firewall rules “the old way” and revert back to extensive Google searches to remember how to use legacy editors again.
General thought process behind the new firewall policies is to allow administrative (me) access to VLANs using MAC-based or IP address filtering. I accomplished this by setting static IP addresses for the devices in-use, then adding them to allow rules with the policy editor. I am also blocking cross-VLAN traffic, including talkback to gateways where unnecessary, and management portals.
Allow admin devices first
Allow required service traffic
Block normal client networks from Management
Block normal client networks from Services except approved ports
Allow normal network behavior where appropriateThe most important rules are simple.
Allow SW Devices to Management Network
Block Networks to Management NetworkThis allows the main admin workstation to reach infrastructure while preventing normal devices, phones, IoT devices, and guest devices (guest network is using UDM’s built-in Guest Network setting) from reaching management interfaces.
A similar model is used for the Services Network.
Allow SW Devices to Services Network
Allow Management Network to Services Network
Allow Networks to approved service IPs/ports only
Block Networks to Services NetworkThis prevents casual scanning or enumeration of the Services VLAN. Scanning and enumeration tactics were topics covered in a CSIA 225 (Ethical Hacking) that I took this last semester, and some of the techniques used to exploit vulnerabilities were eye-opening enough that I thought it was the perfect opportunity to finally migrate the network.
Blocking Gateway Management Access#
An issue discovered during testing was that normal clients could still access the UDM SE management portal through gateway IPs. This traffic is different from normal inter-VLAN traffic because it targets the gateway itself. It needs to be handled as gateway/local traffic, not just internal routed traffic.
Intended Behavior
Clients can use their own gateway for normal routing.
Clients can use DHCP and DNS where required.
Clients cannot browse to UDM/UniFi management portals.
Admin/SW devices can still reach management portals, regardless of which VLAN the device is on.A key lesson was not to block all networks from all gateway IPs on all ports. Doing so breaks DHCP and other necessary gateway services, taking devices offline and complicating the recovery process. Instead, only gateway management/admin ports should be blocked for normal client networks, while keeping access to a VLAN’s home DHCP address.
Gateway management ports were separated from UniFi adoption/control ports to accomplish this. Port 8080 was originally included in a management-port block profile, but that broke UniFi adoption as TCP 8080 is used for UniFi inform requests.
The port grouping was corrected conceptually as:
Restrict Access to Gateway Management Ports
TCP 80
TCP 443
TCP 22
TCP 8443
TCP 6789UniFi Control Plane and Adoption (Leave these alone.)
TCP 8080
UDP 3478
TCP/UDP 10001This fixed the UniFi adoption issue while still allowing gateway management access to be restricted. The policy for gateway and portal access is set to Restrict.
Services VLAN Access Policy#
A key problem discovered after Pi-hole was working was that normal clients could browse directly to Pi-hole’s management dashboard. Obviously, this is not desired, especially across VLANs. Clients need to use Pi-hole DNS, but they should not access the Pi-hole admin interface or the ability to scan the Services VLAN (see earlier firewall rules).
A broad Allow Networks to Services Network rule is not ideal because it allows enumeration and scanning of the entire Services VLAN.
Instead, the pattern is Block Networks to Services Network, and specific services will be allowed as-needed. I will allow FQDN via Traefik (docker.lab.shannonwetnight.com address) and have services exposed in this manner while avoiding a blanket Allow All policy to VLAN 11.
Blocking client networks to the Services Network prevents access to the Pi-hole web interface while DNS continues to function as intended. This also blocks access to all other management interfaces that cannot be split and exposed only on VLAN 10. The goal is to avoid management interfaces being exposed to normal clients, but also to avoid exposing them to other services on the same network, such as to minimize damage in the event of a compromised service.
Internal Firewall Policy Table#

Gateway Firewall Policy Table#

Traefik Long-term Plan#
It’s worth mentioning that the old Traefik model still remains the preferred long-term design.
- Users access services by FQDN.
- Firewall allows client VLANs only to Traefik on HTTP/HTTPS.
- Backend services remain inaccessible directly from client VLANs.
- Authentik can protect sensitive services.
- Admin-only dashboards are not exposed directly to users.
This design approach has not changed from last year.
Reply by Email