9 Replies Latest reply: Oct 11, 2017 6:49 AM by Sean RSS

    Leave a comment in running-config

    Nima

      Hi all,

       

      is there anyway to leave a comment that appears in the output of show running-config? For example if you want to explain "why did you choose that IP address for that interface" or "this is the same vlan as SWxx". . .

       

      Thanks in advanced.

        • 1. Re: Leave a comment in running-config
          Adam Loveless

          There are no comment options in the running-config/startup-config outside of using "description <text>" on an interface or the "access-list remark <text>" command in an access-list. That is all that I am aware of.

          • 2. Re: Leave a comment in running-config
            alib_15

            Comments do not show in the output of show startup-config.

             

            "You can add comments to a configuration file describing the commands you have entered. Precede a comment with an exclamation point (!). Because comments are not stored in NVRAM or in the active copy of the configuration file, comments do not appear when you list the active configuration with the show running-config or more system:running-config EXEC command. Comments do not display when you list the startup configuration with the show startup-config or more nvram:startup-config EXEC mode command. Comments are stripped out of the configuration file when it is loaded onto the router. However, you can list the comments in configuration files stored on a File Transfer Protocol (FTP), remote copy protocol (rcp), or Trivial File Transfer Protocol (TFTP) server".

             

            Source: http://www.cisco.com/c/en/us/td/docs/ios/12_2/configfun/configuration/guide/ffun_c/fcf007.html

            • 3. Re: Leave a comment in running-config
              infotek

              I would like to point out that the characters that can be used to comment inline in achived or example configs are "!#:;".  As mentioned previously, these comments are not preserved after a 'write mem'... But, they will not destroy your configuration script if pasted into a configuration prompt.

               

              exclamation mark

              number sign, pound, hash, octothorpe
              colon

              semicolon

              • 4. Re: Leave a comment in running-config
                Tony

                Try the banner motd command

                 

                config)#banner motd 'Hi there'

                 

                Shows up in running config and is saved to startup config when you reboot or login its the first thing you'll see.

                 

                Cheers

                • 5. Re: Leave a comment in running-config
                  Joshua

                  You can't leave a comment directly in the running-config, but you can absolutely leave a "description" on interfaces that can be seen in the running-config.

                   

                  Here is a copy of my output from a Catalyst 3550(Abridged):

                  ______________________________________________________________________________________________

                  SW-4#conf t

                  Enter configuration commands, one per line.  End with CNTL/Z.

                  SW-4(config)#int vlan 100

                  SW-4(config-if)#?

                  Interface configuration commands:

                    access-expression       Build a bridge boolean access expression

                    arp                     Set arp type (arpa, probe, snap) or timeout

                    bandwidth               Set bandwidth informational parameter

                    bgp-policy              Apply policy propogated by bgp community string

                    bridge-group            Transparent bridging interface parameters

                    carrier-delay           Specify delay for interface transitions

                    cdp                     CDP interface subcommands

                    crypto                  Encryption/Decryption commands

                    custom-queue-list       Assign a custom queue list to an interface

                    dampening               Enable event dampening

                    default                 Set a command to its defaults

                    delay                   Specify interface throughput delay

                    description             Interface specific description

                   

                  SW-4(config-if)#

                  SW-4(config-if)#description ?

                    LINE  Up to 240 characters describing this interface

                   

                  SW-4(config-if)#description VLAN used to connect all servers.

                   

                   

                  SW-4(config-if)#do show run

                  Building configuration...

                  !

                  interface Vlan100

                  description VLAN used to connect all servers.

                  ip address 100.0.0.1 255.255.255.0

                  _________________________________________________________________________________________________

                  Hope this is helpful.

                   

                  Josh

                  • 6. Re: Leave a comment in running-config
                    infotek

                    Interface descriptions are often used for monitoring systems, a sort of self documenting.

                     

                    Port Description Parser - LibreNMS Docs

                    • 7. Re: Leave a comment in running-config
                      Juergen Ilse CCNA R&S

                      infotek schrieb:

                       

                      I would like to point out that the characters that can be used to comment inline in achived or example configs are "!#:;".  As mentioned previously, these comments are not preserved after a 'write mem'... But, they will not destroy your configuration script if pasted into a configuration prompt.

                       

                      exclamation mark

                      number sign, pound, hash, octothorpe
                      colon

                      semicolon

                      Each line, that begins with "!" in a cisco configuration file will be seen as comment. It is not necessary to begin the line with "!#" to let this line be a comment, "!" only (even without the following "#") will make the line a comment. It was also said, that comment line will be filtered out when loading the configuration file on the device.

                      • 8. Re: Leave a comment in running-config
                        MartinG

                        Nice Idea! Thank you!

                        • 9. Re: Leave a comment in running-config
                          Sean

                          Remember you can also use "name" on a static route to give other engineers a clue when troubleshooting.

                          Example:

                          ip route 0.0.0.0 0.0.0.0 192.168.1.1 name DEFAULT_ROUTE_to_INTERWEBZ

                          ip route 172.45.45.45 255.255.255.255 192.168.1.3 name INTRANET_SERVER