> For the complete documentation index, see [llms.txt](https://ccie-sp.gitbook.io/ccie-spv5.1-labs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ccie-sp.gitbook.io/ccie-spv5.1-labs/labs/nso/using-a-netconf-ned.md).

# Using a NETCONF NED

NETCONF can be used as a NED instead of a CLI-based NED. The built-in NED for IOS-XR does not appear to support NETCONF, however you can easily create your own NETCONF NED by pulling the YANG modules from the device itself.

Note that you may need an XRv9K for this to work properly. I have only tested this on XRv9K.

First we connect to the XRv9K using **device-type cli**.

```
devices device xr1
 device-type cli ned-id cisco-ios-xr...
 connect
```

On the XRv, we must enable NETCONF:

```
ssh server v2
ssh server netconf
netconf-yang agent ssh
netconf agent tty
```

In NSO, fetch SSH host keys and do a sync from:

```
devices device xr1 ssh fetch-host-keys
devices device xr1 sync-from
```

Enable devtools and change the **device-type** to netconf

```
devtools true
conf t
netconf-ned-builder project xr 7.11
 device               xrv9k-controller
 local-user           admin
 vendor               Cisco
 max-download-threads 1
devices device xr1
 device-type netconf ned-id netconf
 no device-type cli protocol ssh
 connect
```

We then fetch the YANG module list from the XRv:

```
netconf-ned-builder project xr 7.11 fetch-module-list 
netconf-ned-builder project xr 7.11 module Cisco-IOS-XR-* * select
```

Build the NED and export it:

```
netconf-ned-builder project xr 7.11 build-ned
netconf-ned-builder project xr 7.11 export-ned to-directory /tmp
```

Transfer it to the packages dir

```
mv -f /tmp/<filename>.tar.gz ~/nso-instance1/packages/
```

In NSO reload packages and use the new NED

```
packages reload
devices device xr1
 device-type netconf ned-id xr-nc-7.11
```

## Reference <a href="#id-68cf5b2d-6e51-4e1d-aff4-54d19226042a" id="id-68cf5b2d-6e51-4e1d-aff4-54d19226042a"></a>

<https://www.zhaocs.info/new-install-nso-and-connect-with-xr-by-cli-netconf-ned.html>

<https://developer.cisco.com/docs/nso/guides/ned-development/#netconf-ned-development>
