Running config question

Bl8ckr0uterBl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
Happy Black Friday:

So I was looking in my running config for something (can't remember) and a question popped into my head: For each one of the exclamation points, is there a specific line of output that maps to the location, and if so, can you remove those exclamation points if you do not have the configuration enable/set up that maps to that location? I google this but I guess It either doesn't exist or I am not wording my question correctly.


Thanks,

Comments

  • miller811miller811 Member Posts: 897
    knwminus wrote: »
    Happy Black Friday:

    So I was looking in my running config for something (can't remember) and a question popped into my head: For each one of the exclamation points, is there a specific line of output that maps to the location, and if so, can you remove those exclamation points if you do not have the configuration enable/set up that maps to that location? I google this but I guess It either doesn't exist or I am not wording my question correctly.


    Thanks,

    Not sure about that but on a different note, learned this yesterday

    Router#show run linenum
    Building configuration...

    Current configuration : 689 bytes
    1 : !
    2 : version 12.4
    3 : service timestamps debug datetime msec
    4 : service timestamps log datetime msec
    5 : no service password-encryption
    6 : !
    7 : hostname Router
    8 : !
    9 : boot-start-marker
    10 : boot-end-marker
    11 : !
    12 : !
    13 : no aaa new-model
    14 : memory-size iomem 5
    15 : !
    16 : !
    17 : ip cef
    18 : !
    19 : !
    20 : !
    21 : !
    --More--

    Allows you to work with a remote user to find exact portion of the config, or allows you to look at a changed config easier.


    and also this one, so it scrolls off the screen for easy copy, instead of page breaks....

    Router#terminal length 0
    Router#show run
    Building configuration...

    Current configuration : 713 bytes
    !
    version 12.4
    service timestamps debug datetime ms
    service timestamps log datetime msec
    no service password-encryption
    service compress-config
    !
    hostname Router
    !
    boot-start-marker
    boot-end-marker
    !
    !
    no aaa new-model
    memory-size iomem 5
    !
    !
    ip cef
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    interface Serial0/0
    no ip address
    shutdown
    serial restart-delay 0
    !
    interface Serial0/1
    no ip address
    shutdown
    serial restart-delay 0
    !
    interface Serial0/2
    no ip address
    shutdown
    serial restart-delay 0
    !
    interface Serial0/3
    no ip address
    shutdown
    serial restart-delay 0
    !
    ip http server
    no ip http secure-server
    !
    !
    !
    !
    !
    !
    control-plane
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    line con 0
    line aux 0
    line vty 0 4
    !
    !
    end

    Router#
    I don't claim to be an expert, but I sure would like to become one someday.

    Quest for 11K pages read in 2011
    Page Count total to date - 1283
  • Bl8ckr0uterBl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
    miller811 wrote: »
    Not sure about that but on a different note, learned this yesterday

    Router#show run linenum
    Building configuration...

    Current configuration : 689 bytes
    1 : !
    2 : version 12.4
    3 : service timestamps debug datetime msec
    4 : service timestamps log datetime msec
    5 : no service password-encryption
    6 : !
    7 : hostname Router
    8 : !
    9 : boot-start-marker
    10 : boot-end-marker
    11 : !
    12 : !
    13 : no aaa new-model
    14 : memory-size iomem 5
    15 : !
    16 : !
    17 : ip cef
    18 : !
    19 : !
    20 : !
    21 : !
    --More--

    This is good. Look at lines 1,6,8,11-12,15-16, and 18-21. Is there a way to know what exactly matches up to the position? Like you see how line 2 says version 12.4, I assuming in most ios' there is a line of code that says Display version number at position (or line ) 2. I want to know like if there is away to limit what you see to only the lines with information on them. Like if I have nothing on positions (or lines) 18-21 why should I have to see them? Can't I just cut them out of view?

    I also want to know what positions (or lines) line up with what displayed stat or configuration item.

    Take a look at my running config
    Trinity(config)#do sh run
    Building configuration...
    
    Current configuration : 982 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname Trinity
    !
    boot-start-marker
    boot-end-marker
    !
    enable secret 5 $1$lzxt$oBc51zTPq1wwCiljbr3y4.
    !
    no aaa new-model
    ip cef
    !
    !
    !
    !
    ip domain name Nospoon.com
    login on-success log
    !         
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    ip ssh time-out 74
    ip ssh authentication-retries 2
    ! 
    !
    !
    !
    !         
    interface Loopback1
     ip address 5.5.5.5 255.255.255.255
    !
    interface FastEthernet0
     no ip address
     shutdown
     speed auto
    !
    interface Serial0
     description connection to the Matrix
     ip address 192.168.1.2 255.255.255.252
     shutdown
     no fair-queue
    !
    !
    !
    no ip http server
    no ip http secure-server
    !
    !
    !
    !
    control-plane
    !
    !
    !
    !
    !
    !
    !
    !
    banner motd ^C This is a white rabbit. Second only to him. Strong. fierce. Love. ^C
    !
    line con 0
     logging synchronous
     terminal-type monitor
    line aux 0
    line vty 0 4
     logging synchronous
     login
     terminal-type monitor
     transport input telnet ssh
    !
    end
              
    Trinity(config)#do sh run linenum
    Building configuration...
    
    Current configuration : 982 bytes
         1 : !
         2 : version 12.4
         3 : service timestamps debug datetime msec
         4 : service timestamps log datetime msec
         5 : no service password-encryption
         6 : !
         7 : hostname Trinity
         8 : !
         9 : boot-start-marker
        10 : boot-end-marker
        11 : !
        12 : enable secret 5 $1$lzxt$oBc51zTPq1wwCiljbr3y4.
        13 : !
        14 : no aaa new-model
        15 : ip cef
        16 : !
        17 : !
        18 : !
        19 : !
        20 : ip domain name Nospoon.com
        21 : login on-success log
        22 : !
        23 : !
        24 : !
        25 : !
        26 : !
        27 : !
        28 : !
        29 : !
        30 : !
        31 : !
        32 : !
        33 : !
        34 : !
        35 : !
        36 : !
        37 : !
        38 : !
        39 : ip ssh time-out 74
        40 : ip ssh authentication-retries 2
        41 : ! 
        42 : !
        43 : !
        44 : !
        45 : !
        46 : interface Loopback1
        47 :  ip address 5.5.5.5 255.255.255.255
        48 : !
        49 : interface FastEthernet0
        50 :  no ip address
        51 :  shutdown
        52 :  speed auto
        53 : !
        54 : interface Serial0
        55 :  description connection to the Matrix
        56 :  ip address 192.168.1.2 255.255.255.252
        57 :  shutdown
        58 :  no fair-queue
        59 : !
        60 : !
        61 : !
        62 : no ip http server
        63 : no ip http secure-server
        64 : !
        65 : !
        66 : !
        67 : !
        68 : control-plane
        69 : !
        70 : !
        71 : !
        72 : !
        73 : !
        74 : !
        75 : !
        76 : !
        77 : banner motd ^C This is a white rabbit. Second only to him. Strong. fierce. Love. ^C
        78 : !
        79 : line con 0
        80 :  logging synchronous
        81 :  terminal-type monitor
        82 : line aux 0
        83 : line vty 0 4
        84 :  logging synchronous
        85 :  login
        86 :  terminal-type monitor
        87 :  transport input telnet ssh
        88 : !
        89 : end
    
    There are a large amount of lines that are just blank I would like to know what fills them.

    Also something interesting to note about that command is that it only numbers the stuff after "current configuration". Interesting.
    IDK maybe I am not making sense, I have been listening to dethklok all morning lol.
  • kryollakryolla Member Posts: 785
    you can also look at the default values when doing a sh run but I forgot the exact command
    Studying for CCIE and drinking Home Brew
  • kryollakryolla Member Posts: 785
    why do you want to get rid of exclamation point and no it doesn't map to another location.
    Studying for CCIE and drinking Home Brew
  • tim100tim100 Member Posts: 162
    kryolla wrote: »
    you can also look at the default values when doing a sh run but I forgot the exact command


    sh run all
  • Bl8ckr0uterBl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
    kryolla wrote: »
    why do you want to get rid of exclamation point and no it doesn't map to another location.

    Cuz I have a tiny screen Im working on. And what do you mean they don't map to another location?
  • kryollakryolla Member Posts: 785
    knwminus wrote: »
    Cuz I have a tiny screen Im working on. And what do you mean they don't map to another location?

    all the config file is a text file that gets submitted to the parser so the parser can input it all during boot up and when you enter config mode. If you have a tiny screen why are you looking at the whole config why not just grep only the stuff you need
    Studying for CCIE and drinking Home Brew
  • ColbyGColbyG Member Posts: 1,264
    If you don't want to see the lines with !, just do "sh run | exc !". Am I understanding you right?
  • miller811miller811 Member Posts: 897
    ColbyNA wrote: »
    If you don't want to see the lines with !, just do "sh run | exc !". Am I understanding you right?

    you da man.....icon_cheers.gif
    I don't claim to be an expert, but I sure would like to become one someday.

    Quest for 11K pages read in 2011
    Page Count total to date - 1283
  • Bl8ckr0uterBl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
    ColbyNA wrote: »
    If you don't want to see the lines with !, just do "sh run | exc !". Am I understanding you right?

    If I could give you rep, I would. That is EXACTLY what I meant.
    Dead on. I knew it had to be some kind of pipe modifier but I don't think I would have found it anytime soon.

    When I log in to my router, I am going to set that command to run using the autocommand command. Awesome. Awesome. Awesome.

    kryolla wrote: »
    all the config file is a text file that gets submitted to the parser so the parser can input it all during boot up and when you enter config mode. If you have a tiny screen why are you looking at the whole config why not just grep only the stuff you need


    At the time I was looking at several things and rather than just run several commands, I needed to see the whole running config.
  • chrisonechrisone Member Posts: 2,278 ■■■■■■■■■□
    wow thanks for the very useful command, "linenum"


    you learn something new everyday icon_smile.gif
    Certs: CISSP, EnCE, OSCP, CRTP, eCTHPv2, eCPPT, eCIR, LFCS, CEH, SPLK-1002, SC-200, SC-300, AZ-900, AZ-500, VHL:Advanced+
    2023 Cert Goals: SC-100, eCPTX
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    Here's a few more useful show commands, which I'm sure some folks already know about and have been posted here at one time or another, but which I'm sure won't hurt as a reminder -


    show run int <interface number>
    ex, sh run int fa0/1
    interface FastEthernet0/1
    ip address 192.168.1.1 255.255.255.0
    ip virtual-reassembly
    ip route-cache flow
    duplex auto
    speed auto
    end

    Allows you to see just the configuration for a relevant interface


    show interface description

    Shows the configured descriptions of all interfaces

    dorne#sh int description
    Interface Status Protocol Description
    Fa0/0 up up Vlan2 Gateway
    Se0/0 down down LabUplink
    Fa0/1 up up Vlan3 Gateway
    Fa1/0 up up ComcastUplink


    And of course, these can be combined with the include and exclude pipes. For example, on our aggregate switches.. they take 45 switches each, and ofttimes the only thing I know is the name of the access layer switch. So if I need to add a vlan to a trunk for an access switch, and I know the name of the access switch, I could do the following -

    sh int description | include access01 (where access01 would be the name of the switch in the description)

    agg2.atl#sh int description | include access023
    GigabitEthernet 0/23 YES up up access023.atl:6.3.9


    That would tell me which port I need to edit to add the vlan to the trunk
  • ColbyGColbyG Member Posts: 1,264
    Don't forget the "section" pipe, "sh run | sec", to just view a section of the command. Like "sh run | sec crypto map".

    sh run | sec is awesome
  • Bl8ckr0uterBl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
    dorne#sh int description
    Interface Status Protocol Description
    Fa0/0 up up Vlan2 Gateway
    Se0/0 down down LabUplink
    Fa0/1 up up Vlan3 Gateway
    Fa1/0 up up ComcastUplink

    I use this command everyday to find the names of ints that relate to various tunnels. I do that so I can find the physical port that the tunnel rides on, if the log file is to big of a pain to parse through. I also use it to find cids so I can call provides and let em know whats up.
Sign In or Register to comment.