Basic Router and Switch Hardening

Nerd Cafe | نرد کافه

Objective

Implement essential security hardening on Cisco routers and switches to protect the network infrastructure from unauthorized access, mitigate basic attacks, and adhere to CIS Benchmark recommendations.

Topology

IP Addressing

Device
Interface
IP Address
Subnet

Router1

Fa0/0

192.168.1.1

255.255.255.0

Switch1

VLAN1

192.168.1.2

255.255.255.0

PC1

NIC

192.168.1.10

255.255.255.0

PC2

NIC

192.168.1.11

255.255.255.0

PC3

NIC

192.168.1.20

255.255.255.0

PC4

NIC

192.168.1.21

255.255.255.0

Practical Scenario

You are a network administrator tasked to secure a small branch office network. You must implement security best practices on the router and switch to prevent unauthorized access, ensure safe management, and mitigate attacks like ARP spoofing and IP spoofing.

The goal is to:

  1. Secure device access (console, VTY, and enable passwords).

  2. Disable unused services and interfaces.

  3. Protect against common Layer 2 attacks.

  4. Log all security-related events.

  5. Apply Cisco CIS Benchmark recommendations for basic hardening.

Step 1: Secure Device Access

Router1

  • Secure console access

  • Secure VTY access

  • Set the encrypted enable password for privileged exec mode

  • Encrypt all plaintext passwords in the configuration

  • Set the hostname of the device

Switch1

Do the same for switch.

circle-info

CIS Benchmark: Disable insecure protocols (like Telnet) and enable encrypted passwords.

Step 2: Configure SSH for Secure Management

  • Set the domain name for the router, required for generating RSA keys for SSH

  • Generate RSA key for SSH

  • Create a local user account with full administrative privileges (level 15) and store the password as a hashed secret for secure SSH authentication

  • Apply SSH version 2

Step 3: Disable Unused Services and Interfaces

  • Disable unused router services

  • Shutdown unused router interfaces

  • Shutdown unused switch interfaces

circle-info

CIS Benchmark: Disable unnecessary services to reduce attack surface.

Step 4: Implement Layer 2 Security on Switch

  • Disable unused ports and assign them to an unused VLAN

  • Enable port security

  • Disable DTP to prevent VLAN hopping

Step 5: Enable Logging and Monitoring

  • Enable local logging and store log messages in the device buffer (4 KB size)

  • "informational" level includes severity 6 and more critical messages (0–6)

  • Add date, time, and millisecond precision timestamps to log messages

  • Improves forensic analysis and troubleshooting accuracy

Step 6: Configure Router ACLs for Basic Protection

  • Prevent private (RFC1918) addresses from entering from the Internet

  • Block internal network addresses coming from WAN

  • Block other RFC1918 ranges

  • Permit all other traffic

  • Apply it on WAN:

circle-info

CIS Benchmark: Use ACLs to prevent spoofed traffic.

Step 7: Save Configuration

💖 Support Our Work

If you find this post helpful and would like to support my work, you can send a donation via TRC-20 (USDT). Your contributions help us keep creating and sharing more valuable content.

circle-check

Thank you for your generosity! 🙏

Keywords

Router hardening, Switch hardening, Cisco IOS security, CCNA Security, CIS Benchmark, SSH configuration, Port security, Access control list, Extended ACL, Anti-spoofing, uRPF, Disable unused services, Secure management, Logging configuration, Password encryption, Enable secret, VTY security, DTP disable, VLAN security, Network device protection, nerd cafe , نرد کافه

Channel Overview

🌐 Website: www.nerd-cafe.irarrow-up-right

📺 YouTube: @nerd-cafearrow-up-right

🎥 Aparat: nerd_cafearrow-up-right

📌 Pinterest: nerd_cafearrow-up-right

📱 Telegram: @nerd_cafearrow-up-right

📝 Blog: Nerd Café on Virgoolarrow-up-right

💻 GitHub: nerd-cafearrow-up-right

Last updated