cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
438
Views
0
Helpful
2
Replies

RPC refuse banner commands on 16.12.08

vaniat
Level 1
Level 1

When I try to configure login and motd banner on 16.12.08 version of IOS I get following error:

<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="10">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>invalid-value</error-tag>
    <error-severity>error</error-severity>
    <error-message xml:lang="en">inconsistent value: Device refused one or more commands</error-message>
    <error-info>
      <severity xmlns="http://cisco.com/yang/cisco-ia">error_cli</severity>
      <detail xmlns="http://cisco.com/yang/cisco-ia">
        <bad-cli>
          <bad-command>             * WARNING: Unauthorized access to this system is forbidden and will be prosecuted by law.*</bad-command>
          <error-location>13</error-location>
          <parser-context>banner login ******************************************************************************************
             * WARNING: Unauthorized access to this system is forbidden and will be prosecuted by law.*</parser-context>
        </bad-cli>
        <bad-cli>
          <bad-command>             *   By accessing this system, you agree that your actions may be monitored and logged.   *</bad-command>
          <error-location>13</error-location>
          <parser-context>banner login ******************************************************************************************
             * WARNING: Unauthorized access to this system is forbidden and will be prosecuted by law.*
             *   By accessing this system, you agree that your actions may be monitored and logged.   *</parser-context>
        </bad-cli>
        <bad-cli>
          <bad-command>             ******************************************************************************************</bad-command>
          <error-location>13</error-location>
          <parser-context>banner login ******************************************************************************************
             * WARNING: Unauthorized access to this system is forbidden and will be prosecuted by law.*
             *   By accessing this system, you agree that your actions may be monitored and logged.   *
             ******************************************************************************************</parser-context>
        </bad-cli>
        <bad-cli>
          <bad-command>            *         Do not forget forget to:            *</bad-command>
          <error-location>12</error-location>
          <parser-context>banner motd ***********************************************
            *         Do not forget forget to:            *</parser-context>
        </bad-cli>
        <bad-cli>
          <bad-command>            * -Document and save your changes             *</bad-command>
          <error-location>12</error-location>
          <parser-context>banner motd ***********************************************
            *         Do not forget forget to:            *
            * -Document and save your changes             *</parser-context>
        </bad-cli>
        <bad-cli>
          <bad-command>            * -Turn your debugs off                       *</bad-command>
          <error-location>12</error-location>
          <parser-context>banner motd ***********************************************
            *         Do not forget forget to:            *
            * -Document and save your changes             *
            * -Turn your debugs off                       *</parser-context>
        </bad-cli>
        <bad-cli>
          <bad-command>            * -Possible loss of connection? reload in [m] *</bad-command>
          <error-location>12</error-location>
          <parser-context>banner motd ***********************************************
            *         Do not forget forget to:            *
            * -Document and save your changes             *
            * -Turn your debugs off                       *
            * -Possible loss of connection? reload in [m] *</parser-context>
        </bad-cli>
        <bad-cli>
          <bad-command>            ***********************************************</bad-command>
          <error-location>12</error-location>
          <parser-context>banner motd ***********************************************
            *         Do not forget forget to:            *
            * -Document and save your changes             *
            * -Turn your debugs off                       *
            * -Possible loss of connection? reload in [m] *
            ***********************************************</parser-context>
        </bad-cli>
      </detail>
    </error-info>
  </rpc-error>
</rpc-reply>

However same RPC call works perfectly fine on 17.06.04. Here is a RPC call created with python ydk:

<?xml version="1.0"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="26">
  <edit-config>
    <target>
      <candidate/>
    </target>
    <config>
      <native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
        <hostname>MYXXX-ASW001</hostname>
        <banner>
          <login>
            <banner>******************************************************************************************
* WARNING: Unauthorized access to this system is forbidden and will be prosecuted by law.*
*   By accessing this system, you agree that your actions may be monitored and logged.   *
******************************************************************************************
</banner>
          </login>
          <motd>
            <banner>***********************************************
*         Do not forget forget to:            *
* -Document and save your changes             *
* -Turn your debugs off                       *
* -Possible loss of connection? reload in [m] *
***********************************************
</banner>
          </motd>
        </banner>
</native>
</config>
</edit-config>
</rpc>

 

2 Replies 2

ygorelik
Cisco Employee
Cisco Employee

What software did you use to send the RPC? If it is YDK, could you please share your Python script here?

It seems that your router did not like implicit end-of-line. I would suggest instead explicitly use char '\n' where you want to have the end-of-line and put the whole text into one line. Example of such banner configuration you can find here.

vaniat
Level 1
Level 1

Yes, I am using YDK and I explicitly did \n. I am passing vars from dictionary like this:

      "banner": " ******************************************************************************************\n* WARNING: Unauthorized access to this system is forbidden and will be prosecuted by law.*\n*   By accessing this system, you agree that your actions may be monitored and logged.   *\n******************************************************************************************\n",
      "motd": " ***********************************************\n*         Do not forget forget to:            *\n* -Document and save your changes             *\n* -Turn your debugs off                       *\n* -Possible loss of connection? reload in [m] *\n***********************************************\n"

and then:

native_config = Cisco_IOS_XE_native.Native()
if 'banner' in kwargs:
    banner = kwargs.get('banner')
    native_config.banner.login.banner = dedent(banner)

if 'motd' in kwargs:
    motd = kwargs.get('motd')
    native_config.banner.motd.banner = dedent(motd)

Strange part is that this works fine on 17.06.04 version of IOS but not on 16.12.08