Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nleiva/oc-coverage
https://github.com/nleiva/oc-coverage
cisco cisco-ios-xr grpc grpc-go openconfig yang
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/nleiva/oc-coverage
- Owner: nleiva
- License: bsd-3-clause
- Created: 2018-07-03T22:11:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T00:39:20.000Z (almost 2 years ago)
- Last Synced: 2024-11-07T13:52:20.680Z (3 months ago)
- Topics: cisco, cisco-ios-xr, grpc, grpc-go, openconfig, yang
- Language: Go
- Size: 54.7 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenConfig coverage
[![published](https://static.production.devnetcloud.com/codeexchange/assets/images/devnet-published.svg)](https://developer.cisco.com/codeexchange/github/repo/nleiva/oc-coverage)
A simple example to understand OpenConfig coverage of your IOS XR router config. It will retrieve the original config of a device, then pull the OpenConfig version of it. The target device config will be replaced by a minimum setup to allow remote access, and then the OpenConfig config will be applied on top of it. The result will be compared to the initial state to determine the coverage gap.
![coverage](static/oc-diff.svg)
## Requirements to run
### Enviroment variables
Target device details:
- USER (E.g. root)
- PASSWORD (E.g. mypassword)
- ADDRESS (E.g. [2001:420:2cff:1204::5501:3]:57344)You can setup this as follows:
```console
export USER=root
export PASSWORD=mypassword
export ADDRESS='[2001:420:2cff:1204::5501:3]:57344'
```### gRPC config
The target device needs to have gRPC enabled.
```console
grpc
port 57344
address-family ipv6
```### Router's base config
This is the config that will provide minimun settings to allow a remote gRPC connection; IP addressing, username/password, and gRPC setup. See the example at [base.cfg](input/base.cfg).
### Router's TLS Certificate
In order to secure the connection, a certificate file will need to be retrieved from the device.
```console
RP/0/RP0/CPU0:mrstn-5501-3.cisco.com# bash cat /misc/config/grpc/ems.pem
Tue Jul 3 14:43:05.712 UTC
-----BEGIN CERTIFICATE-----
MIIEEDCCAvigAwIBAgICFJgwDQYJKoZIhvcNAQENBQAwgbAxCzAJBgNVBAYTAlVT
MQswCQYDVQQIEwJDQTERMA8GA1UEBxMIU2FuIEpvc2UxFzAVBgNVBAkTDjM3MDAg
...
-----END CERTIFICATE-----
```