(Routers, Switches, IOS / IOS-XE / NX-OS β CCNA / CCNP / Real-World)
Device hardening reduces the attack surface and protects your Cisco infrastructure from unauthorized access, misconfiguration, and exploits.
1οΈβ£ Secure Device Access (Management Plane)
πΉ Use Strong Authentication (AAA)
- Prefer AAA with TACACS+ / RADIUS
- Fallback to local user if AAA fails
aaa new-model
aaa authentication login default group tacacs+ local
aaa authorization exec default group tacacs+ local
πΉ Use Local User Accounts (Minimum)
username admin privilege 15 secret Str0ngP@ssw0rd
β Avoid:
enable password cisco
β Use:
enable secret En@bleS3cret
πΉ Secure VTY Access (SSH Only)
ip domain-name lab.local
crypto key generate rsa modulus 2048
ip ssh version 2
line vty 0 4
transport input ssh
login local
exec-timeout 10 0
β Disable Telnet
2οΈβ£ Management Access Control (ACLs)
Allow only trusted IPs to access the device.
ip access-list standard MGMT-ACL
permit 192.168.10.0 0.0.0.255
line vty 0 4
access-class MGMT-ACL in
3οΈβ£ Disable Unused & Insecure Services
no ip http server
no ip http secure-server
no service pad
no ip source-route
no ip bootp server
β Keep device minimal
4οΈβ£ Password & Session Security
service password-encryption
security passwords min-length 10
line con 0
exec-timeout 10 0
line vty 0 4
exec-timeout 10 0
5οΈβ£ SNMP Hardening
β Avoid SNMP v1/v2c (community strings)
β Use SNMPv3
snmp-server group SECURE v3 priv
snmp-server user snmpadmin SECURE v3 auth sha AuthP@ss priv aes 256 PrivP@ss
6οΈβ£ Control Plane Protection (CoPP)
Protect CPU from attacks like DoS, scanning, routing floods
class-map match-any MGMT-TRAFFIC
match protocol ssh
match protocol snmp
policy-map CONTROL-PLANE-POLICY
class MGMT-TRAFFIC
police 64000
control-plane
service-policy input CONTROL-PLANE-POLICY
7οΈβ£ Interface Hardening
πΉ Shut Unused Interfaces
interface range g0/2 - 4
shutdown
πΉ Disable CDP on Untrusted Interfaces
no cdp enable
πΉ Enable Port Security (Switch)
interface g1/0/5
switchport mode access
switchport port-security
switchport port-security maximum 1
switchport port-security violation restrict
switchport port-security mac-address sticky
8οΈβ£ Layer-2 Security (Switches)
ip dhcp snooping
ip dhcp snooping vlan 10
ip arp inspection vlan 10
spanning-tree portfast default
spanning-tree bpduguard default
9οΈβ£ Routing Protocol Security
πΉ OSPF Authentication
interface g0/1
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 OSPFkey
πΉ BGP Security
- Use TTL security
- Use MD5 authentication
- Prefix filtering
π Logging, Time & Monitoring
πΉ Enable Logging
logging buffered 64000
logging host 192.168.10.50
πΉ Use NTP with Authentication
ntp authenticate
ntp authentication-key 1 md5 NTPkey
ntp trusted-key 1
ntp server 192.168.10.1 key 1
1οΈβ£1οΈβ£ IOS & Configuration Protection
πΉ Secure Configuration Files
service config
archive
path flash:backup
write-memory
πΉ Disable Password Recovery (Physical Security)
no service password-recovery
β οΈ Use carefully (lab vs production)
1οΈβ£2οΈβ£ Firmware & Patch Management
β Keep IOS updated
β Remove unused images
β Verify image integrity (MD5/SHA)
verify /md5 flash:image.bin
1οΈβ£3οΈβ£ Best Practice Summary Checklist
β
SSH v2 only
β
AAA + TACACS+/RADIUS
β
Strong passwords & secrets
β
ACL-restricted management
β
SNMPv3 only
β
Disable unused services
β
Interface & L2 security
β
Logging + NTP
β
Regular backups
π§ CCNA / CCNP / Interview Focus
- Difference between Control Plane / Data Plane / Management Plane
- Why CoPP is important
- SSH vs Telnet risks
- SNMPv3 vs v2c
Leave a comment