12-31-2023 02:08 AM
There is an error when trying to get config in part 4 step 1 b, the code is not good as of at least 31.12.2023.
(ios-xe version 16.9)
this is the code to get the output from the lab:
from ncclient import manager
netconf_filter = """
<filter XML="urn:ietf:params:xml:ns:netconf:base:1.0">
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native ">
</native>
</filter>
"""
m = manager.connect(
host="192.168.56.101",
port=830,
username="cisco",
password="cisco123!",
hostkey_verify=False
)
netconf_reply = m.get_config(source="running", filter=netconf_filter)
print(netconf_reply)
Output:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:3477d1e5-8f2e-4e53-9635-251ee1117756">
<data>
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
<version>16.9</version>
<boot-start-marker/>
<boot-end-marker/>
<banner>
<motd>
<banner>^C</banner>
</motd>
</banner>
<service>
<timestamps>
<debug>
<datetime>
<msec/>
</datetime>
</debug>
<log>
<datetime>
<msec/>
</datetime>
</log>
</timestamps>
</service>
<platform>
<console xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-platform">
<output>virtual</output>
</console>
</platform>
<hostname>CSR1kv</hostname>
<username>
<name>cisco</name>
<privilege>15</privilege>
<password>
<encryption>0</encryption>
<password>cisco123</password>
</password>
</username>
<ip>
<domain>
<name>example.netacad.com</name>
</domain>
<forward-protocol>
<protocol>nd</protocol>
</forward-protocol>
<http xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-http">
<authentication>
<local/>
</authentication>
<server>false</server>
<secure-server>true</secure-server>
</http>
</ip>
<interface>
<GigabitEthernet>
<name>1</name>
<description>VBox</description>
<ip>
<address>
<dhcp/>
</address>
</ip>
<ipv6>
<address>
<prefix-list>
<prefix>2001:DB8:ACAD:56::101/64</prefix>
</prefix-list>
<link-local-address>
<address>fe80::56:1</address>
<link-local/>
</link-local-address>
</address>
</ipv6>
<mop>
<enabled>false</enabled>
<sysid>false</sysid>
</mop>
<negotiation xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-ethernet">
<auto>true</auto>
</negotiation>
</GigabitEthernet>
</interface>
<control-plane/>
<login>
<on-success>
<log/>
</on-success>
</login>
<multilink>
<bundle-name xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-ppp">authenticated</bundle-name>
</multilink>
<redundancy/>
<spanning-tree>
<extend xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-spanning-tree">
<system-id/>
</extend>
</spanning-tree>
<subscriber>
<templating/>
</subscriber>
<crypto>
<pki xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-crypto">
<trustpoint>
<id>TP-self-signed-2109600387</id>
<enrollment>
<selfsigned/>
</enrollment>
<revocation-check>none</revocation-check>
<rsakeypair>
<key-label>TP-self-signed-2109600387</key-label>
</rsakeypair>
<subject-name>cn=IOS-Self-Signed-Certificate-2109600387</subject-name>
</trustpoint>
<certificate>
<chain>
<name>TP-self-signed-2109600387</name>
<certificate>
<serial>01</serial>
<certtype>self-signed</certtype>
</certificate>
</chain>
</certificate>
</pki>
</crypto>
<license>
<udi>
<pid>CSR1000V</pid>
<sn>9VF0JU7V5NN</sn>
</udi>
</license>
<line>
<console>
<first>0</first>
<logging>
<synchronous/>
</logging>
<stopbits>1</stopbits>
</console>
<vty>
<first>0</first>
<last>4</last>
<login>
<local/>
</login>
<transport>
<input>
<input>ssh</input>
</input>
</transport>
</vty>
<vty>
<first>5</first>
<last>15</last>
<login>
<local/>
</login>
<transport>
<input>
<input>ssh</input>
</input>
</transport>
</vty>
</line>
<diagnostic xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-diagnostics">
<bootup>
<level>minimal</level>
</bootup>
</diagnostic>
</native>
</data>
</rpc-reply>
12-31-2023 11:34 AM
Where is this error found?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide