(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