CCNA - The Almighty CLI
As you can guess from the title, I’ve been dabbling into the world of the Cisco CLI. As a Linux user, I’m familiar with the idea of a CLI, and I’ve been looking forward to playing around with some configurations in CLI.
I just finished the basics chapter so I’ve not done any crazy commands. Mostly I’ve been moving around in different modes such as enable
mode, global configuration mode
, and interface configuration mode
. Anytime you first login to a Cisco Router or Switch, you’re dumped into user mode, which is shown by the >
in the prompt. I’ll throw a screenshot below to show exactly what I mean. The enable
command gets you into a privileged mode to execute commands rather than just look at things in user mode. Once you’re in enable mode, the prompt turns to a #
. It’s like on linux when you enter a root shell and see that pound sign. It’s a warning to be careful about what you type. The screenshot is from Cisco Packet Tracer on a simulated 2901 router, so forgive me that it’s not the typical black background with white text. I may try to see if I can get a switch from some of the networking guys at work.
One of the things I love about Linux is how simple and powerful the terminal is, and using the Cisco CLI feels a lot like that. I’m sure there are fancier and more robust web consoles and the like for Cisco equipment these days, but as for me I always like a good old fashioned CLI. Here’s the simple command breakdown.
First I enter enable mode by typeing enable
, then I enter into global configuration mode with configure terminal
, from here I can enter into subcommand modes, but first I change the hostname of the router with the command hostname alex
. The next command, interface GigabitEthernet 0/0
, enters into the subcommand mode for interfaces, and more specifically enters into the configuration mode for the gigabitethernet 0/0 interface, and the next command, duplex half
sets the duplex to half so data can only be sent or received at any given time, it cannot happen at the same time. I use the exit
command to get back into global config mode, and the enable password secret
command sets a password for the router. After that, the end
command gets me back to enable mode. Finally I copy all the changes I made to the startup-config by typing copy running-config startup-config
. This makes sure that when the router restarts all my changes will persist. The running config is held in RAM while the startup-config is held in NVRAM. When the router reboots, it loads the startup-config into RAM.