cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

configuration using ncs_cli

raffovicisco01
Beginner
Beginner

Hi folks,

I'm following both the "NCS getting started guide" and the examples within the NCS installation directory. I was expecting to achieve the same result with both "$ ncs_cli -u admin" and "$ ncs_cli -C -u admin" shell but is not like this.

I'm trying to replicate the same configuration from the 5.5.3 Defining mapping ...

admin@ncs(config)# devices device c0 config ios:interface FastEthernet 10/10 switchport trunk allowed vlan

Possible completions:

  WORD     VLAN IDs of the allowed VLANs when this port is in trunking mode

  all      all VLANs

  except   all VLANs except the following

  none     no VLANs

admin@ncs(config)# devices device c0 config ios:interface FastEthernet 10/10 switchport trunk allowed vlan 1234

Possible completions:

  <cr>

admin@ncs(config)# devices device c0 config ios:interface FastEthernet 10/10 switchport trunk allowed vlan 1234

admin@ncs(config-if)# top

using the "$ ncs_cli -u admin" shell bou is not possible.

admin@ncs% edit devices device c1 config ios:interface FastEthernet 10/10 switchport trunk allowed vlan 1234

--------------------------------------------------------------------------------------------------------^

syntax error: expecting

  all    - all VLANs

  except - all VLANs except the following

  none   - no VLANs

  vlans  -

[error][2015-07-17 11:36:34]

Can you please help me understanding my fault and the difference between the two CLI mode?

Regards

Raffo

4 REPLIES 4

mike.elrom
Beginner
Beginner

Hi Raffo,

Not sure if I completely understand your question, but the two CLI modes let operators use the CLI in a style either similar to Cisco or Juniper.  Juniper is the default.

ncs_cli -u admin -C

admin connected from 127.0.0.1 using console on mikes-mbp.home

admin@ncs# con

Entering configuration mode terminal

admin@ncs(config)#

ncs_cli -u admin -J

admin connected from 127.0.0.1 using console on mikes-mbp.home

admin@ncs> con

Entering configuration mode private

[ok][2015-07-17 10:28:50]

[edit]

admin@ncs%

Furthermore, you can adjust some of the CLI prompt in the ncs.conf file:

  <cli>

    <enabled>true</enabled>

    <!-- Use the builtin SSH server -->

    <ssh>

      <enabled>true</enabled>

      <ip>0.0.0.0</ip>

      <port>2024</port>

    </ssh>

    <prompt1>\u@ncs> </prompt1>

    <prompt2>\u@ncs% </prompt2>

    <c-prompt1>\u@ncs# </c-prompt1>

    <c-prompt2>\u@ncs(\m)# </c-prompt2>

    <show-log-directory>logs</show-log-directory>

    <show-commit-progress>true</show-commit-progress>

    <suppress-commit-message-context>maapi</suppress-commit-message-context>

    <suppress-commit-message-context>system</suppress-commit-message-context>

  </cli>

Mike

Ajay Pandey
Cisco Employee
Cisco Employee

Hi Raffo,

In the Juniper style (ncs_cli -u admin or ncs_cli -u admin -J), please try this :-

edit devices device c1 config ios:interface FastEthernet 10/10 switchport trunk allowed vlan 1234 vlans 1234

Thanks,

Ajay

Hi Ajay,

I tried it and it doesn't work :

admin@ncs% edit devices device c1 config ios:interface FastEthernet 10/10 switchport trunk allowed vlan 1234 vlans 1234

--------------------------------------------------------------------------------------------------------^

syntax error: element does not exist

[error][2015-07-20 11:59:19]

[edit]

Regards

Raffo

shooky@nil.si
Beginner
Beginner

You are missing "vlans" right after vlan when using J style CLI. Note that the two styles render NED YANG models differently so you cannot assume that the only difference will be in prepending the J commands with request or edit.

More specifically, the NED uses the tailf:cli-drop-node-name annotation which only applies to C style (hence no vlans keyword).

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: