This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Cisco Banner Login Change Template- Is there Multi-Line support?

Thought this would be simple but we have a multi line banner login message that we need to replace on all our Cisco gear.

If I try to use the Cisco Login banner change template provided it seems to only like single line and cuts off the text.  If I write my own it seems when a new line character is given the device prompt on Cisco IOS disappears so NCM stops sending the remainder of the config lines.

Any way to write the change template to push multi-line banner message?

Parents
  • Here's a suggestion: copy the template, then edit the template to include the template in a static manner. It doesn't matter what you enter in the prompt for the banner if you don't put the banner variable in the output to the device. I found I still needed to have the variable in the template. Unfortunately, this solution truncates multiple spaces to a single space. Note: This template is for MOTD, rather than Login banner, but the solution is basically the same.

    *
    .CHANGE_TEMPLATE_DESCRIPTION
            Change Login Banner on Cisco IOS devices
    .CHANGE_TEMPLATE_TAGS
    Cisco
    .PLATFORM_DESCRIPTION
            Cisco IOS
    .PARAMETER_LABEL @ContextNode
            NCM Node
    .PARAMETER_DESCRIPTION @ContextNode
            The node the template will operate on.  All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables.

    */

    script ChangeMOTDBannerCiscoIOS ( NCM.Nodes @ContextNode,
                                      string @LoginBanner  )
    {
      CLI
      {
        configure terminal
        no banner motd
        banner motd ^C
            ******************************************
            **          SW-Name-A-01 3750X          **
            **       Mega Corp System Network       **
            **  Unauthorized access is prohibited.  **
            ******************************************^C
        exit
      }

    }

  • Thanks for your reply but that is what I have as well unfortunately as a watch a session trace the config template will run until the normal cisco prompt disappears (after entering banner motd or login line).  Once the normal prompt disappears the config template stops running so all the message lines aren't entered and it eventually times out.  I have tried putting in the lines like above..I have tried ${CRLF} after each line and I have tried using the string @LoginBanner and providing the entire banner that way as well.  I have even tried embedding the ^C beginning and ending inside the string line to see if it would paste it all in at once with no luck.

    Anyone willing to share a working banner script?

  • Hi again Brian. Perhaps updating from the Config management > Script Management instead of from Config Change Templates might help. It's worth a try.

    The banner script I posted above does work in my environment on Cisco IOS devices. I changed the text of the MOTD before posting here. When I run exactly what I posted above, it works on the c3560g-8 that I have at my desk.  Just to verify -- you are working with IOS devices, correct -- not catalyst or ASA?

  • Just tried from Script mgmt too.  Tried to run script and nada.  Seems to hang at same part.  Tried going back to default NCM Cisco IOS proflle.  No good.  I have seen this issue before when the device prompt doesn't return NCM doesn't continue to send commands.

    I am running the latest NPM/NCM versions.  This issue only comes up with adding a banner since the prompt doesn't return until the quit character is given which is after many new lines which aren't executing.  Is there something I am missing in the device profile that would ignore the fact that Cisco does the strange behavior of not showing the device prompt when configuring banners?  One more reason I prefer JUNOS to Cisco. emoticons_happy.png

  • The problem is, that when putting in a banner you don't get prompted for each line.  So it has to time out before it tries putting in the next line.  Doesn't work very well...

    The solution I found is just TFTP the banner in via your script.  Works great!!   Then I use a compliance rule to make sure its set correctly...

Reply
  • The problem is, that when putting in a banner you don't get prompted for each line.  So it has to time out before it tries putting in the next line.  Doesn't work very well...

    The solution I found is just TFTP the banner in via your script.  Works great!!   Then I use a compliance rule to make sure its set correctly...

Children