Cyber Services / All lessons / Diploma in Network Technology / Securing Network Devices

Securing Network Devices

Module 27 of 36 · 3 min read · Free to read

MODULES ↓ Command blocks have a COPY button

Your Gateway to a Career in Network Engineering

Module 6: Securing Network Devices

A network is only as secure as its weakest link. If your routers and switches—the very core of your infrastructure—are not properly secured, then all the firewalls in the world won't protect you. **Device hardening** is the process of securing these devices against unauthorized access. This guide covers the three pillars of device security: local passwords, secure remote management, and centralized authentication.

The Foundation: Physical Security

Before any software configuration, security begins with controlling physical access. If an attacker can walk up and plug a console cable into your core router, they can bypass most other security measures.

  • Network devices should be kept in locked rooms, server closets, or data centers with controlled access.
  • Unused switch ports in public areas (like conference rooms) should be administratively disabled.

1. Passwords: The First Line of Defense

Effective password security on a Cisco device involves setting strong, encrypted passwords for the three main access levels.

! --- Best Practice Password Configuration ---
Router# configure terminal

! 1. Secure Privileged EXEC Mode (highest privilege)
! Use 'secret' because it is always strongly encrypted (hashed).
Router(config)# enable secret YourStrongP@ssw0rd!

! Obscure all other passwords in the configuration file.
Router(config)# service password-encryption

! 2. Secure Console Access (physical connection)
Router(config)# line console 0
Router(config-line)# password YourConsolePassword
Router(config-line)# login

! 3. Secure Remote Access (SSH/Telnet lines)
Router(config-line)# line vty 0 15
Router(config-line)# password YourRemotePassword
Router(config-line)# login
Router(config-line)# end

2. Secure Management: Enabling SSH

**Telnet is insecure** because it sends all data, including passwords, in plain text. An attacker could easily "sniff" the traffic and steal credentials. **SSH (Secure Shell)** is the modern standard that encrypts the entire management session, protecting it from eavesdropping.

Step-by-Step SSH Configuration

To enable SSH, you must set a hostname and domain, generate encryption keys, and configure the VTY lines to use SSH exclusively.

Router# configure terminal

! STEP 1: Set a Hostname and Domain Name
Router(config)# hostname R1-Office
R1-Office(config)# ip domain-name mubashercyber.com

! STEP 2: Generate RSA Crypto Keys for encryption
R1-Office(config)# crypto key generate rsa
How many bits in the modulus [512]: 2048  (Best practice is 2048 or higher)
... [OK]

! STEP 3: Create a local user for SSH authentication
R1-Office(config)# username admin privilege 15 secret YourAdminPassword

! STEP 4: Configure VTY lines to ONLY accept SSH and use local users
R1-Office(config)# line vty 0 15
R1-Office(config-line)# transport input ssh
R1-Office(config-line)# login local
R1-Office(config-line)# end

3. AAA: The Enterprise Security Framework

In a large network, managing local user accounts on every device is unmanageable. The enterprise solution is **AAA (Authentication, Authorization, and Accounting)**, which centralizes control on a dedicated server.

Analogy: AAA as a Building's Security System

  • Authentication: "Who are you?" - Swiping your ID card at the front door to prove your identity.
  • Authorization: "What are you allowed to do?" - The system checking if your ID allows you into the server room or just the main office floor.
  • Accounting: "What did you do?" - The system logging the time you entered and exited the server room, creating an audit trail.

AAA Protocols: RADIUS vs. TACACS+

AAA is implemented using protocols that allow network devices to communicate with the central server. The two main protocols are RADIUS and TACACS+.

FeatureRADIUS (Remote Authentication Dial-In User Service)TACACS+ (Terminal Access Controller Access-Control System Plus)
CreatorIETF Standard (Open)Cisco Proprietary
TransportUDPTCP (More reliable)
EncryptionEncrypts only the password.Encrypts the entire packet body.
AAA SeparationCombines Authentication and Authorization.Separates all three AAA functions for more granular control.
Best Use CaseNetwork Access (e.g., Wi-Fi, VPN users)Device Administration (Managing who can log into routers/switches)
Modules (36) ← Diploma in Network Technology