Topology
Purpose
Learn some basic steps to take to lock down your router.
Walkthrough
- Log in using Protect Enable mode with an enable secret password. Test this by logging out of Privileged mode and then logging back in.
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#enable secret cisco
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#exi
Router con0 is now available
Press RETURN to get started.
Router>en
Password:
Router#
- Set an enable password and then add service password encryption. This is rarely done on live routers because it is not secure.
Router(config)#no enable secret
Router(config)#enable password cisco
Router(config)#service pass
Router(config)#service password-encryption
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#show run
Building configuration…
Current configuration: 480 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
service password-encryption
!
hostname Router
!
enable password 7 0822455D0A16
- Protect the Telnet lines. Set a local username and password and have users enter this when connecting to the router.
Router(config)#line vty 0 ?
<1-15> Last Line number
<cr>
Router(config)#line vty 0 15
Router(config-line)#login local
Router(config-line)#exit
Router(config)#username in60days password cisco
Router(config)#
You have tested Telnet before, but feel free to add a PC and Telnet into the router so you are prompted for a username and password.
- Protect the console port with a password. Set one directly on the console port.
Router(config)#line console 0
Router(config-line)#password cisco
You can test this by unplugging and plugging your console lead back into the router. You can also protect the auxiliary port on your router if you have one:
Router(config)#line aux 0
Router(config-line)#password cisco
- Protect the Telnet lines by permitting only SSH traffic in. You can also permit only SSH traffic outbound. You will need a security image for this command to work.
Router(config)#line vty 0 15
Router(config-line)#transport input ssh
Router(config-line)#transport output ssh
- Add a banner message of the day (MOTD). Set the character which tells the router you have finished your message as “X” (the delimiting character).
Router(config)#banner motd X
Enter TEXT message. End with the character ‘X’.
Do not use this router without authorization. X
Router(config)#
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console
Exit
Router con0 is now available
Press RETURN to get started.
Do not use this router without authorization.
Router>
- Turn off CDP on the entire router. You could disable it on an interface only with the no cdp enable interface command.
Router(config)#no cdp run
You can test whether this is working by connecting a switch or router to your router before you turn off CDP and issuing the show cdp neighbor (detail) command.
- Set the router to send logging messages to a host on the network.
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#logging ?
A.B.C.D IP address of the logging host
buffered Set buffered logging parameters
console Set console logging parameters
host Set syslog server IP address and parameters
on Enable logging to all enabled destinations
trap Set syslog server logging level
userinfo Enable logging of user info on privileged mode enabling
Router(config)#logging 10.1.1.1
