Use it on every device so only management networks or jump hosts can log in.
VTY ACL
A VTY ACL restricts who may open SSH or Telnet sessions to the device: a standard ACL applied with access-class <name> in under line vty.
1. show running-config | section line vty — access-class on all ranges?
2. show access-lists <name> — your management subnet permitted?
3. Test SSH from an allowed and a non-allowed host.
4. The denied attempt increments a deny counter.
5. Keep a console session open while changing it.
ACL applied on the right interface and direction → packet compared top-down → first matching entry decides → no match = implicit deny → counter increments on the matching entry
Move to TCP/SSH and AAA/login evidence while leaving the proven VTY ACL unchanged.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
access-class <acl> inPrimary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 First 30 seconds Verify boundary
Immediate answer: Verify which access-class is applied to the VTY lines, address family/direction and the actual management source address.
Verification chain: management source → route to device → VTY access-class → ACL match → authentication/authorization → session
Stop condition: A successful ping or open TCP port does not show the VTY ACL permits the source or that AAA will allow the session.
Step 2 Verification and output interpretation Verify boundary
Verify the VTY configuration plus the referenced ACL, then test from one authorized and one unauthorized source context when safe. Confirm denied-source counter behavior if exposed by the ACL and correlate successful authorized access with SSH/AAA evidence separately. A VTY ACL permit only says the source passed source restriction, but it does not show valid credentials or intended privilege.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Apply it to all VTY lines (line vty 0 15 on most switches, 0 4 on older routers) or some lines stay open. Add the management host before applying, or you lock yourself out. access-class filters on source address; ip access-group would not work on a line.
show line vty 0 15 | include Access— inbound ACL per line.show access-lists <name>— permit and deny counters.show running-config | section line vty— access-class on every line range.show users— current sessions and where they come from.
ReferenceWhat it is1 section · depth on demand
What it is
A VTY ACL restricts which remote source addresses are allowed to open management sessions to the device VTY lines. access-class <acl> in applies the ACL to inbound VTY access rather than forwarding transit traffic on an interface.
ReferenceImportant terms & boundaries4 sections · depth on demand
In depth
A VTY ACL restricts who can reach the switch's management lines
The Catalyst 9300 IPv4 ACL guide describes access-class <number> in|out on VTY or console lines, and notes that it requires numbered ACLs on that platform; named ACLs can't be applied to lines there. (Newer releases accept named standard ACLs on lines; check your release.)
C9300(config)# access-list 10 remark MGMT stations and jump hosts
C9300(config)# access-list 10 permit 10.10.50.0 0.0.0.255
C9300(config)# access-list 10 permit host 10.10.1.50
C9300(config)# access-list 10 deny any log
C9300(config)# line vty 0 15
C9300(config-line)# access-class 10 in vrf-also
C9300(config-line)# transport input ssh
C9300# show line vty 0 | include Access-class|Allowed input
Allowed input transports are ssh.
C9300# show access-lists 10
Standard IP access list 10
20 permit 10.10.1.50 (44 matches)
10 permit 10.10.50.0, wildcard bits 0.0.0.255 (3812 matches)
30 deny any log (219 matches)
vrf-also applies the restriction to connections arriving in VRFs too (for example a management VRF).
in versus out
| Direction | Effect |
|---|---|
access-class … in | Which sources may connect to the switch's VTY lines |
access-class … out | Which destinations users on the switch may connect onwards to (telnet/ssh from the CLI) |
A layered management protection
| Layer | Control |
|---|---|
| VTY lines | access-class + transport input ssh |
| Other management services | ACLs for SNMP, HTTP/HTTPS (ip http access-class), NETCONF/RESTCONF |
| Control plane | CoPP limits on management traffic |
| Network | Management VRF or out-of-band network |
Pitfalls
- Locking yourself out: apply from a host the ACL permits, and keep the console available.
- Forgetting jump hosts or monitoring systems that also need SSH (backup tools, automation).
- Assuming VTY ACLs protect everything. SNMP, HTTP and other services need their own restrictions.
The deny counter in show access-lists 10 shows who tries to reach the switch from where they shouldn't.
Documented example, not captured output.
Quick reference
A VTY ACL restricts which source addresses may open management sessions (SSH) to the device, applied with access-class on the VTY lines. It complements AAA by blocking unknown networks before authentication.
ip access-list standard MGMT-ONLY
permit 10.0.100.0 0.0.0.255
deny any log
line vty 0 15
access-class MGMT-ONLY in vrf-also
transport input ssh
Documented example, not captured output.
vrf-also applies the ACL to sessions arriving in VRFs too; without it, VRF sources may be denied unintentionally.
State model and technical mechanics
A VTY ACL is evaluated for management sessions that terminate on VTY lines rather than for arbitrary transit packets. It therefore protects the management plane by source address context while SSH/Telnet transport and AAA separately control protocol security and identity. The ACL can be correct yet a user still fails because of routing, SSH negotiation or AAA; similarly, successful authentication is impossible if the source is denied before the session reaches that stage. An ACL is an ordered packet-classification policy.
Limits and common misconceptions
VTY ACLs do not filter transit traffic and are not a complete management-security design. They do not encrypt Telnet, validate user identity or authorize commands. A source allowlist can also become brittle if administrator egress/NAT changes. Treat source restriction, secure transport, authentication and authorization as independent controls.
ReferenceConfiguration & state1 section · depth on demand
Design and configuration model
Permit only documented management networks/jump hosts, prefer SSH over Telnet, and ensure the VTY line ranges share consistent access-class and AAA/transport configuration. Keep an alternate recovery path before tightening the source list. Account for which source address the device sees, including NAT or management VRF boundaries, and avoid broad any permits that defeat the purpose of source restriction. Design ACLs from explicit traffic intent.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Security → ACL → VTY ACL. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Quick lookup tables
VTY ACL · technical reference
Compact network access/security mechanics, policy and evidence boundaries for fast lookup.
| Layer | VTY management role |
|---|---|
| Access-class | Source-address restriction |
| Transport input | SSH/Telnet protocol choice |
| AAA | Identity and privilege |
| Routing/VRF | Reachability to management plane |
Deep reference
Additional depth
Avoid remote lockout
Before tightening a VTY access-class, keep an existing management session open, confirm the device sees the expected source address, verify an alternate/console recovery path, apply the intended ACL, and establish a new SSH session from an allowed source. A VTY ACL change can be operationally disruptive even though it does not affect normal transit forwarding.