Showcase: Using the IOS® CLI
Cisco IOS® command line interface (CLI) is quite flexible and allows you to enter complex configurations elegantly with only a few configuration lines. For historical and other reasons, however, it has some flaws for the more experienced user. Its original intension appears to try to keep users from entering configuration lines before they think, which makes sense. Assume we want to remove a secondary ip address definition on an Ethernet interface. Now we type:
$ telnet router
Username: admin
Password: secret
router>
Now we arrived at the first prompt. We can't do much. Now we have to proceed to the privileged level by:
router> enable
Password: secret
All right, now we see another prompt:
router#
Having arrived at this point, we usually do a "show running-config". Thanks to the command line abbreviation and completion functionality, typing isn't so hard. So we keep on typing the TAB key until it beeps or remember working abbreviations, such as "sh run". At some point, we enter the configuration mode to get to another prompt by:
router# configure terminal
router(config)#
As we did a "show running" before, we figured out what the interface number of our target interface is, maybe we have to scroll a bit back with our terminal emulation. Okay, the interface of choice was "Ethernet 1" because we've seen this configuration fragment in our (possibly quite longish) output:
interface Ethernet 0
ip address 10.1.2.1 255.255.255.0
ip address 10.1.2.3 255.255.255.0 secondary
Now, we enter the context of that interface:
router(config)# interface Ethernet 1
router(config-if)#
So, after having arrived at the 4th prompt now, we can now the secondary ip-address (as long as we remember what it was we wanted to do in the first place):
router(config-if)# no ip address 10.1.2.3 255.255.255.0 secondary
It is important to note that completion does not work for parameters such as ip-addresses or netmasks. We have to type in the entire line (or, of course, use our terminal emulation, scroll back, copy the entire line in our paste buffer, just type in "no" and then paste the line with the terminal emulation. Usually we would type TAB and ? several times during the whole process, causing help facility output to scroll the context way up, making it hard to scroll back to our configuration output. Finally, we want to check if everything is all right. We now have the convenience to press "CTRL-Z" and break back to levels, right back to our EXEC mode prompt:
router#
Now, we enter something like "show interface Ethernet 1" or "show running-config" again. Assume we like what we see, the router does not yet have the configuration saved in its non-volatile memory. To do so, we type the command:
router# write
Wer'e done. We entered our username and passwords
and had to type about 7 commands so far. We also scanned the output
of the router's configuration file.
>> continue: same example using Telconi Terminal
>> back
|