Hands-on tutorial
Tutorials · Switching
How to Write Access Control Lists (ACLs) on a Layer 3 Switch
Control traffic between VLANs directly on the core switch: plan the rules, write standard and extended ACLs, apply them in the right direction, and test without locking yourself out.
Before you start
- A Layer 3 switch routing between VLANs
- A list of which VLANs may talk to which, and on which ports
- Console or out-of-band access in case of mistakes
Step by step
Write the policy in plain language
For example: guests may reach only the internet; cameras may reach only the NVR; staff may reach servers on web and file ports.
Know the ACL types
Standard ACLs match source addresses only. Extended ACLs match source, destination, protocol and port, which is what inter-VLAN policy needs.
Write the rules from specific to general
ACLs are processed top-down and end with an implicit deny. Add explicit permits, then a final deny with logging.
ip access-list extended CAMERAS-IN permit tcp 10.0.40.0 0.0.0.255 host 10.0.50.10 eq 554 permit udp 10.0.40.0 0.0.0.255 host 10.0.0.1 eq 123 deny ip any any log
Apply on the right interface and direction
Apply inbound on the VLAN interface where the traffic enters the switch.
interface vlan 40 ip access-group CAMERAS-IN in
Allow return traffic and essentials
Remember DHCP, DNS and NTP. Switch ACLs are usually stateless, so replies must be permitted too.
Protect yourself
Before applying, schedule an automatic reload or rollback, or work from the console, in case you block your own management access.
Test and monitor
Test each allowed and blocked flow from a real device, and check the hit counters.
show access-lists CAMERAS-IN
Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.
Pro tips
- Name ACLs by purpose and add remarks to each line.
- Use a firewall for complex or stateful policies.
- Keep ACLs in version control with the rest of the configuration.
FAQ
Frequently asked questions
Switch ACL or firewall?
Switch ACLs are fast and good for simple inter-VLAN rules. Firewalls add state tracking, applications, users and logging for more complex policies.
What is a wildcard mask?
The inverse of a subnet mask: 0.0.0.255 matches any value in the last octet.
Keep learning
Related guides
Inter-VLAN routing on a Layer 3 switch
Read more →What is an ACL?
Read more →Firewall rules best practices
Read more →How to Configure VLANs on a Managed Switch
Separate staff, guests, voice and cameras into their own VLANs: create VLANs, set access and trunk ports, and verify traffic separation.
Read more →How to Set Up Inter-VLAN Routing on a Layer 3 Switch
Route between VLANs at wire speed using switch virtual interfaces (SVIs), a DHCP relay and ACLs that control which networks can talk.
Read more →How to Configure Link Aggregation (LACP) Between Switches
Bundle two or more links into one logical link for more bandwidth and redundancy using IEEE 802.3ad LACP.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.