Configuring interfaces on Cisco Router using NETCONF (any IOS below 16.x)

First, the Networking fundamentals picture plus explanation. Check drawing below:

Typical NETCONF flow request between Client and Cisco Router
Any Cisco Router running any IOS below 16.x
hostname devnetlearning1
username cisco1 privilege 15 password 0 cisco1
aaa new-model
aaa authorization exec default local
ip domain-name
snmp-server enable traps snmp authentication linkdown linkup
snmp-server enable traps syslog
snmp-server manager
crypto key generate rsa 
ip ssh logging events
ip ssh version 2
netconf max-sessions 16
netconf max-message 2147483
netconf ssh
line vty 0 4
 transport input ssh
interface Ethernet0/0
 ip address
no sh
Client (human)
You can use any OS bash or netconf-console. The demo and example output will come from the Ubuntu 18.04.5 LTS OS.

Client must have IP connectivity and Router must have enable netconf ssh in order to be able to listen request via TCP:22

STEP (1) – Client connects to NETCONF SSH subsystem.

Human connecting to the router via bash using> ssh -p 22 cisco1@ -s netconf

STEP(2) – Server (router) responds with Hello that includes NETCONF-supported capabilities.

Router replies back to the client with a HELLO NETCONF INTRO displaying the router NETCONF capabilities as following>

<?xml version=’1.0′ encoding=’UTF-8′?>
<nc:hello xmlns:nc=”urn:ietf:params:xml:ns:netconf:base:1.0″>

STEP(3) – Client responds with supported capabilities

In this step, the client must respond with the client capabilities. If the Router did not receive any capability whatsoever, the router can not continue with the NETCONF process. Client to respond with supported capabilities as following:

<?xml version=”1.0″ encoding=”UTF-8″?>
<hello xmlns=”urn:ietf:params:xml:ns:netconf:base:1.0″>

Keep in mind, all the exchange data is using the same pattern. the same data format. XML.

STEP(4) – Client issues NETCONF request (rpc/operation/content)

In this particular step, client provide any request that want to consume from the server (router). Remember that the NETCONF capabilities were exchanged already, therefore, client and server are aware of what is and what is not capable of each other. In this example, Client is already aware that the router is capable to receive interface configuration via NETCONF and proceed to request interface configuration change on interface Ethernet 0/1 configuring as following:

<?xml version=”1.0″ encoding=”UTF-8″?>
<rpc message-id=”101″ xmlns=”urn:ietf:params:xml:ns:netconf:base:1.0″> 
<cmd>hostname devnetlearning1</cmd>
            <cmd>interface Ethernet0/1</cmd>
            <cmd>ip address</cmd>

NOTE between step 3 and 4, server (router) is quiet. Client is the only one who is talking.

STEP(5) – Server (Router) issues response/performs operation

Notice that this is the last Step of the communication process. The Server (router) send a response acknowledging the operation of the client request, confirms the Ethernet 0/1 was configured and communication is closed

Tags :

1 thought on “Configuring interfaces on Cisco Router using NETCONF (any IOS below 16.x)

Leave a Reply

Your email address will not be published. Required fields are marked *