Now, run the controller. You can run it on one of your test systems or on a third system.
On test host 1, cd to the directory containing the testOfOverlay
script and run:
CONTROLLER=10.160.31.238 sudo ./testOfOverlay.py --local s1 --controller ${CONTROLLER}
You’ll need to replace the CONTROLLER
address with the IP address of the system where you ran your controller. This will run mininet and set up the hosts that are configured as attached to s1. When you’re finished running this, you’ll be at a mininet prompt, but you won’t be able to do anything because the policy is not set up.
The output will look like:
$ sudo ./testOfOverlay.py --local s1 --controller 10.160.31.238 *** Configuring hosts h35_2 h35_3 h36_2 h36_3 *** Starting controller *** Starting 1 switches s1 POST http://10.160.31.238:8080/restconf/operations/endpoint:register-endpoint { "input": { "endpoint-group": "1eaf9a67-a171-42a8-9282-71cf702f61dd", "l2-context": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6", "l3-address": [ { "ip-address": "10.0.35.2", "l3-context": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "mac-address": "00:00:00:00:35:02", "ofoverlay:node-connector-id": "openflow:1:1", "ofoverlay:node-id": "openflow:1", "tenant": "f5c7d344-d1c7-4208-8531-2c2693657e12" } } POST http://10.160.31.238:8080/restconf/operations/endpoint:register-endpoint { "input": { "endpoint-group": "1eaf9a67-a171-42a8-9282-71cf702f61dd", "l2-context": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6", "l3-address": [ { "ip-address": "10.0.35.3", "l3-context": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "mac-address": "00:00:00:00:35:03", "ofoverlay:node-connector-id": "openflow:1:2", "ofoverlay:node-id": "openflow:1", "tenant": "f5c7d344-d1c7-4208-8531-2c2693657e12" } } POST http://10.160.31.238:8080/restconf/operations/endpoint:register-endpoint { "input": { "endpoint-group": "e593f05d-96be-47ad-acd5-ba81465680d5", "l2-context": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6", "l3-address": [ { "ip-address": "10.0.36.2", "l3-context": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "mac-address": "00:00:00:00:36:02", "ofoverlay:node-connector-id": "openflow:1:3", "ofoverlay:node-id": "openflow:1", "tenant": "f5c7d344-d1c7-4208-8531-2c2693657e12" } } POST http://10.160.31.238:8080/restconf/operations/endpoint:register-endpoint { "input": { "endpoint-group": "e593f05d-96be-47ad-acd5-ba81465680d5", "l2-context": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6", "l3-address": [ { "ip-address": "10.0.36.3", "l3-context": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "mac-address": "00:00:00:00:36:03", "ofoverlay:node-connector-id": "openflow:1:4", "ofoverlay:node-id": "openflow:1", "tenant": "f5c7d344-d1c7-4208-8531-2c2693657e12" } } *** Starting CLI: mininet>
On test host 2, you’ll do the same but run instead:
CONTROLLER=10.160.31.238 sudo ./testOfOverlay.py --local s2 --controller ${CONTROLLER} --policy
This will run mininet on the other system, and also install all the policy required to enable the connectivity.
The output will look like:
$ sudo ./testOfOverlay.py --local s2 --controller ${CONTROLLER} --policy *** Configuring hosts h35_4 h35_5 h36_4 h36_5 *** Starting controller *** Starting 1 switches s2 PUT http://10.160.31.238:8080/restconf/config/opendaylight-inventory:nodes { "opendaylight-inventory:nodes": { "node": [ { "id": "openflow:1", "ofoverlay:tunnel-ip": "10.160.9.20" }, { "id": "openflow:2", "ofoverlay:tunnel-ip": "10.160.9.21" } ] } } PUT http://10.160.31.238:8080/restconf/config/policy:tenants { "policy:tenants": { "tenant": [ { "contract": [ { "clause": [ { "name": "allow-http-clause", "subject-refs": [ "allow-http-subject", "allow-icmp-subject" ] } ], "id": "22282cca-9a13-4d0c-a67e-a933ebb0b0ae", "subject": [ { "name": "allow-http-subject", "rule": [ { "classifier-ref": [ { "direction": "in", "name": "http-dest" }, { "direction": "out", "name": "http-src" } ], "name": "allow-http-rule" } ] }, { "name": "allow-icmp-subject", "rule": [ { "classifier-ref": [ { "name": "icmp" } ], "name": "allow-icmp-rule" } ] } ] } ], "endpoint-group": [ { "consumer-named-selector": [ { "contract": [ "22282cca-9a13-4d0c-a67e-a933ebb0b0ae" ], "name": "e593f05d-96be-47ad-acd5-ba81465680d5-1eaf9a67-a171-42a8-9282-71cf702f61dd-22282cca-9a13-4d0c-a67e-a933ebb0b0ae" } ], "id": "1eaf9a67-a171-42a8-9282-71cf702f61dd", "network-domain": "77284c12-a569-4585-b244-af9b078acfe4", "provider-named-selector": [] }, { "consumer-named-selector": [], "id": "e593f05d-96be-47ad-acd5-ba81465680d5", "network-domain": "472ab051-554e-45be-a133-281f0a53412a", "provider-named-selector": [ { "contract": [ "22282cca-9a13-4d0c-a67e-a933ebb0b0ae" ], "name": "e593f05d-96be-47ad-acd5-ba81465680d5-1eaf9a67-a171-42a8-9282-71cf702f61dd-22282cca-9a13-4d0c-a67e-a933ebb0b0ae" } ] } ], "id": "f5c7d344-d1c7-4208-8531-2c2693657e12", "l2-bridge-domain": [ { "id": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6", "parent": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "l2-flood-domain": [ { "id": "34cc1dd1-2c8c-4e61-a177-588b2d4133b4", "parent": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6" }, { "id": "6e669acf-2fd9-48ea-a9b0-cd98d933a6b8", "parent": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6" } ], "l3-context": [ { "id": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "subject-feature-instances": { "classifier-instance": [ { "classifier-definition-id": "4250ab32-e8b8-445a-aebb-e1bd2cdd291f", "name": "http-dest", "parameter-value": [ { "name": "type", "string-value": "TCP" }, { "int-value": "80", "name": "destport" } ] }, { "classifier-definition-id": "4250ab32-e8b8-445a-aebb-e1bd2cdd291f", "name": "http-src", "parameter-value": [ { "name": "type", "string-value": "TCP" }, { "int-value": "80", "name": "sourceport" } ] }, { "classifier-definition-id": "79c6fdb2-1e1a-4832-af57-c65baf5c2335", "name": "icmp", "parameter-value": [ { "int-value": "1", "name": "proto" } ] } ] }, "subnet": [ { "id": "77284c12-a569-4585-b244-af9b078acfe4", "ip-prefix": "10.0.35.1/24", "parent": "34cc1dd1-2c8c-4e61-a177-588b2d4133b4", "virtual-router-ip": "10.0.35.1" }, { "id": "472ab051-554e-45be-a133-281f0a53412a", "ip-prefix": "10.0.36.1/24", "parent": "6e669acf-2fd9-48ea-a9b0-cd98d933a6b8", "virtual-router-ip": "10.0.36.1" } ] } ] } } POST http://10.160.31.238:8080/restconf/operations/endpoint:register-endpoint { "input": { "endpoint-group": "1eaf9a67-a171-42a8-9282-71cf702f61dd", "l2-context": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6", "l3-address": [ { "ip-address": "10.0.35.4", "l3-context": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "mac-address": "00:00:00:00:35:04", "ofoverlay:node-connector-id": "openflow:2:1", "ofoverlay:node-id": "openflow:2", "tenant": "f5c7d344-d1c7-4208-8531-2c2693657e12" } } POST http://10.160.31.238:8080/restconf/operations/endpoint:register-endpoint { "input": { "endpoint-group": "1eaf9a67-a171-42a8-9282-71cf702f61dd", "l2-context": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6", "l3-address": [ { "ip-address": "10.0.35.5", "l3-context": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "mac-address": "00:00:00:00:35:05", "ofoverlay:node-connector-id": "openflow:2:2", "ofoverlay:node-id": "openflow:2", "tenant": "f5c7d344-d1c7-4208-8531-2c2693657e12" } } POST http://10.160.31.238:8080/restconf/operations/endpoint:register-endpoint { "input": { "endpoint-group": "e593f05d-96be-47ad-acd5-ba81465680d5", "l2-context": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6", "l3-address": [ { "ip-address": "10.0.36.4", "l3-context": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "mac-address": "00:00:00:00:36:04", "ofoverlay:node-connector-id": "openflow:2:3", "ofoverlay:node-id": "openflow:2", "tenant": "f5c7d344-d1c7-4208-8531-2c2693657e12" } } POST http://10.160.31.238:8080/restconf/operations/endpoint:register-endpoint { "input": { "endpoint-group": "e593f05d-96be-47ad-acd5-ba81465680d5", "l2-context": "70aeb9ea-4ca1-4fb9-9780-22b04b84a0d6", "l3-address": [ { "ip-address": "10.0.36.5", "l3-context": "f2311f52-890f-4095-8b85-485ec8b92b3c" } ], "mac-address": "00:00:00:00:36:05", "ofoverlay:node-connector-id": "openflow:2:4", "ofoverlay:node-id": "openflow:2", "tenant": "f5c7d344-d1c7-4208-8531-2c2693657e12" } } *** Starting CLI: mininet>