|
| 1 | +# NETCONF Tool |
| 2 | + |
| 3 | +## Overview |
| 4 | +Pathman_SR originally used NETCONF to find node SIDs. (Now BGP RIB is tried first) |
| 5 | +As netconf is somewhat complex to get going, I have build a helper tool. |
| 6 | + |
| 7 | +And if efforts fail, you can also add SIDs statically via the set_static_sid.py |
| 8 | + |
| 9 | +## Configuration |
| 10 | +Configuration is shared with pathman_sr and is in pathman_ini.py |
| 11 | +``` |
| 12 | +odl_ip = '198.18.1.80' |
| 13 | +odl_port = '8181' |
| 14 | +odl_user = 'admin' |
| 15 | +odl_password = 'admin' |
| 16 | +``` |
| 17 | + |
| 18 | + |
| 19 | +## netconf.py cli |
| 20 | + |
| 21 | +Help is available through --help |
| 22 | +``` |
| 23 | +$ ./netconf.py --help |
| 24 | +usage: ./netconf.py [-h] [-v] [--controller_ip CONTROLLER_IP] |
| 25 | + [--controller_port CONTROLLER_PORT] [--user USER] |
| 26 | + [--password PASSWORD] |
| 27 | + {add,delete,list,static} ... |
| 28 | +
|
| 29 | +Add, List and Remove nodes from ODL Netconf |
| 30 | +
|
| 31 | +positional arguments: |
| 32 | + {add,delete,list,static} |
| 33 | + commands |
| 34 | + add add a node to netconf |
| 35 | + delete delete a node from netconf |
| 36 | + list list netconf nodes |
| 37 | + static add static SR ID to pathman_sr |
| 38 | +
|
| 39 | +optional arguments: |
| 40 | + -h, --help show this help message and exit |
| 41 | + -v, --version show program's version number and exit |
| 42 | + --controller_ip CONTROLLER_IP |
| 43 | + ODL Controller ip address |
| 44 | + --controller_port CONTROLLER_PORT |
| 45 | + ODL port |
| 46 | + --user USER ODL user |
| 47 | + --password PASSWORD ODL password |
| 48 | +
|
| 49 | +Copyright (c) 2015 by Cisco Systems, Inc. All Rights Reserved |
| 50 | +$ |
| 51 | +``` |
| 52 | + |
| 53 | +### Add |
| 54 | + |
| 55 | +``` |
| 56 | +$ ./netconf.py add --help |
| 57 | +usage: ./netconf.py add [-h] --name NAME --address ADDRESS [--port PORT] |
| 58 | + [--device_user DEVICE_USER] |
| 59 | + [--device_password DEVICE_PASSWORD] |
| 60 | +
|
| 61 | +optional arguments: |
| 62 | + -h, --help show this help message and exit |
| 63 | + --name NAME name of node to add |
| 64 | + --address ADDRESS device ip address |
| 65 | + --port PORT device netconf port [830] |
| 66 | + --device_user DEVICE_USER |
| 67 | + device username [admin] |
| 68 | + --device_password DEVICE_PASSWORD |
| 69 | + device password [admin] |
| 70 | +$ |
| 71 | +``` |
| 72 | + |
| 73 | + |
| 74 | +### Delete |
| 75 | + |
| 76 | +``` |
| 77 | +$ ./netconf.py delete --help |
| 78 | +usage: ./netconf.py delete [-h] --name NAME |
| 79 | +
|
| 80 | +optional arguments: |
| 81 | + -h, --help show this help message and exit |
| 82 | + --name NAME name of node to delete |
| 83 | +
|
| 84 | +$ |
| 85 | +``` |
| 86 | + |
| 87 | +### List |
| 88 | + |
| 89 | +``` |
| 90 | +$ ./netconf.py list --help |
| 91 | +usage: ./netconf.py list [-h] [--name NAME] |
| 92 | +
|
| 93 | +optional arguments: |
| 94 | + -h, --help show this help message and exit |
| 95 | + --name NAME name of node to list |
| 96 | +$ |
| 97 | +``` |
| 98 | + |
| 99 | +### Static |
| 100 | + |
| 101 | +``` |
| 102 | +$ ./netconf.py static --help |
| 103 | +usage: ./netconf.py static [-h] [--name NAME] [--ip IP] [--sid SID] |
| 104 | +
|
| 105 | +optional arguments: |
| 106 | + -h, --help show this help message and exit |
| 107 | + --name NAME name of node |
| 108 | + --ip IP loopback ip of node |
| 109 | + --sid SID SR ID of node |
| 110 | +
|
| 111 | + $ |
| 112 | + ``` |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +### Examples for netconf: |
| 118 | +``` |
| 119 | +./netconf.py list |
| 120 | +./netconf.py list —-name sjc |
| 121 | +./netconf.py add —-name alb --address 198.18.1.30 |
| 122 | +./netconf.py delete --name nyc |
| 123 | +``` |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
0 commit comments