This section explains how to connect a virtual router to a subnet on K5 by updating its settings.
-
Set the environment variables below as follows:
$ ROUTER_ID=<targetVirtualRouterId>
$ SUBNET_ID=<subnetIdToBeConnected>
-
Execute the following API:
$ curl -Ss $NETWORK/v2.0/routers/$ROUTER_ID/add_router_interface -X PUT \
-H "X-Auth-Token: $OS_AUTH_TOKEN" -H "Content-Type: application/json" \
-d '{"subnet_id": "'$SUBNET_ID'" }' | jq .
The following response is output:
{
"subnet_id": "<specifiedSubnetId>",
"tenant_id": "<projId>",
"port_id": "<portId>",
"id": "<virtualRouterId>",
"availability_zone": "<availabilityZone>"
}
For the availability zones, AZ1 is expressed as "jp-east-1a", and AZ2 is expressed as "jp-east-1b".