Talking to a router
A router has no screen. You manage it through its command line, usually over a console cable when it is new, and later over the network with SSH. The command line has modes. Each mode allows different commands, and the prompt tells you where you are:
| Prompt | Mode | What you can do | How you get there |
|---|---|---|---|
Router> | User EXEC | Look at a few things (ping, some show commands) | You start here |
Router# | Privileged EXEC | See everything, save, reload, run all show commands | enable |
Router(config)# | Global configuration | Change settings for the whole device | configure terminal |
Router(config-if)# | Interface configuration | Change one port | interface g0/0 |
Router(config-line)# | Line configuration | Change the console or remote-login lines | line console 0 |
Moving between modes
In NetLab
▶ R1 Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R1 R1(config)#interface g0/0 R1(config-if)#description Link to the office LAN R1(config-if)#exit R1(config)#end *Mar 1 00:00:07.000: %SYS-5-CONFIG_I: Configured from console by console R1#disable
enabletakes you up to privileged mode;disabletakes you back down.configure terminal(people typeconf t) enters global configuration.exitgoes back one level;end(or Ctrl+Z) jumps straight back to privileged mode.- A change happens the moment you press Enter:
hostname R1changed the prompt at once.
When you leave configuration mode, the router logs %SYS-5-CONFIG_I: a note that the configuration was changed from the console.
Running a show command from configuration mode
show commands belong to privileged mode. While you are configuring, put do in front to run one without leaving:
In NetLab
▶ R1 Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#do show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 unassigned YES unset administratively down down GigabitEthernet0/1 unassigned YES unset administratively down down GigabitEthernet0/2 unassigned YES unset administratively down down
Common mistake: Typing
show running-configinside(config)#withoutdogives an error. Either adddo, or go back withendfirst.