Skip to content

Instantly share code, notes, and snippets.

@sridhargaddam
Last active February 16, 2018 04:40
Show Gist options
  • Save sridhargaddam/bc445d8c7bdc76b7dff075f97c75d27e to your computer and use it in GitHub Desktop.
Save sridhargaddam/bc445d8c7bdc76b7dff075f97c75d27e to your computer and use it in GitHub Desktop.
EVPNWithODL VPN Configuration
2.1: Define L3VPN instance and associate it with OpenStack admin tenant
------------------------------------------------------------------------
export ODL_URL='http://192.168.121.109:8181/restconf'
export CT_JSON="Content-Type: application/json"
TENANT_UUID=$(openstack project show admin -f value -c id | \
sed 's/\(........\)\(....\)\(....\)\(....\)\(.*\)/\1-\2-\3-\4-\5/')
cat << EOF > ./evpn-full.json
{
"neutronvpn:input": {
"neutronvpn:evpn": [
{
"neutronvpn:name": "evpn1",
"neutronvpn:export-RT": [
"100:100"
],
"neutronvpn:import-RT": [
"100:100"
],
"neutronvpn:route-distinguisher": [
"100:100"
],
"neutronvpn:tenant-id": "${TENANT_UUID}",
"neutronvpn:id": "f5d6edbf-D9E7-aaf3-BfaF-6FDf46c4e32D"
}
]
}
}
EOF
curl -X POST -u admin:admin -k -v -H "$CT_JSON" \
$ODL_URL/operations/neutronvpn:createEVPN -d @evpn-full.json
2.2: Associate the VPN with Neutron network (n1)
------------------------------------------------
cat << EOF > ./assoc-net.json
{
"input":{
"vpn-id":"f5d6edbf-D9E7-aaf3-BfaF-6FDf46c4e32D",
"network-id":[ "34c258c5-c7df-40de-a58f-6848f60e63aa" ]
}
}
EOF
curl -X POST -u admin:admin -k -v -H "$CT_JSON" \
$ODL_URL/operations/neutronvpn:associateNetworks -d @assoc-net.json
2.3: Configure DC-GW VTEP IP
------------------------------
cat << EOF > ./tep.json
{
"input": {
"destination-ip": "2.2.2.2",
"tunnel-type": "odl-interface:tunnel-type-vxlan"
}
}
EOF
curl -X POST -u admin:admin -k -v -H "$CT_JSON" \
$ODL_URL/operations/itm-rpc:add-external-tunnel-endpoint -d @tep.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment