Organize Your Configuration
You ever wished you could have your config organized in manner where it was structured for easy troubleshooting and identification? or maybe you have been working with TAC late at night and they tell you find the configuration line that starts with ‘XYZ’ and this configuration just happens to use up a third of Sherwood Forrest when printed and you have to issue the ‘ole trusty ’find’ feature in your word processing editor and thought to yourself there has to be an easier way? Well there is, next time you want an easy way to identify certain lines in your config issue the ’show running-config linenum’ command and your configuration will be organized for easy identification via the router with no work on your part. Here is a sample:
CCIE6200-1841#sh run linenum
Load for five secs: 2%/0%; one minute: 2%; five minutes: 1%
Time source is NTP, 16:35:41.093 CDT Mon May 12 2008
Building configuration…
Current configuration : 7102 bytes
1 : !
2 : version 12.4
3 : no service pad
4 : service tcp-keepalives-in
5 : service tcp-keepalives-out
6 : service timestamps debug datetime msec localtime show-timezone
7 : service timestamps log datetime msec localtime show-timezone
8 : service password-encryption
9 : service internal
10 : service sequence-numbers
11 : !
12 : hostname CCIE6200-1841
13 : !
14 : boot-start-marker
15 : boot system flash:c1841-advipservicesk9-mz.124-11.T1.bin
16 : boot-end-marker
17 : !
18 : security authentication failure rate 3 log
19 : security passwords min-length 6
20 : logging buffered 4096
21 : !
22 : no aaa new-model
23 : clock timezone CST -6
24 : clock summer-time CDT recurring
25 : no ip source-route
26 : no ip gratuitous-arps
27 : ip spd mode aggressive
28 : ip cef
29 : !
30 : !
31 : no ip dhcp use vrf connected
32 : !
33 : ip dhcp pool IP-ADD
34 : network 192.168.1.0 255.255.255.0
35 : dns-server 24.93.41.125 24.93.41.126
36 : domain-name CCIE6200
37 : default-router 192.168.1.1
38 : lease 14
39 : !

Comment by josh horton
on 13 May 2008:
Great article. I always forget to use line numbers.
Comment by Vaoneiler
on 20 May 2008:
Thanks for sharing this command. I guess this has to be used in more recent code:
I tried it these and it worked
Cisco 2650 - Version 12.3(4)T4
Cisco AP 1231 - Version 12.3(2)JA3
However when I tried this on the following devices it didn’t work.
Cisco 3750 - Version 12.2(25r)SEC
Cisco 6509 - Version 12.1(20)E
Cisco 2950 - Version 12.1(20)EA1
Cisco 3560 - Version 12.2(20)SE3
Comment by Joe Harris
on 20 May 2008:
Hi Vaoneiler,
Yes the linenum keyword was added in 12.2(4)T for IOS based devices (http://www.cisco.com/en/US/docs/ios/fundamentals/command/reference/cf_s2.html#wp1235308) however for DSBU (Desktop Switching Business Unit) based switches the command is not available but there a few Engineering based images that do in fact have the command available…I know a 3560 image of advanced IP services 12.2(40)SE does not have the linenum option available. For the 6500 you will need a 12.2 based image and not a 12.1 based image.