Command
Do
Use
Allows you to access privilege level commands while in configuration modes.
Syntax
Router(config)#do <command>
Example
In the below example, the router’s IP information is verified while configuring OSPF
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router ospf 1 R2(config-router)#do sh ip int br | ex unass |
Interface IP-Address OK? Method Status Protocol FastEthernet1/0.24 150.1.24.2 YES NVRAM up up FastEthernet1/0.42 150.1.42.2 YES NVRAM up up Loopback0 200.0.0.1 YES NVRAM up up Loopback24 150.1.124.2 YES NVRAM up up Loopback42 150.1.142.2 YES NVRAM up up |
R2(config-router)# R2(config-router)#network 150.1.24.2 0.0.0.0 area 24 R2(config-router)#do sh ip route |
Codes: C – connected, S – static, R – RIP, M – mobile, B – BGP Gateway of last resort is not set 200.0.0.0/32 is subnetted, 1 subnets |
Instead of using the do command, we would have had to do the following.
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router ospf 1 R2(config-router)#end R2# R2#sh ip int br | ex unass |
Interface IP-Address OK? Method Status Protocol FastEthernet1/0.24 150.1.24.2 YES NVRAM up up FastEthernet1/0.42 150.1.42.2 YES NVRAM up up Loopback0 200.0.0.1 YES NVRAM up up Loopback24 150.1.124.2 YES NVRAM up up Loopback42 150.1.142.2 YES NVRAM up up |
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router ospf 1 R2(config-router)#network 150.1.24.2 0.0.0.0 area 24 |
Obviously this is not the most efficient method. The Do command will become one of your most used and valued command!!!