├── LICENSE ├── README.md ├── config-odl ├── create-physical-interface.sh ├── delete-odl ├── iptables-reset.sh ├── logs ├── nodes ├── nodes.16 ├── parameters ├── parameters.16 ├── python ├── del-node.py ├── is-node-connected.py ├── put-app-rib.py ├── put-bgp-neighbor.py ├── put-bgp-peer.py ├── put-bgp-rib.py ├── put-node.py ├── put-pcep-client.py └── put-static-route.py ├── restart-odl ├── setup-odl ├── start-odl ├── start-vpn ├── stop-odl ├── stop-vpn ├── unpack-odl ├── vagrant ├── Vagrantfile └── bootstrap.sh └── xrvr-5 ├── README.md ├── XRcopy.sh ├── XRget.sh ├── XRloader.exp ├── XRsetup.sh ├── XRstart.sh ├── XRstop.sh ├── nodes ├── parameters ├── xrvr-5.pdf ├── xrvr-a.config ├── xrvr-a.sh ├── xrvr-b.config ├── xrvr-b.sh ├── xrvr-c.config ├── xrvr-c.sh ├── xrvr-d.config ├── xrvr-d.sh ├── xrvr-e.config └── xrvr-e.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Cisco Systems, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # opendaylight-setup 2 | This directory contains setup scripts for ODL. 3 | 4 | Start with a Linux host or VM with git and java installed (at a minimum - ideally mininet, openconnect, pip, pyang etc. too, depending on what features you plan to test). 5 | 6 | Installation Instructions: 7 | 8 | 1. Clone this repo: 9 | 10 | git clone https://github.com/CiscoDevNet/opendaylight-setup.git ODL 11 | 12 | 2. Within the ODL directory create an "images" subdirectory: 13 | 14 | cd ODL
15 | mkdir images 16 | 17 | So you will now have 2 subdirectories: 18 | 19 | * python 20 | * images 21 | 22 | 3. Copy the appropriate OpenDaylight distribution file (.tar.gz) from https://www.opendaylight.org/downloads (or other location) to images: 23 | 24 | Example: (Assumes you are downloading the Oxygen-SR2 release.) 25 | 26 | wget -P images https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/karaf/0.8.2/karaf-0.8.2.tar.gz 27 | 28 | 4. Under the "ODL" directory, edit the DISTRO and VERSION variables in the "parameters" file to reflect the release you just downloaded into the "images" directory. 29 | 30 | 5. Unpack ODL using 31 | 32 | ./unpack-odl 33 | 34 | 6. If you are *not* using the dCloud infrastructure (http://dcloud.cisco.com) to experiment with ODL, edit the "nodes" file to reflect the list of nodes and their IP Addresses in your VIRL simulation. 35 | 36 | 7. If you are *not* using dCloud and if you plan to use BGP, edit the parameters file to change the IP address of the BGP speaker. 37 | 38 | 8. Optionally edit the parameters file to change the set of features installed at ODL startup. 39 | 40 | 9. Optionally edit the logs file to change the set of additional logging activated at ODL startup. 41 | 42 | 10. Set up ODL using (this loads key features and logging configs) 43 | 44 | ./setup-odl 45 | 46 | 11. If you are using dCloud from Linux then set up the VPN using: 47 | 48 | sudo ./start-vpn site username password 49 | 50 | * site is one of sjc, rtp, lon, sng or chi 51 | * username and password can be found in your dCloud session details 52 | 53 | (note that your unix account will need sudo privileges) 54 | 55 | 12. If using dCloud from a Mac then use the Cisco AnyConnect VPN client. Set the host to https://dcloud-xxx-anyconnect.cisco.com and substitute sjc, rtp, lon, sng or chi for xxx. 56 | 57 | 13. Start ODL using 58 | 59 | ./start-odl 60 | 61 | 14. Configure ODL using 62 | 63 | ./config-odl interface (e.g. tun0, eth0) 64 | 65 | (this will connect ODL to the NETCONF nodes and configure BGP-LS/PCE-P - if the features are selected) 66 | 67 | The repository also contains a subdirectory "vagrant" which contains a Vagrantfile and bootstrap.sh script. 68 | 69 | If you have Vagrant and VirtualBox or VMWare Workstation/Fusion installed you can do a "vagrant up" from that directory and a VirtualBox VM will be created consisting of: 70 | 71 | * Ubuntu 16.04 72 | * git 73 | * zip 74 | * openconnect (required if using dCloud) 75 | * java (JRE only) 76 | * mininet (required if testing OpenFlow) 77 | * pip 78 | * pyang 79 | * this repository 80 | * OpenDaylight Oxyten SR2 81 | 82 | ODL will be unpacked. So you can follow the instructions above from step 6. 83 | 84 | Note that the Vagrantfile is currently configured to allocate 2 vCPUs and 8GB of RAM to the VM. If your machine only has 8GB of RAM then you may wish to allocate 4GB of RAM. Likewise if you only have 2 CPU cores you may wish to allocate 1 vCPU. Equally if you want to use a different hypervisor you will need to edit the Vagrantfile. 85 | 86 | The repository also contains a subdirectory "xrvr-5" with KVM scripts etc. for setting up a 5 node XRv lab. 87 | 88 | ### Scripts are: 89 | 90 | **unpack-odl** unpacks the .tar.gz file. Creates a new subdirectory for the ODL distro. 91 | 92 | **setup-odl** sets up logging/features for ODL 93 | 94 | **start-vpn** connects to dCloud VPN. Takes 3 parameters: 95 | 96 | * site (sjc/rtp/lon/sng/chi) 97 | * username 98 | * password 99 | 100 | **stop-vpn** disconnects from dCloud VPN 101 | 102 | **start-odl** cleans out data from previous runs and starts ODL 103 | 104 | **stop-odl** stops ODL 105 | 106 | **config-odl** sets up NETCONF nodes, BGP etc. - uses scripts from the python subdirectory (plus in the dCloud case REST calls to dCloud APIs) 107 | 108 | **delete-odl** deletes the ODL distribution 109 | 110 | **restart-odl** restarts ODL by calling other scripts 111 | 112 | ### Additional files are: 113 | 114 | **parameters** parameters - encoded as environment vars: 115 | 116 | * DISTRO (name of ODL distribution) 117 | * VERSION (release of ODL - e.g. Oxygen) 118 | * BGP_PEER (IP address of BGP peer) 119 | * BGP_NODE (NETCONF name of BGP peer) 120 | * BGP\_NEXT_HOP (next-hop from BGP peer towards ODL - only required if ODL is on a different subnet from the BGP peer) 121 | * LOCAL_AS 122 | * REMOTE_AS 123 | * ODL_USER 124 | * ODL_PASS 125 | * NETCONF_PORT 126 | * NETCONF_USER 127 | * NETCONF_PASS 128 | * FEATURES (list of features to add to ODL's default set) 129 | 130 | **logs** extra logs to activate 131 | 132 | **nodes** list of NETCONF nodes to mount (each line consists of a node name and node IP address) 133 | 134 | **nodes.16** / **parameters.16** 16-node setup for RTP dCloud 135 | 136 | ### Python scripts are: 137 | 138 | **del-node.py** unmounts a node 139 | 140 | **put-node.py** mounts a node 141 | 142 | **is-node-connected.py** checks if a node is mounted 143 | 144 | **put-bgp-rib.py** configures the ODL BGP RIB 145 | 146 | **put-app-rib.py** configures the ODL App RIB 147 | 148 | **put-bgp-peer.py** configures a BGP peer in ODL 149 | 150 | **put-bgp-neighbor.py** configures an XR router to peer with ODL 151 | 152 | **put-pcep-client.py** configures an XR router to act as a PCC towards ODL 153 | 154 | **put-static-route.py** configure a static route on an XR router 155 | -------------------------------------------------------------------------------- /config-odl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./parameters 4 | 5 | if [ $# != 1 ] 6 | then 7 | echo "usage $0 interface" 8 | exit 1 9 | fi 10 | 11 | unamestr=$(uname) 12 | 13 | if [[ $unamestr == 'Darwin' ]]; then 14 | ip=$(/sbin/ifconfig $1 | grep 'inet ' | cut -d" " -f2) 15 | elif [[ $unamestr == 'Linux' ]]; then 16 | ip=$(/sbin/ifconfig $1 | grep 'inet addr': | cut -d: -f2 | cut -d" " -f1) 17 | fi 18 | 19 | echo $ip 20 | 21 | awk -v features=$FEATURES 'BEGIN { exit index(features, "odl-netconf-all") }' 22 | if [ "$?" != "0" ]; 23 | then 24 | echo "mounting netconf nodes" 25 | while read -r line 26 | do 27 | addr=$(echo $line | cut -f1 -d" ") 28 | name=$(echo $line | cut -f2 -d" ") 29 | echo $name $addr 30 | python python/put-node.py localhost $addr $name $NETCONF_PORT $NETCONF_USER $NETCONF_PASS 31 | sleep 2 32 | 33 | while true; 34 | do 35 | python python/is-node-connected.py $ip $name 36 | if [ $? -eq 0 ] 37 | then 38 | echo "NETCONF node $name up" 39 | break 40 | else 41 | sleep 2 42 | fi 43 | done 44 | done < nodes 45 | fi 46 | 47 | awk -v features=$FEATURES 'BEGIN { exit index(features, "odl-bgpcep-bgp") }' 48 | if [ "$?" != "0" ]; 49 | then 50 | echo "configuring BGP" 51 | 52 | # configure BGP RIB 53 | python python/put-bgp-rib.py $ip $LOCAL_AS 54 | 55 | # configure app peer 56 | python python/put-app-rib.py $ip 1.2.3.4 57 | 58 | echo "configuring BGP peer using NETCONF" 59 | python python/put-bgp-neighbor.py $ip $BGP_NODE $LOCAL_AS $REMOTE_AS 60 | 61 | if [ $BGP_NEXT_HOP ]; 62 | then 63 | echo "adding static route to peer using NETCONF" 64 | python python/put-static-route.py $ip $BGP_NODE $ip 32 $BGP_NEXT_HOP 65 | fi 66 | 67 | # configure ODL to talk to BGP peer 68 | python python/put-bgp-peer.py $ip $BGP_PEER $LOCAL_AS $REMOTE_AS 69 | fi 70 | 71 | awk -v features=$FEATURES 'BEGIN { exit index(features, "odl-bgpcep-pcep") }' 72 | if [ "$?" != "0" ]; 73 | then 74 | echo "configuring PCE-P" 75 | 76 | while read -r line 77 | do 78 | name=$(echo $line | cut -f2 -d" ") 79 | echo $name 80 | 81 | python python/put-pcep-client.py $ip $name 82 | done < nodes 83 | fi 84 | -------------------------------------------------------------------------------- /create-physical-interface.sh: -------------------------------------------------------------------------------- 1 | # shutdown and flush inteface 2 | sudo ifconfig enp0s8 down 3 | sudo ip add flush dev enp0s8 4 | -------------------------------------------------------------------------------- /delete-odl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source ./parameters 3 | rm -rf $DISTRO 4 | if [ -e ./setup-done ]; then 5 | rm ./setup-done 6 | fi 7 | -------------------------------------------------------------------------------- /iptables-reset.sh: -------------------------------------------------------------------------------- 1 | iptables -P INPUT ACCEPT 2 | iptables -P FORWARD ACCEPT 3 | iptables -P OUTPUT ACCEPT 4 | iptables -t nat -F 5 | iptables -t mangle -F 6 | iptables -F 7 | iptables -X 8 | -------------------------------------------------------------------------------- /logs: -------------------------------------------------------------------------------- 1 | netconf 2 | protocol 3 | bgpcep 4 | -------------------------------------------------------------------------------- /nodes: -------------------------------------------------------------------------------- 1 | 198.18.1.30 kcy 2 | 198.18.1.31 lax 3 | 198.18.1.32 min 4 | 198.18.1.33 por 5 | 198.18.1.34 san 6 | 198.18.1.35 sea 7 | 198.18.1.36 sfc 8 | 198.18.1.37 sjc 9 | -------------------------------------------------------------------------------- /nodes.16: -------------------------------------------------------------------------------- 1 | 198.18.1.30 alb 2 | 198.18.1.31 atl 3 | 198.18.1.32 bos 4 | 198.18.1.33 chi 5 | 198.18.1.34 hst 6 | 198.18.1.35 kcy 7 | 198.18.1.36 lax 8 | 198.18.1.37 mia 9 | 198.18.1.38 min 10 | 198.18.1.39 nyc 11 | 198.18.1.40 por 12 | 198.18.1.41 san 13 | 198.18.1.42 sea 14 | 198.18.1.43 sfc 15 | 198.18.1.44 sjc 16 | 198.18.1.45 wdc 17 | -------------------------------------------------------------------------------- /parameters: -------------------------------------------------------------------------------- 1 | DISTRO=karaf-0.8.2 2 | 3 | VERSION=Oxygen 4 | 5 | ODL_USER=admin 6 | ODL_PASS=admin 7 | 8 | BGP_PEER=198.18.1.37 9 | BGP_NODE=sjc 10 | BGP_NEXT_HOP=198.18.1.1 11 | LOCAL_AS=65504 12 | REMOTE_AS=65504 13 | 14 | NETCONF_PORT=830 15 | NETCONF_USER=cisco 16 | NETCONF_PASS=cisco 17 | 18 | FEATURES=odl-bgpcep-bgp,odl-bgpcep-pcep,odl-restconf-all,odl-netconf-all,odl-netconf-topology,odl-netconf-connector-all 19 | -------------------------------------------------------------------------------- /parameters.16: -------------------------------------------------------------------------------- 1 | DISTRO=distribution-karaf-0.5.2-Boron-SR2 2 | 3 | ODL_USER=admin 4 | ODL_PASS=admin 5 | 6 | BGP_PEER=198.18.1.44 7 | BGP_NODE=sjc 8 | BGP_NEXT_HOP=198.18.1.1 9 | LOCAL_AS=65504 10 | REMOTE_AS=65504 11 | 12 | NETCONF_PORT=830 13 | NETCONF_USER=cisco 14 | NETCONF_PASS=cisco 15 | 16 | FEATURES=odl-dlux-all,odl-restconf-all,odl-netconf-all,odl-bgpcep-bgp-all,odl-bgpcep-pcep-all,odl-netconf-connector-all 17 | -------------------------------------------------------------------------------- /python/del-node.py: -------------------------------------------------------------------------------- 1 | """ 2 | del-node. 3 | 4 | deletes a node from ODL 5 | 6 | parameters 7 | * ODL IP address 8 | * node name 9 | 10 | uses HTTP PUT with JSON payload 11 | """ 12 | 13 | import sys 14 | import os 15 | import requests 16 | 17 | # check args length 18 | if (len(sys.argv) != 3): 19 | print "usage %s ODL_IP_address Node_Name" % sys.argv[0] 20 | sys.exit(1) 21 | 22 | odl_user = os.environ.get('ODL_USER', 'admin') 23 | odl_pass = os.environ.get('ODL_PASS', 'admin') 24 | 25 | # set up the URL 26 | url = 'http://' + sys.argv[1] + \ 27 | ':8181/restconf/config/network-topology:network-topology' + \ 28 | '/topology/topology-netconf/node/' + sys.argv[2] 29 | 30 | # Delete Node from ODL 31 | print requests.delete(url, auth=(odl_user, odl_pass)) 32 | -------------------------------------------------------------------------------- /python/is-node-connected.py: -------------------------------------------------------------------------------- 1 | """ 2 | is-node-connected. 3 | 4 | Checks if netconf node is connected 5 | 6 | parameter: 7 | * ODL IP address 8 | * Node name 9 | 10 | uses HTTP GET with JSON response 11 | """ 12 | import sys 13 | import os 14 | import requests 15 | import json 16 | 17 | # check args length 18 | if (len(sys.argv) != 3): 19 | print "usage %s ODL_IP_address Node_Name" % sys.argv[0] 20 | sys.exit(1) 21 | 22 | odl_user = os.environ.get('ODL_USER', 'admin') 23 | odl_pass = os.environ.get('ODL_PASS', 'admin') 24 | 25 | req_hdrs = {'Accept': 'application/json'} 26 | 27 | url = 'http://' + sys.argv[1] + ':8181' + \ 28 | '/restconf/operational/network-topology:network-topology/topology' + \ 29 | '/topology-netconf/node/' + sys.argv[2] 30 | 31 | r = requests.get(url, headers=req_hdrs, auth=(odl_user, odl_pass)) 32 | 33 | if (r.status_code == 200): 34 | t = json.loads(r.text) 35 | c = t['node'][0]['netconf-node-topology:connection-status'] 36 | if (c == 'connected'): 37 | print 'node connected' 38 | sys.exit(0) 39 | else: 40 | print 'node not yet connected' 41 | sys.exit(1) 42 | else: 43 | print 'unable to get node status' 44 | sys.exit(2) 45 | -------------------------------------------------------------------------------- /python/put-app-rib.py: -------------------------------------------------------------------------------- 1 | """ 2 | put-app-rib. 3 | 4 | sets up ODL App RIB 5 | 6 | parameter: 7 | * ODL IP address 8 | * App RIB ID 9 | 10 | uses HTTP PUT with JSON payload 11 | """ 12 | 13 | import sys 14 | import os 15 | import requests 16 | 17 | request_template = ''' 18 | { 19 | "bgp-openconfig-extensions:neighbor": [ 20 | { 21 | "neighbor-address": "%s", 22 | "config": { 23 | "peer-group": "application-peers" 24 | } 25 | } 26 | ] 27 | } 28 | ''' 29 | 30 | # check args length 31 | if (len(sys.argv) != 3): 32 | print "usage %s ODL_IP_address App_RIB_ID" % sys.argv[0] 33 | sys.exit(1) 34 | 35 | odl_user = os.environ.get('ODL_USER', 'admin') 36 | odl_pass = os.environ.get('ODL_PASS', 'admin') 37 | 38 | req_hdrs = {'Content-Type': 'application/json'} 39 | req_body = request_template % (sys.argv[2]) 40 | 41 | url = 'http://' + sys.argv[1] + ':8181' + \ 42 | '/restconf/config' + \ 43 | '/openconfig-network-instance:network-instances' + \ 44 | '/network-instance/global-bgp' + \ 45 | '/protocols/protocol/openconfig-policy-types:BGP' + \ 46 | '/example-bgp-rib/bgp-openconfig-extensions:bgp' + \ 47 | '/neighbors/neighbor/' + sys.argv[2] 48 | 49 | resp = requests.put(url, data=req_body, headers=req_hdrs, 50 | auth=(odl_user, odl_pass)) 51 | 52 | print resp 53 | -------------------------------------------------------------------------------- /python/put-bgp-neighbor.py: -------------------------------------------------------------------------------- 1 | """ 2 | put-bgp-neighbor. 3 | 4 | configures XR to peer with ODL 5 | 6 | parameter: 7 | * ODL IP address 8 | * Peer XR NETCONF node 9 | * ODL BGP ASN 10 | * XR BGP ASN 11 | 12 | uses HTTP PUT with JSON payload 13 | """ 14 | 15 | import sys 16 | import os 17 | import requests 18 | 19 | request_template = ''' 20 | { 21 | "neighbor": [ 22 | { 23 | "neighbor-address": "%s", 24 | "session-open-mode": "passive-only", 25 | "remote-as": { 26 | "as-xx": 0, 27 | "as-yy": %s 28 | }, 29 | "neighbor-afs": { 30 | "neighbor-af": [ 31 | { 32 | "af-name": "ipv4-unicast", 33 | "activate": [ 34 | null 35 | ], 36 | "route-reflector-client": true 37 | }, 38 | { 39 | "af-name": "lsls", 40 | "activate": [ 41 | null 42 | ], 43 | "route-reflector-client": true 44 | } 45 | ] 46 | } 47 | } 48 | ] 49 | } 50 | ''' 51 | 52 | # check args length 53 | if (len(sys.argv) != 5): 54 | print "usage %s ODL_IP_address Peer-NETCONF-Node ODL_ASN Peer_ASN" % \ 55 | sys.argv[0] 56 | sys.exit(1) 57 | 58 | odl_user = os.environ.get('ODL_USER', 'admin') 59 | odl_pass = os.environ.get('ODL_PASS', 'admin') 60 | 61 | req_hdrs = { 'Content-Type' : 'application/json' } 62 | 63 | req_body = request_template % (sys.argv[1], sys.argv[3]) 64 | 65 | url = 'http://' + sys.argv[1] + ':8181' + \ 66 | '/restconf/config/network-topology:network-topology/topology' + \ 67 | '/topology-netconf/node/' + sys.argv[2] + '/yang-ext:mount' + \ 68 | '/Cisco-IOS-XR-ipv4-bgp-cfg:bgp/instance/default/instance-as/0/four-byte-as/' + \ 69 | sys.argv[4] + '/default-vrf/bgp-entity/neighbors/neighbor/' + sys.argv[1] 70 | 71 | resp = requests.put(url, data=req_body, headers=req_hdrs, auth=(odl_user, odl_pass)) 72 | 73 | print resp 74 | -------------------------------------------------------------------------------- /python/put-bgp-peer.py: -------------------------------------------------------------------------------- 1 | """ 2 | put-bgp-peer. 3 | 4 | sets up ODL BGP Peer 5 | 6 | parameter: 7 | * ODL IP address 8 | * Peer IP address 9 | * ODL BGP ASN 10 | * Peer BGP ASN 11 | 12 | uses HTTP PUT with JSON payload 13 | """ 14 | 15 | import sys 16 | import os 17 | import requests 18 | 19 | request_template = ''' 20 | { 21 | "bgp-openconfig-extensions:neighbor": [ 22 | { 23 | "neighbor-address": "%s", 24 | "timers": { 25 | "config": { 26 | "connect-retry": 10, 27 | "keepalive-interval": 30, 28 | "hold-time": 180, 29 | "minimum-advertisement-interval": 30 30 | } 31 | }, 32 | "afi-safis": { 33 | "afi-safi": [ 34 | { 35 | "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST" 36 | }, 37 | { 38 | "afi-safi-name": "bgp-openconfig-extensions:LINKSTATE" 39 | } 40 | ] 41 | }, 42 | "route-reflector": { 43 | "config": { 44 | "route-reflector-client": false 45 | } 46 | }, 47 | "transport": { 48 | "config": { 49 | "remote-port": 179, 50 | "mtu-discovery": false, 51 | "passive-mode": false 52 | } 53 | }, 54 | "config": { 55 | "send-community": "NONE", 56 | "peer-as": %d, 57 | "route-flap-damping": false, 58 | "peer-type": "%s" 59 | } 60 | } 61 | ] 62 | } 63 | ''' 64 | 65 | # check args length 66 | if (len(sys.argv) != 5): 67 | print "usage %s ODL_IP_address Peer_IP_Address ODL_ASN Peer_ASN" % \ 68 | sys.argv[0] 69 | sys.exit(1) 70 | 71 | odl_user = os.environ.get('ODL_USER', 'admin') 72 | odl_pass = os.environ.get('ODL_PASS', 'admin') 73 | 74 | if (sys.argv[3] == sys.argv[4]): 75 | peer_type = 'INTERNAL' 76 | else: 77 | peer_type = 'EXTERNAL' 78 | 79 | req_hdrs = {'Content-Type': 'application/json'} 80 | 81 | req_body = request_template % (sys.argv[2], int(sys.argv[4]), peer_type) 82 | 83 | url = 'http://' + sys.argv[1] + ':8181' + \ 84 | '/restconf/config' + \ 85 | '/openconfig-network-instance:network-instances' + \ 86 | '/network-instance/global-bgp' + \ 87 | '/protocols/protocol/openconfig-policy-types:BGP' + \ 88 | '/example-bgp-rib/bgp-openconfig-extensions:bgp'+ \ 89 | '/neighbors/neighbor/' + sys.argv[2] 90 | 91 | resp = requests.put(url, data=req_body, headers=req_hdrs, 92 | auth=(odl_user, odl_pass)) 93 | 94 | print resp 95 | -------------------------------------------------------------------------------- /python/put-bgp-rib.py: -------------------------------------------------------------------------------- 1 | """ 2 | put-bgp-rib. 3 | 4 | sets up ODL BGP RIB 5 | 6 | parameter: 7 | * ODL IP address 8 | * ODL ASN 9 | 10 | uses HTTP PUT with JSON payload 11 | """ 12 | 13 | import sys 14 | import os 15 | import requests 16 | 17 | request_template = ''' 18 | { 19 | "bgp-openconfig-extensions:config": { 20 | "as": %d, 21 | "router-id": "%s" 22 | } 23 | } 24 | ''' 25 | 26 | # check args length 27 | if (len(sys.argv) != 3): 28 | print "usage %s ODL_IP_address ODL_ASN" % sys.argv[0] 29 | sys.exit(1) 30 | 31 | odl_user = os.environ.get('ODL_USER', 'admin') 32 | odl_pass = os.environ.get('ODL_PASS', 'admin') 33 | 34 | req_hdrs = {'Content-Type': 'application/json'} 35 | req_body = request_template % (int(sys.argv[2]), sys.argv[1]) 36 | 37 | url = 'http://' + sys.argv[1] + ':8181' + \ 38 | '/restconf/config' + \ 39 | '/openconfig-network-instance:network-instances' + \ 40 | '/network-instance/global-bgp' + \ 41 | '/protocols/protocol/openconfig-policy-types:BGP' + \ 42 | '/example-bgp-rib/bgp-openconfig-extensions:bgp' + \ 43 | '/global/config' 44 | 45 | resp = requests.put(url, data=req_body, headers=req_hdrs, 46 | auth=(odl_user, odl_pass)) 47 | 48 | print resp 49 | -------------------------------------------------------------------------------- /python/put-node.py: -------------------------------------------------------------------------------- 1 | """ 2 | put-node. 3 | 4 | adds a node to ODL 5 | 6 | parameter: 7 | * ODL IP address 8 | * node IP address 9 | * node name 10 | * netconf port (optional - default is 830) 11 | * netconf user (optional - default is 'cisco') 12 | * netconf pass (optional - default is 'cisco') 13 | 14 | uses HTTP PUT with JSON payload 15 | """ 16 | 17 | import sys 18 | import os 19 | import requests 20 | 21 | # set up the request 22 | request_template = ''' 23 | { 24 | "network-topology:node": { 25 | "node-id": "%s", 26 | "host": "%s", 27 | "port": "%s", 28 | "username": "%s", 29 | "password": "%s", 30 | "tcp-only": false, 31 | "keepalive-delay": 0, 32 | "schema-cache-directory": "XR" 33 | } 34 | } 35 | ''' 36 | 37 | netconf_port = 830 38 | netconf_user = 'cisco' 39 | netconf_pass = 'cisco' 40 | 41 | # check args length 42 | if ((len(sys.argv) < 4) or (len(sys.argv) > 7)): 43 | print "usage %s ODL_IP_address Node_IP_address Node_Name \ 44 | [port user password]" % sys.argv[0] 45 | sys.exit(1) 46 | 47 | if (len(sys.argv) > 4): 48 | netconf_port = sys.argv[4] 49 | if (len(sys.argv) > 5): 50 | netconf_user = sys.argv[5] 51 | if (len(sys.argv) > 6): 52 | netconf_pass = sys.argv[6] 53 | 54 | odl_user = os.environ.get('ODL_USER', 'admin') 55 | odl_pass = os.environ.get('ODL_PASS', 'admin') 56 | 57 | # set up the URL 58 | url = 'http://' + sys.argv[1] + \ 59 | ':8181/restconf/config/network-topology:network-topology' + \ 60 | '/topology/topology-netconf/node/' + sys.argv[3] 61 | 62 | request_body = request_template % (sys.argv[3], sys.argv[2], 63 | netconf_port, netconf_user, netconf_pass) 64 | 65 | headers = {'Content-Type': 'application/json'} 66 | 67 | # Put Node to ODL 68 | print requests.put(url, data=request_body, headers=headers, 69 | auth=(odl_user, odl_pass)) 70 | -------------------------------------------------------------------------------- /python/put-pcep-client.py: -------------------------------------------------------------------------------- 1 | """ 2 | put-pcep-neighbor. 3 | 4 | configures XR to act at PCC towards ODL 5 | 6 | parameter: 7 | * ODL IP address 8 | * Peer XR NETCONF node 9 | 10 | uses HTTP PUT with JSON payload 11 | """ 12 | 13 | import sys 14 | import os 15 | import requests 16 | 17 | request_template = ''' 18 | { 19 | "peer": [ 20 | { 21 | "pce-peer-address": "%s", 22 | "enable": [ 23 | null 24 | ] 25 | } 26 | ] 27 | } 28 | ''' 29 | 30 | # check args length 31 | if (len(sys.argv) != 3): 32 | print "usage %s ODL_IP_address Peer-NETCONF-Node" % \ 33 | sys.argv[0] 34 | sys.exit(1) 35 | 36 | odl_user = os.environ.get('ODL_USER', 'admin') 37 | odl_pass = os.environ.get('ODL_PASS', 'admin') 38 | 39 | req_hdrs = { 'Content-Type' : 'application/json' } 40 | 41 | req_body = request_template % (sys.argv[1]) 42 | 43 | url = 'http://' + sys.argv[1] + ':8181' + \ 44 | '/restconf/config/network-topology:network-topology/topology' + \ 45 | '/topology-netconf/node/' + sys.argv[2] + '/yang-ext:mount' + \ 46 | '/Cisco-IOS-XR-mpls-te-cfg:mpls-te/global-attributes' + \ 47 | '/pce-attributes/peers/peer/' + sys.argv[1] 48 | 49 | resp = requests.put(url, data=req_body, headers=req_hdrs, auth=(odl_user, odl_pass)) 50 | 51 | print resp 52 | -------------------------------------------------------------------------------- /python/put-static-route.py: -------------------------------------------------------------------------------- 1 | """ 2 | put-static-route. 3 | 4 | adds static route to XR 5 | 6 | parameter: 7 | * ODL IP address 8 | * Peer XR NETCONF node 9 | * prefix 10 | * length 11 | * next-hop 12 | 13 | uses HTTP PUT with JSON payload 14 | """ 15 | 16 | import sys 17 | import os 18 | import requests 19 | 20 | request_template = ''' 21 | { 22 | "vrf-prefix": [ 23 | { 24 | "prefix": "%s", 25 | "prefix-length": %s, 26 | "vrf-route": { 27 | "vrf-next-hop-table": { 28 | "vrf-next-hop-next-hop-address": [ 29 | { 30 | "next-hop-address": "%s" 31 | } 32 | ] 33 | } 34 | } 35 | } 36 | ] 37 | } 38 | ''' 39 | 40 | # check args length 41 | if (len(sys.argv) != 6): 42 | print "usage %s ODL_IP_address NETCONF-Node prefix length nexthop" % \ 43 | sys.argv[0] 44 | sys.exit(1) 45 | 46 | odl_user = os.environ.get('ODL_USER', 'admin') 47 | odl_pass = os.environ.get('ODL_PASS', 'admin') 48 | 49 | req_hdrs = { 'Content-Type' : 'application/json' } 50 | 51 | req_body = request_template % (sys.argv[3], sys.argv[4], sys.argv[5]) 52 | 53 | url = 'http://' + sys.argv[1] + ':8181' + \ 54 | '/restconf/config/network-topology:network-topology/topology' + \ 55 | '/topology-netconf/node/' + sys.argv[2] + '/yang-ext:mount' + \ 56 | '/Cisco-IOS-XR-ip-static-cfg:router-static/default-vrf' + \ 57 | '/address-family/vrfipv4/vrf-unicast/vrf-prefixes/vrf-prefix/' + \ 58 | sys.argv[3] + '/' + sys.argv[4] 59 | 60 | resp = requests.put(url, data=req_body, headers=req_hdrs, auth=(odl_user, odl_pass)) 61 | 62 | print resp 63 | -------------------------------------------------------------------------------- /restart-odl: -------------------------------------------------------------------------------- 1 | ./stop-odl 2 | ./delete-odl 3 | ./unpack-odl 4 | ./setup-odl 5 | ./start-odl 6 | -------------------------------------------------------------------------------- /setup-odl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./parameters 4 | unamestr=$(uname) 5 | mkdir -p $DISTRO/etc/opendaylight/karaf 6 | 7 | if [ -e "./setup-done" ]; then 8 | echo "already configured" 9 | else 10 | echo "configuring logging and features" 11 | 12 | if [ $VERSION == 'Oxygen' ]; then 13 | awk '{ print "log4j2.logger."$0".name = org.opendaylight."$0; print "log4j2.logger."$0".level = TRACE" }' logs >> $DISTRO/etc/org.ops4j.pax.logging.cfg 14 | else 15 | if [ $unamestr == 'Darwin' ]; then 16 | sed -i '' 's/1MB/10000MB/' $DISTRO/etc/org.ops4j.pax.logging.cfg 17 | elif [ $unamestr == 'Linux' ]; then 18 | sed -i 's/1MB/10000MB/' $DISTRO/etc/org.ops4j.pax.logging.cfg 19 | fi 20 | 21 | awk '{ print "log4j.logger.org.opendaylight."$0" = TRACE" }' logs >> $DISTRO/etc/org.ops4j.pax.logging.cfg 22 | fi 23 | 24 | if [ $unamestr == 'Darwin' ]; then 25 | ep=\'\' 26 | else 27 | ep='' 28 | fi 29 | 30 | # add features 31 | if [ $VERSION == 'Oxygen' ]; then 32 | sed -i $ep '/^featuresBoot = / s/$/,'$FEATURES'/' $DISTRO/etc/org.apache.karaf.features.cfg 33 | elif [ $VERSION == 'Nitrogen' ]; then 34 | sed -i $ep '/wrap/ s/$/,'$FEATURES'/' $DISTRO/etc/org.apache.karaf.features.cfg 35 | else 36 | sed -i $ep '/^featuresBoot=/ s/$/,'$FEATURES'/' $DISTRO/etc/org.apache.karaf.features.cfg 37 | fi 38 | 39 | touch "./setup-done" 40 | fi 41 | -------------------------------------------------------------------------------- /start-odl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./parameters 4 | 5 | rm -rf $DISTRO/data 6 | rm -rf $DISTRO/etc/opendaylight/current 7 | rm -rf $DISTRO/cache 8 | rm -rf $DISTRO/journal 9 | rm -rf $DISTRO/snapshots 10 | rm -rf $DISTRO/instances 11 | 12 | source $DISTRO/bin/setenv 13 | $DISTRO/bin/start 14 | 15 | unamestr=$(uname) 16 | 17 | while true; 18 | do 19 | if [ $(netstat -an | grep 8181 | grep LISTEN| wc -l) != 0 ] 20 | then 21 | if [ $VERSION == 'Oxygen' ]; then 22 | echo "ODL is ready" 23 | exit 0 24 | else 25 | echo "ODL is nearly ready" 26 | break 27 | fi 28 | else 29 | echo "ODL is starting" 30 | sleep 5 31 | fi 32 | done 33 | 34 | while true; 35 | do 36 | ready=$(curl http://admin:admin@localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/controller-config 2>&1) 37 | if echo $ready | grep -q "connected"; 38 | then 39 | echo "ODL is ready!" 40 | exit 0 41 | else 42 | echo "ODL is almost ready" 43 | sleep 5 44 | fi 45 | done 46 | -------------------------------------------------------------------------------- /start-vpn: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# != 3 ] 4 | then 5 | echo "usage $0 site (lon/rtp/sng/chi) username password" 6 | exit 1 7 | fi 8 | 9 | echo $3 | sudo openconnect -u $2 --passwd-on-stdin https://dcloud-$1-anyconnect.cisco.com & 10 | 11 | -------------------------------------------------------------------------------- /stop-odl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source ./parameters 3 | echo $DISTRO 4 | $DISTRO/bin/stop 5 | 6 | while true; 7 | do 8 | up=$(/bin/ps -ef | grep karaf | wc -l) 9 | if [ $up == 1 ] 10 | then 11 | echo "ODL has stopped" 12 | exit 0 13 | else 14 | echo "waiting for ODL to stop" 15 | sleep 5 16 | fi 17 | done 18 | 19 | -------------------------------------------------------------------------------- /stop-vpn: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo kill -9 $(pidof openconnect) 4 | -------------------------------------------------------------------------------- /unpack-odl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tar -xzf images/* 4 | -------------------------------------------------------------------------------- /vagrant/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # All Vagrant configuration is done below. The "2" in Vagrant.configure 5 | # configures the configuration version (we support older styles for 6 | # backwards compatibility). Please don't change it unless you know what 7 | # you're doing. 8 | Vagrant.configure(2) do |config| 9 | # The most common configuration options are documented and commented below. 10 | # For a complete reference, please see the online documentation at 11 | # https://docs.vagrantup.com. 12 | 13 | # Every Vagrant development environment requires a box. You can search for 14 | # boxes at https://atlas.hashicorp.com/search. 15 | config.vm.box = "ubuntu/xenial64" 16 | config.vm.provision :shell, path: "bootstrap.sh" 17 | 18 | config.vm.network "private_network", type: "dhcp" 19 | 20 | config.vm.provider "virtualbox" do |v| 21 | v.memory = 8192 22 | v.cpus = 2 23 | end 24 | config.vm.provider "vmware_fusion" do |v| 25 | v.vmx["memsize"] = "8192" 26 | v.vmx["numvcpus"] = "2" 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /vagrant/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo -e '\012' | apt-add-repository ppa:webupd8team/java 4 | apt-get -qq update 5 | echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections 6 | apt-get -qq install oracle-java8-installer &>/dev/null 7 | apt-get -qq install oracle-java8-set-default 8 | echo JAVA_HOME="/usr/lib/jvm/java-8-oracle" >> /etc/environment 9 | source /etc/environment 10 | apt-get -qq install git 11 | apt-get -qq install zip 12 | apt-get -qq install openconnect 13 | apt-get -qq install mininet 14 | apt-get -qq install python-pip 15 | pip install pyang 16 | echo "cloning scripts" 17 | git clone -q https://github.com/CiscoDevNet/opendaylight-setup.git ODL 18 | cd ODL 19 | mkdir images 20 | cd images 21 | echo "downloading ODL distro" 22 | wget -q https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/karaf/0.8.2/karaf-0.8.2.tar.gz 23 | cd .. 24 | echo "unpacking ODL distro" 25 | ./unpack-odl 26 | cd .. 27 | chown -R vagrant:vagrant * 28 | echo "ready!" 29 | -------------------------------------------------------------------------------- /xrvr-5/README.md: -------------------------------------------------------------------------------- 1 | # xrvr-5 2 | 3 | This directory contains setup scripts for a 5 node XRv topology. 4 | 5 | Copy the contents of this directory into the opendaylight-setup directory to get the correct nodes/parameters files and to provide the various scripts. Then copy the *.config files into your TFTP server directory. 6 | 7 | Next run ./XRget.sh to get the XR image from the repo. 8 | 9 | Then run ./XRcopy.sh to copy your XR image to 5 files called e.g. xrvr-a.vmdk, xrvr-b.vmdk. (modify this script if not using .vmdks). 10 | 11 | Then run ./XRstart.sh and then ./XRsetup.sh to initialise the nodes. 12 | 13 | Once the nodes are up and configured you can point ODL at them by using the unpack-odl, setup-odl, start-odl and config-odl scripts. 14 | 15 | On subsequent launches you only need ./XRstart.sh. 16 | 17 | ### Key scripts are: 18 | 19 | **XRget.sh** gets the XR image from the repo. Takes 2 parameters: 20 | 21 | 1. CCO ID 22 | 2. API key 23 | 24 | please see https://xrdocs.github.io/getting-started/steps-download-iosxr-vagrant (though here we get the .iso not the .box) 25 | 26 | **XRcopy.sh** copies the XR image once for each node (e.g. to xrvr-a.vmdk). 27 | 28 | **XRstart.sh** runs all XR nodes in the correct order. Calls xrvr-a.sh etc. 29 | 30 | **XRstop.sh** kills all XR nodes by finding kvm/qemu processes. 31 | 32 | **XRsetup.sh** initialises all XR nodes. Calls XRloader.exp for each node. 33 | 34 | **XRloader.exp** used to initialise an XR node. Takes 3 parameters: 35 | 36 | 1. hostname 37 | 2. management IP address 38 | 3. virtual serial port 39 | 40 | additional variables for username, password, management subnet mask etc. are inline in the script. 41 | 42 | the script is written in expect so that will be required on your server. 43 | 44 | ### Additional files are: 45 | 46 | **xrvr-a.sh to xrvr-e.sh** QEMU/KVM start scripts for XR. These may need to be modified if not using .vmdks or if your machine setup is different. 47 | 48 | **xrvr-a.config to xrvr-e.config** Initial configs for the 5 nodes. 49 | 50 | **nodes** list of hostnames and IP addresses 51 | 52 | **parameters** parameters 53 | 54 | **topology.pdf** shows the topology of the network. 55 | 56 | 57 | -------------------------------------------------------------------------------- /xrvr-5/XRcopy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | while read -r line 4 | do 5 | name=$(echo $line | cut -f2 -d" ") 6 | echo $name 7 | cp $1 ./$name.qcow2 8 | done < nodes 9 | -------------------------------------------------------------------------------- /xrvr-5/XRget.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ISOURL="https://devhub.cisco.com/artifactory/appdevci-release/XRv64/6.2.1/iosxrv-fullk9-x64.iso" 4 | 5 | curl -u $1:$2 $ISOURL --output ./iosxrv-fullk9-x64.iso 6 | -------------------------------------------------------------------------------- /xrvr-5/XRloader.exp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | # 3 | # Giles Heron - 20150707 4 | # with acknowledgements to Niklas Montin 5 | # 6 | 7 | proc init {user pass} { 8 | set ready 0 9 | send "\r" 10 | while { $ready == 0 } { 11 | expect { 12 | "Startup-code initializing" { 13 | } 14 | "Booting with committed software" { 15 | } 16 | "Press RETURN to get started." { 17 | send "\r" 18 | } 19 | "root-system username:" { 20 | send "$user\r" 21 | expect "secret:" 22 | send "$pass\r" 23 | expect "again:" 24 | send "$pass\r" 25 | } 26 | "Username:" { 27 | send "$user\r" 28 | expect "Password:" 29 | send "$pass\r" 30 | } 31 | "#" { 32 | send_user "ready\r" 33 | set ready 1 34 | } 35 | } 36 | } 37 | } 38 | 39 | proc setkey { } { 40 | send -- "crypto key generate dsa\r" 41 | expect { 42 | "1024]" { 43 | send -- "\r" 44 | send -- "\r" 45 | expect "#" 46 | send_user "New key set\r" 47 | } 48 | "yes/no]:" { 49 | send -- "no\r" 50 | send_user "Crypto key was set\r" 51 | } 52 | } 53 | } 54 | 55 | proc unshut { } { 56 | send "conf t\r" 57 | expect "(config)#" 58 | send "no int MgmtEth 0/0/CPU0/0 shut\r" 59 | expect "(config)#" 60 | send "no int GigabitEthernet 0/0/0/0 shut\r" 61 | expect "(config)#" 62 | send "no int GigabitEthernet 0/0/0/1 shut\r" 63 | expect "(config)#" 64 | send "no int GigabitEthernet 0/0/0/2 shut\r" 65 | expect "(config)#" 66 | send "no int GigabitEthernet 0/0/0/3 shut\r" 67 | expect "(config)#" 68 | } 69 | 70 | proc setip {ip mask} { 71 | send "int MgmtEth 0/0/CPU0/0 ipv4 address $ip/$mask\r" 72 | expect "(config)#" 73 | } 74 | 75 | proc commit { } { 76 | send "commit\r" 77 | expect "(config)#" 78 | send "end\r" 79 | expect "#" 80 | } 81 | 82 | proc config {host name} { 83 | send "copy tftp: run\r" 84 | expect "\?" 85 | send "$host\r" 86 | expect "\?" 87 | send "$name\r" 88 | expect "$name#" 89 | send_user "device $name configured\r" 90 | } 91 | 92 | set username cisco 93 | set password cisco 94 | set localhost 127.0.0.1 95 | set mask 27 # mask for management subnet 96 | set host 172.23.29.120 # IP address of this host 97 | 98 | set timeout 120 99 | spawn telnet $localhost [lindex $argv 2] 100 | init $username $password 101 | # expect "SYSTEM CONFIGURATION COMPLETED" 102 | setkey 103 | unshut 104 | setip [lindex $argv 1] $mask 105 | commit 106 | config $host [lindex $argv 0] 107 | set timeout 1 108 | expect "sometotalrubbish" 109 | 110 | send_user " \n\r" 111 | -------------------------------------------------------------------------------- /xrvr-5/XRsetup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./parameters 4 | 5 | i=0 6 | j=1 7 | while read -r line 8 | do 9 | let "i++" 10 | addr=$(echo $line | cut -f1 -d" ") 11 | name=$(echo $line | cut -f2 -d" ") 12 | ./XRloader.exp $name $addr $PORT_PREFIX$i$j 13 | done < nodes 14 | -------------------------------------------------------------------------------- /xrvr-5/XRstart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | while read -r line 4 | do 5 | sudo ./$(echo $line | cut -f2 -d" ").sh 6 | done < nodes 7 | -------------------------------------------------------------------------------- /xrvr-5/XRstop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./parameters 4 | 5 | while read -r line 6 | do 7 | name=$(echo $line | cut -f2 -d" ") 8 | sudo kill -9 $(ps aux | grep 'qemu-system-x86_64' | grep $name | awk '{print $2}') 9 | done < nodes 10 | -------------------------------------------------------------------------------- /xrvr-5/nodes: -------------------------------------------------------------------------------- 1 | 172.23.29.116 xrvr-a 2 | 172.23.29.117 xrvr-b 3 | 172.23.29.118 xrvr-c 4 | 172.23.29.119 xrvr-d 5 | 172.23.29.125 xrvr-e 6 | -------------------------------------------------------------------------------- /xrvr-5/parameters: -------------------------------------------------------------------------------- 1 | DISTRO=distribution-karaf-0.6.0-Carbon 2 | 3 | ODL_USER=admin 4 | ODL_PASS=admin 5 | 6 | BGP_PEER=172.23.29.116 7 | BGP_NODE=xrvr-a 8 | BGP_NEXT_HOP=172.23.29.120 9 | LOCAL_AS=65504 10 | REMOTE_AS=65504 11 | 12 | NETCONF_PORT=830 13 | NETCONF_USER=cisco 14 | NETCONF_PASS=cisco 15 | 16 | PORT_PREFIX=90 17 | 18 | FEATURES=odl-dlux-all,odl-restconf-all,odl-netconf-all,odl-netconf-topology,odl-bgpcep-bgp,odl-bgpcep-pcep,odl-netconf-connector-all 19 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/opendaylight-setup/6fcd6a050d831314a15eb765a81a9e5a8779ef4b/xrvr-5/xrvr-5.pdf -------------------------------------------------------------------------------- /xrvr-5/xrvr-a.config: -------------------------------------------------------------------------------- 1 | !! IOS XR Configuration 6.0.2 2 | !! Last configuration change at Mon Aug 22 08:42:54 2016 by xrvr 3 | ! 4 | hostname xrvr-a 5 | clock timezone PST -8 6 | clock summer-time MET recurring last sunday march 02:00 last sunday october 03:00 7 | logging console informational 8 | logging facility local0 9 | logging 172.23.29.120 vrf default severity debugging port default 10 | logging hostnameprefix xrvr-a 11 | telnet vrf default ipv4 server max-servers 100 12 | domain name cisco.com 13 | cdp 14 | ntp 15 | server 172.23.29.120 16 | ! 17 | ipv4 unnumbered mpls traffic-eng Loopback0 18 | interface Loopback0 19 | description Router ID 20 | ipv4 address 192.168.99.1 255.255.255.255 21 | ! 22 | interface Loopback1 23 | description BGP reachable 24 | ipv4 address 192.168.108.1 255.255.254.0 25 | ! 26 | interface MgmtEth0/0/CPU0/0 27 | description Management 28 | ipv4 address 172.23.29.121 255.255.255.224 29 | ! 30 | interface GigabitEthernet0/0/0/0 31 | description first link to xrvr-b 32 | cdp 33 | ipv4 address 192.168.100.1 255.255.255.0 34 | ! 35 | interface GigabitEthernet0/0/0/1 36 | description second link to xrvr-b 37 | cdp 38 | ipv4 address 192.168.101.1 255.255.255.0 39 | ! 40 | interface GigabitEthernet0/0/0/2 41 | description link to xrvr-c 42 | cdp 43 | ipv4 address 192.168.102.1 255.255.255.0 44 | ! 45 | interface GigabitEthernet0/0/0/3 46 | description link to xrvr-d 47 | cdp 48 | ipv4 address 192.168.103.1 255.255.255.0 49 | ! 50 | router static 51 | address-family ipv4 unicast 52 | 0.0.0.0/0 172.23.29.97 description default 53 | ! 54 | ! 55 | router isis xrvr 56 | is-type level-2-only 57 | net 47.0004.004d.00C0.00A8.0084.0001.00 58 | segment-routing global-block 16000 16099 59 | distribute bgp-ls 60 | address-family ipv4 unicast 61 | metric-style wide 62 | mpls traffic-eng level-2-only 63 | mpls traffic-eng router-id Loopback0 64 | segment-routing mpls sr-prefer 65 | segment-routing prefix-sid-map receive 66 | segment-routing prefix-sid-map advertise-local 67 | ! 68 | interface Loopback0 69 | passive 70 | address-family ipv4 unicast 71 | metric 1 72 | prefix-sid index 0 73 | ! 74 | ! 75 | interface GigabitEthernet0/0/0/0 76 | point-to-point 77 | address-family ipv4 unicast 78 | metric 10 79 | ! 80 | ! 81 | interface GigabitEthernet0/0/0/1 82 | point-to-point 83 | address-family ipv4 unicast 84 | metric 10 85 | ! 86 | ! 87 | interface GigabitEthernet0/0/0/2 88 | point-to-point 89 | address-family ipv4 unicast 90 | metric 10 91 | ! 92 | ! 93 | interface GigabitEthernet0/0/0/3 94 | point-to-point 95 | address-family ipv4 unicast 96 | metric 10 97 | ! 98 | ! 99 | ! 100 | router bgp 65504 101 | bgp router-id 192.168.99.1 102 | address-family ipv4 unicast 103 | network 192.168.108.0/23 104 | ! 105 | address-family link-state link-state 106 | ! 107 | neighbor 172.23.29.120 108 | remote-as 65504 109 | address-family ipv4 unicast 110 | route-reflector-client 111 | ! 112 | address-family link-state link-state 113 | ! 114 | ! 115 | neighbor 192.168.99.2 116 | remote-as 65504 117 | update-source Loopback0 118 | address-family ipv4 unicast 119 | ! 120 | ! 121 | neighbor 192.168.99.3 122 | remote-as 65504 123 | update-source Loopback0 124 | address-family ipv4 unicast 125 | route-reflector-client 126 | ! 127 | ! 128 | neighbor 192.168.99.4 129 | remote-as 65504 130 | update-source Loopback0 131 | address-family ipv4 unicast 132 | route-reflector-client 133 | ! 134 | ! 135 | neighbor 192.168.99.5 136 | remote-as 65504 137 | update-source Loopback0 138 | address-family ipv4 unicast 139 | route-reflector-client 140 | ! 141 | ! 142 | ! 143 | mpls traffic-eng 144 | interface GigabitEthernet0/0/0/0 145 | admin-weight 5 146 | ! 147 | interface GigabitEthernet0/0/0/1 148 | ! 149 | interface GigabitEthernet0/0/0/2 150 | ! 151 | interface GigabitEthernet0/0/0/3 152 | ! 153 | pce 154 | peer ipv4 172.23.29.120 155 | ! 156 | segment-routing 157 | stateful-client 158 | instantiation 159 | cisco-extension 160 | delegation 161 | ! 162 | ! 163 | auto-tunnel pcc 164 | tunnel-id min 101 max 200 165 | ! 166 | reoptimize timers delay installation 0 167 | ! 168 | netconf-yang agent 169 | ssh 170 | ! 171 | ssh server v2 172 | ssh server netconf vrf default 173 | ssh timeout 120 174 | end 175 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-a.sh: -------------------------------------------------------------------------------- 1 | sudo qemu-system-x86_64 -daemonize -display none -enable-kvm -machine accel=kvm -smp cores=2 -m 4096 \ 2 | -hda ./xrvr-a.qcow2 \ 3 | -serial telnet::9011,server,nowait -serial telnet::9012,server,nowait \ 4 | -net nic,model=virtio,vlan=0,macaddr=00:22:00:ff:0A:00 -net tap,vlan=0,script=/etc/qemu-ifup \ 5 | -net nic,model=virtio,vlan=1,macaddr=00:22:00:ff:0A:01 -net socket,vlan=1,listen=127.0.0.1:14000 \ 6 | -net nic,model=virtio,vlan=2,macaddr=00:22:00:ff:0A:02 -net socket,vlan=2,listen=127.0.0.1:15000 \ 7 | -net nic,model=virtio,vlan=3,macaddr=00:22:00:ff:0A:03 -net socket,vlan=3,listen=127.0.0.1:16000 \ 8 | -net nic,model=virtio,vlan=4,macaddr=00:22:00:ff:0A:04 -net socket,vlan=4,listen=127.0.0.1:19000 9 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-b.config: -------------------------------------------------------------------------------- 1 | !! IOS XR Configuration 6.0.2 2 | !! Last configuration change at Mon Aug 22 08:42:28 2016 by xrvr 3 | ! 4 | hostname xrvr-b 5 | clock timezone PST -8 6 | clock summer-time MET recurring last sunday march 02:00 last sunday october 03:00 7 | logging console informational 8 | logging facility local0 9 | logging 172.23.29.120 vrf default severity debugging port default 10 | logging hostnameprefix xrvr-b 11 | telnet vrf default ipv4 server max-servers 100 12 | domain name cisco.com 13 | cdp 14 | ntp 15 | server 172.23.29.120 16 | ! 17 | ipv4 unnumbered mpls traffic-eng Loopback0 18 | interface Loopback0 19 | description Router ID 20 | ipv4 address 192.168.99.2 255.255.255.255 21 | ! 22 | interface Loopback1 23 | description BGP reachable 24 | ipv4 address 192.168.110.2 255.255.254.0 25 | ! 26 | interface MgmtEth0/0/CPU0/0 27 | description Management 28 | ipv4 address 172.23.29.122 255.255.255.224 29 | ! 30 | interface GigabitEthernet0/0/0/0 31 | description first link to xrvr-a 32 | cdp 33 | ipv4 address 192.168.100.2 255.255.255.0 34 | ! 35 | interface GigabitEthernet0/0/0/1 36 | description second link to xrvr-a 37 | cdp 38 | ipv4 address 192.168.101.2 255.255.255.0 39 | ! 40 | interface GigabitEthernet0/0/0/2 41 | description link to xrvr-c 42 | cdp 43 | ipv4 address 192.168.104.2 255.255.255.0 44 | ! 45 | interface GigabitEthernet0/0/0/3 46 | description link to xrvr-d 47 | cdp 48 | ipv4 address 192.168.105.2 255.255.255.0 49 | ! 50 | router static 51 | address-family ipv4 unicast 52 | 0.0.0.0/0 172.23.29.97 description default 53 | ! 54 | ! 55 | router isis xrvr 56 | is-type level-2-only 57 | net 47.0004.004d.00C0.00A8.0084.0002.00 58 | segment-routing global-block 16000 16099 59 | address-family ipv4 unicast 60 | metric-style wide 61 | mpls traffic-eng level-2-only 62 | mpls traffic-eng router-id Loopback0 63 | segment-routing mpls sr-prefer 64 | segment-routing prefix-sid-map receive 65 | segment-routing prefix-sid-map advertise-local 66 | ! 67 | interface Loopback0 68 | passive 69 | address-family ipv4 unicast 70 | metric 1 71 | prefix-sid index 1 72 | ! 73 | ! 74 | interface GigabitEthernet0/0/0/0 75 | point-to-point 76 | address-family ipv4 unicast 77 | metric 10 78 | ! 79 | ! 80 | interface GigabitEthernet0/0/0/1 81 | point-to-point 82 | address-family ipv4 unicast 83 | metric 10 84 | ! 85 | ! 86 | interface GigabitEthernet0/0/0/2 87 | point-to-point 88 | address-family ipv4 unicast 89 | metric 10 90 | ! 91 | ! 92 | interface GigabitEthernet0/0/0/3 93 | point-to-point 94 | address-family ipv4 unicast 95 | metric 10 96 | ! 97 | ! 98 | ! 99 | router bgp 65504 100 | bgp router-id 192.168.99.2 101 | address-family ipv4 unicast 102 | network 192.168.110.0/23 103 | ! 104 | neighbor 192.168.99.1 105 | remote-as 65504 106 | update-source Loopback0 107 | address-family ipv4 unicast 108 | ! 109 | ! 110 | neighbor 192.168.99.3 111 | remote-as 65504 112 | update-source Loopback0 113 | address-family ipv4 unicast 114 | route-reflector-client 115 | ! 116 | ! 117 | neighbor 192.168.99.4 118 | remote-as 65504 119 | update-source Loopback0 120 | address-family ipv4 unicast 121 | route-reflector-client 122 | ! 123 | ! 124 | neighbor 192.168.99.5 125 | remote-as 65504 126 | update-source Loopback0 127 | address-family ipv4 unicast 128 | route-reflector-client 129 | ! 130 | ! 131 | ! 132 | mpls traffic-eng 133 | interface GigabitEthernet0/0/0/0 134 | admin-weight 5 135 | ! 136 | interface GigabitEthernet0/0/0/1 137 | ! 138 | interface GigabitEthernet0/0/0/2 139 | ! 140 | interface GigabitEthernet0/0/0/3 141 | ! 142 | pce 143 | peer ipv4 172.23.29.120 144 | ! 145 | segment-routing 146 | stateful-client 147 | instantiation 148 | cisco-extension 149 | delegation 150 | ! 151 | ! 152 | auto-tunnel pcc 153 | tunnel-id min 101 max 200 154 | ! 155 | reoptimize timers delay installation 0 156 | ! 157 | netconf-yang agent 158 | ssh 159 | ! 160 | ssh server v2 161 | ssh server netconf vrf default 162 | ssh timeout 120 163 | end 164 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-b.sh: -------------------------------------------------------------------------------- 1 | sudo qemu-system-x86_64 -daemonize -display none -enable-kvm -machine accel=kvm -smp cores=2 -m 4096 \ 2 | -hda ./xrvr-b.qcow2 \ 3 | -serial telnet::9021,server,nowait -serial telnet::9022,server,nowait \ 4 | -net nic,model=virtio,vlan=0,macaddr=00:22:00:ff:0B:00 -net tap,vlan=0,script=/etc/qemu-ifup \ 5 | -net nic,model=virtio,vlan=1,macaddr=00:22:00:ff:0B:01 -net socket,vlan=1,connect=127.0.0.1:14000 \ 6 | -net nic,model=virtio,vlan=2,macaddr=00:22:00:ff:0A:02 -net socket,vlan=2,listen=127.0.0.1:17000 \ 7 | -net nic,model=virtio,vlan=3,macaddr=00:22:00:ff:0B:03 -net socket,vlan=3,listen=127.0.0.1:18000 \ 8 | -net nic,model=virtio,vlan=4,macaddr=00:22:00:ff:0B:04 -net socket,vlan=4,connect=127.0.0.1:19000 9 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-c.config: -------------------------------------------------------------------------------- 1 | !! IOS XR Configuration 6.0.2 2 | !! Last configuration change at Mon Aug 22 08:41:41 2016 by xrvr 3 | ! 4 | hostname xrvr-c 5 | clock timezone PST -8 6 | clock summer-time MET recurring last sunday march 02:00 last sunday october 03:00 7 | logging console informational 8 | logging facility local0 9 | logging 172.23.29.120 vrf default severity debugging port default 10 | logging hostnameprefix xrvr-c 11 | telnet vrf default ipv4 server max-servers 100 12 | domain name cisco.com 13 | cdp 14 | ntp 15 | server 172.23.29.120 16 | ! 17 | ipv4 unnumbered mpls traffic-eng Loopback0 18 | interface Loopback0 19 | description Router ID 20 | ipv4 address 192.168.99.3 255.255.255.255 21 | ! 22 | interface Loopback1 23 | description BGP reachable 24 | ipv4 address 192.168.112.3 255.255.254.0 25 | ! 26 | interface Loopback2 27 | description BGP reachable 2 28 | ipv4 address 192.168.114.3 255.255.254.0 29 | ! 30 | interface MgmtEth0/0/CPU0/0 31 | description Management 32 | ipv4 address 172.23.29.123 255.255.255.224 33 | ! 34 | interface GigabitEthernet0/0/0/0 35 | description link to xrvr-a 36 | cdp 37 | ipv4 address 192.168.102.3 255.255.255.0 38 | ! 39 | interface GigabitEthernet0/0/0/1 40 | description link to xrvr-b 41 | cdp 42 | ipv4 address 192.168.104.3 255.255.255.0 43 | ! 44 | interface GigabitEthernet0/0/0/2 45 | description link to xrvr-e 46 | cdp 47 | ipv4 address 192.168.106.3 255.255.255.0 48 | ! 49 | router static 50 | address-family ipv4 unicast 51 | 0.0.0.0/0 172.23.29.97 description default 52 | ! 53 | ! 54 | router isis xrvr 55 | is-type level-2-only 56 | net 47.0004.004d.00C0.00A8.0084.0003.00 57 | segment-routing global-block 16000 16099 58 | address-family ipv4 unicast 59 | metric-style wide 60 | mpls traffic-eng level-2-only 61 | mpls traffic-eng router-id Loopback0 62 | segment-routing mpls sr-prefer 63 | segment-routing prefix-sid-map receive 64 | segment-routing prefix-sid-map advertise-local 65 | ! 66 | interface Loopback0 67 | passive 68 | address-family ipv4 unicast 69 | metric 1 70 | prefix-sid index 2 71 | ! 72 | ! 73 | interface GigabitEthernet0/0/0/0 74 | point-to-point 75 | address-family ipv4 unicast 76 | metric 10 77 | ! 78 | ! 79 | interface GigabitEthernet0/0/0/1 80 | point-to-point 81 | address-family ipv4 unicast 82 | metric 10 83 | ! 84 | ! 85 | interface GigabitEthernet0/0/0/2 86 | point-to-point 87 | address-family ipv4 unicast 88 | metric 10 89 | ! 90 | ! 91 | ! 92 | router bgp 65504 93 | bgp router-id 192.168.99.3 94 | address-family ipv4 unicast 95 | network 192.168.112.0/23 96 | network 192.168.114.0/23 97 | ! 98 | neighbor 192.168.99.1 99 | remote-as 65504 100 | update-source Loopback0 101 | address-family ipv4 unicast 102 | ! 103 | ! 104 | neighbor 192.168.99.2 105 | remote-as 65504 106 | update-source Loopback0 107 | address-family ipv4 unicast 108 | ! 109 | ! 110 | ! 111 | mpls traffic-eng 112 | interface GigabitEthernet0/0/0/0 113 | ! 114 | interface GigabitEthernet0/0/0/1 115 | ! 116 | interface GigabitEthernet0/0/0/2 117 | ! 118 | pce 119 | peer ipv4 172.23.29.120 120 | ! 121 | segment-routing 122 | stateful-client 123 | instantiation 124 | cisco-extension 125 | delegation 126 | ! 127 | ! 128 | auto-tunnel pcc 129 | tunnel-id min 101 max 200 130 | ! 131 | reoptimize timers delay installation 0 132 | ! 133 | netconf-yang agent 134 | ssh 135 | ! 136 | ssh server v2 137 | ssh server netconf vrf default 138 | ssh timeout 120 139 | end 140 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-c.sh: -------------------------------------------------------------------------------- 1 | sudo qemu-system-x86_64 -daemonize -display none -enable-kvm -machine accel=kvm -smp cores=2 -m 4096 \ 2 | -hda ./xrvr-c.qcow2 \ 3 | -serial telnet::9031,server,nowait -serial telnet::9032,server,nowait \ 4 | -net nic,model=virtio,vlan=0,macaddr=00:22:00:ff:0C:00 -net tap,vlan=0,script=/etc/qemu-ifup \ 5 | -net nic,model=virtio,vlan=1,macaddr=00:22:00:ff:0C:01 -net socket,vlan=1,connect=127.0.0.1:15000 \ 6 | -net nic,model=virtio,vlan=2,macaddr=00:22:00:ff:0C:02 -net socket,vlan=2,connect=127.0.0.1:17000 \ 7 | -net nic,model=virtio,vlan=3,macaddr=00:22:00:ff:0C:03 -net socket,vlan=3,listen=127.0.0.1:20000 8 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-d.config: -------------------------------------------------------------------------------- 1 | !! IOS XR Configuration 6.0.2 2 | !! Last configuration change at Mon Aug 22 08:41:18 2016 by xrvr 3 | ! 4 | hostname xrvr-d 5 | clock timezone PST -8 6 | clock summer-time MET recurring last sunday march 02:00 last sunday october 03:00 7 | logging console informational 8 | logging facility local0 9 | logging 172.23.29.120 vrf default severity debugging port default 10 | logging hostnameprefix xrvr-d 11 | telnet vrf default ipv4 server max-servers 100 12 | domain name cisco.com 13 | cdp 14 | ntp 15 | server 172.23.29.120 16 | ! 17 | ipv4 unnumbered mpls traffic-eng Loopback0 18 | interface Loopback0 19 | description Router ID 20 | ipv4 address 192.168.99.4 255.255.255.255 21 | ! 22 | interface Loopback1 23 | description BGP reachable 24 | ipv4 address 192.168.116.4 255.255.254.0 25 | ! 26 | interface Loopback2 27 | description BGP reachable 2 28 | ipv4 address 192.168.118.4 255.255.254.0 29 | ! 30 | interface MgmtEth0/0/CPU0/0 31 | description Management 32 | ipv4 address 172.23.29.124 255.255.255.224 33 | ! 34 | interface GigabitEthernet0/0/0/0 35 | description link to xrvr-a 36 | cdp 37 | ipv4 address 192.168.103.4 255.255.255.0 38 | ! 39 | interface GigabitEthernet0/0/0/1 40 | description link to xrvr-b 41 | cdp 42 | ipv4 address 192.168.105.4 255.255.255.0 43 | ! 44 | interface GigabitEthernet0/0/0/2 45 | description link to xrvr-e 46 | cdp 47 | ipv4 address 192.168.107.4 255.255.255.0 48 | ! 49 | router static 50 | address-family ipv4 unicast 51 | 0.0.0.0/0 172.23.29.97 description default 52 | ! 53 | ! 54 | router isis xrvr 55 | is-type level-2-only 56 | net 47.0004.004d.00C0.00A8.0084.0004.00 57 | segment-routing global-block 16000 16099 58 | address-family ipv4 unicast 59 | metric-style wide 60 | mpls traffic-eng level-2-only 61 | mpls traffic-eng router-id Loopback0 62 | segment-routing mpls sr-prefer 63 | segment-routing prefix-sid-map receive 64 | segment-routing prefix-sid-map advertise-local 65 | ! 66 | interface Loopback0 67 | passive 68 | address-family ipv4 unicast 69 | metric 1 70 | prefix-sid index 3 71 | ! 72 | ! 73 | interface GigabitEthernet0/0/0/0 74 | point-to-point 75 | address-family ipv4 unicast 76 | metric 10 77 | ! 78 | ! 79 | interface GigabitEthernet0/0/0/1 80 | point-to-point 81 | address-family ipv4 unicast 82 | metric 10 83 | ! 84 | ! 85 | interface GigabitEthernet0/0/0/2 86 | point-to-point 87 | address-family ipv4 unicast 88 | metric 10 89 | ! 90 | ! 91 | ! 92 | router bgp 65504 93 | bgp router-id 192.168.99.4 94 | address-family ipv4 unicast 95 | network 192.168.116.0/23 96 | network 192.168.118.0/23 97 | ! 98 | neighbor 192.168.99.1 99 | remote-as 65504 100 | update-source Loopback0 101 | address-family ipv4 unicast 102 | ! 103 | ! 104 | neighbor 192.168.99.2 105 | remote-as 65504 106 | update-source Loopback0 107 | address-family ipv4 unicast 108 | ! 109 | ! 110 | ! 111 | mpls traffic-eng 112 | interface GigabitEthernet0/0/0/0 113 | ! 114 | interface GigabitEthernet0/0/0/1 115 | ! 116 | interface GigabitEthernet0/0/0/2 117 | ! 118 | pce 119 | peer ipv4 172.23.29.120 120 | ! 121 | segment-routing 122 | stateful-client 123 | instantiation 124 | cisco-extension 125 | delegation 126 | ! 127 | ! 128 | auto-tunnel pcc 129 | tunnel-id min 101 max 200 130 | ! 131 | reoptimize timers delay installation 0 132 | ! 133 | netconf-yang agent 134 | ssh 135 | ! 136 | ssh server v2 137 | ssh server netconf vrf default 138 | ssh timeout 120 139 | end 140 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-d.sh: -------------------------------------------------------------------------------- 1 | sudo qemu-system-x86_64 -daemonize -display none -enable-kvm -machine accel=kvm -smp cores=2 -m 4096 \ 2 | -hda ./xrvr-d.qcow2 \ 3 | -serial telnet::9041,server,nowait -serial telnet::9042,server,nowait \ 4 | -net nic,model=virtio,vlan=0,macaddr=00:22:00:ff:0D:00 -net tap,vlan=0,script=/etc/qemu-ifup \ 5 | -net nic,model=virtio,vlan=1,macaddr=00:22:00:ff:0D:01 -net socket,vlan=1,connect=127.0.0.1:16000 \ 6 | -net nic,model=virtio,vlan=2,macaddr=00:22:00:ff:0D:02 -net socket,vlan=2,connect=127.0.0.1:18000 \ 7 | -net nic,model=virtio,vlan=3,macaddr=00:22:00:ff:0D:03 -net socket,vlan=3,listen=127.0.0.1:21000 8 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-e.config: -------------------------------------------------------------------------------- 1 | !! IOS XR Configuration 6.0.2 2 | !! Last configuration change at Mon Aug 22 08:45:42 2016 by xrvr 3 | ! 4 | hostname xrvr-e 5 | clock timezone PST -8 6 | clock summer-time MET recurring last sunday march 02:00 last sunday october 03:00 7 | logging console informational 8 | logging facility local0 9 | logging 172.23.29.120 vrf default severity debugging port default 10 | logging hostnameprefix xrvr-e 11 | telnet vrf default ipv4 server max-servers 100 12 | domain name cisco.com 13 | cdp 14 | ntp 15 | server 172.23.29.120 16 | ! 17 | ipv4 unnumbered mpls traffic-eng Loopback0 18 | interface Loopback0 19 | description Router ID 20 | ipv4 address 192.168.99.5 255.255.255.255 21 | ! 22 | interface Loopback1 23 | description BGP reachable 24 | ipv4 address 192.168.120.5 255.255.248.0 25 | ! 26 | interface MgmtEth0/0/CPU0/0 27 | description Management 28 | ipv4 address 172.23.29.125 255.255.255.224 29 | ! 30 | interface GigabitEthernet0/0/0/0 31 | description link to xrvr-c 32 | cdp 33 | ipv4 address 192.168.106.5 255.255.255.0 34 | ! 35 | interface GigabitEthernet0/0/0/1 36 | description link to xrvr-d 37 | cdp 38 | ipv4 address 192.168.107.5 255.255.255.0 39 | ! 40 | router static 41 | address-family ipv4 unicast 42 | 0.0.0.0/0 172.23.29.97 description default 43 | ! 44 | ! 45 | router isis xrvr 46 | is-type level-2-only 47 | net 47.0004.004d.00C0.00A8.0084.0005.00 48 | segment-routing global-block 16000 16099 49 | address-family ipv4 unicast 50 | metric-style wide 51 | mpls traffic-eng level-2-only 52 | mpls traffic-eng router-id Loopback0 53 | segment-routing mpls sr-prefer 54 | segment-routing prefix-sid-map receive 55 | segment-routing prefix-sid-map advertise-local 56 | ! 57 | interface Loopback0 58 | passive 59 | address-family ipv4 unicast 60 | metric 1 61 | prefix-sid index 4 62 | ! 63 | ! 64 | interface GigabitEthernet0/0/0/0 65 | point-to-point 66 | address-family ipv4 unicast 67 | metric 10 68 | ! 69 | ! 70 | interface GigabitEthernet0/0/0/1 71 | point-to-point 72 | address-family ipv4 unicast 73 | metric 10 74 | ! 75 | ! 76 | ! 77 | router bgp 65504 78 | bgp router-id 192.168.99.5 79 | address-family ipv4 unicast 80 | network 192.168.120.0/21 81 | ! 82 | neighbor 192.168.99.1 83 | remote-as 65504 84 | update-source Loopback0 85 | address-family ipv4 unicast 86 | ! 87 | ! 88 | neighbor 192.168.99.2 89 | remote-as 65504 90 | update-source Loopback0 91 | address-family ipv4 unicast 92 | ! 93 | ! 94 | ! 95 | mpls traffic-eng 96 | interface GigabitEthernet0/0/0/0 97 | ! 98 | interface GigabitEthernet0/0/0/1 99 | ! 100 | interface GigabitEthernet0/0/0/2 101 | ! 102 | pce 103 | peer ipv4 172.23.29.120 104 | ! 105 | segment-routing 106 | stateful-client 107 | instantiation 108 | cisco-extension 109 | delegation 110 | ! 111 | ! 112 | auto-tunnel pcc 113 | tunnel-id min 101 max 200 114 | ! 115 | reoptimize timers delay installation 0 116 | ! 117 | netconf-yang agent 118 | ssh 119 | ! 120 | ssh server v2 121 | ssh server netconf vrf default 122 | ssh timeout 120 123 | end 124 | -------------------------------------------------------------------------------- /xrvr-5/xrvr-e.sh: -------------------------------------------------------------------------------- 1 | sudo qemu-system-x86_64 -daemonize -display none -enable-kvm -machine accel=kvm -smp cores=2 -m 4096 \ 2 | -hda ./xrvr-e.qcow2 \ 3 | -serial telnet::9051,server,nowait -serial telnet::9052,server,nowait \ 4 | -net nic,model=virtio,vlan=0,macaddr=00:22:00:ff:0E:00 -net tap,vlan=0,script=/etc/qemu-ifup \ 5 | -net nic,model=virtio,vlan=1,macaddr=00:22:00:ff:0E:01 -net socket,vlan=1,connect=127.0.0.1:20000 \ 6 | -net nic,model=virtio,vlan=2,macaddr=00:22:00:ff:0E:02 -net socket,vlan=2,connect=127.0.0.1:21000 \ 7 | --------------------------------------------------------------------------------