Internet Connectivity¶
Internet Gateway is required to connect the resources in the tenant to the Internet.
These steps include obtaining a public IP address and configuring static routes to communicate with the Internet.
You can create Internet Gateway, Gateway Interface, Public IP, and Static Route resources required for Internet connectivity by following these steps.
List Internet Service¶
Internet Service provides the ability to retrieve information about available Internet services.
※There is only one type of Internet service in Enterprise Cloud 2.0 as of Mar. 2016.
You can get it from the following API calls. See Internet Service for more information on the API.
$ curl -sS \
-H "Content-Type: application/json" \
-H "X-Auth-Token: {TOKEN}" \
-X GET {api_endpoint}/v2.0/internet_services
- Sample Response Body
{
"internet_services": [
{
"zone": "jp1-zone1",
"name": "Internet-Service-01",
"minimal_submask_length": 26,
"id": "6861948b-7fc0-4310-83e6-7f038717e9c9",
"description": ""
}
]
}
The id parameter in Response is the uuid of Internet Service and is used as the internet_service_id parameter in Create Internet Gateway.
List QoS Options of Internet Service¶
QoS Option provides the ability to get bandwidth plan information.
You can get a list of Internet Service bandwidth plans from the following API calls. See QoS Option for details on the API and Internet Connectivity in Service Description for details on the Internet Service bandwidth plan.
$ curl -sS \
-H "Content-Type: application/json" \
-H "X-Auth-Token: {TOKEN}" \
-X GET {api_endpoint}/v2.0/qos_options?service_type=internet
- Sample Response Body(Excerpt)
{
"qos_options": [
{
"vpn_service_id": null,
"status": "ACTIVE",
"service_type": "internet",
"qos_type": "guarantee",
"name": "50Mbps-Guaranteed",
"internet_service_id": "6861948b-7fc0-4310-83e6-7f038717e9c9",
"aws_service_id": null,
"azure_service_id": null,
"bandwidth": "50",
"description": "",
"fic_service_id": null,
"gcp_service_id": null,
"id": "40265698-6f8c-412a-b948-710dd4b8ecad",
"interdc_service_id": null
},
{
"vpn_service_id": null,
"status": "ACTIVE",
"service_type": "internet",
"qos_type": "besteffort",
"name": "100Mbps-BestEffort",
"internet_service_id": "6861948b-7fc0-4310-83e6-7f038717e9c9",
"aws_service_id": null,
"azure_service_id": null,
"bandwidth": "100",
"description": "",
"fic_service_id": null,
"gcp_service_id": null,
"id": "4861fe30-d941-4199-8a20-eef1b2625a92",
"interdc_service_id": null
},
]
}
The id parameter of the bandwidth plan used in the Response is the uuid of the QoS Option and is used as the qos_option_id parameter in the Create Internet Gateway.
Create Internet Gateway¶
Internet Gateway provides a Gateway feature for connecting Network to the Internet.
You can create a new Internet Gateway from the following API calls. See Internet Gateway for more information on the API.
$ curl -sS \
-H "Content-Type: application/json" \
-H "X-Auth-Token: {TOKEN}" \
-X POST -d @inet_gw.json {api_endpoint}/v2.0/internet_gateways
- Sample Request Body (inet_gw.json)
{
"internet_gateway": {
"internet_service_id": "6861948b-7fc0-4310-83e6-7f038717e9c9",
"name": "Example internet gateway 1",
"qos_option_id": "4861fe30-d941-4199-8a20-eef1b2625a92"
}
}
- Sample Response Body
{
"internet_gateway": {
"description": "",
"id": "baaed23d-a731-4ecc-b079-56fea18e80bd",
"internet_service_id": "6861948b-7fc0-4310-83e6-7f038717e9c9",
"name": "Example internet gateway 1",
"qos_option_id": "4861fe30-d941-4199-8a20-eef1b2625a92",
"status": "PENDING_CREATE",
"tenant_id": "6c0bdafab1914ab2b2b6c415477defc7"
}
}
The id parameter in the Response is the uuid of the newly created Internet Gateway and is used as the internet_gw_id parameter in Create Public IP, Create Gateway Interface, and Create Static Route.
Create Public IP¶
Public IP provides the public IP address (IPv4) needed to communicate with the Internet.
You can create a new Public IP from the following API calls. See Public IPs for more information on the API.
$ curl -sS \
-H "Content-Type: application/json" \
-H "X-Auth-Token: {TOKEN}" \
-X POST -d @public_ip.json {api_endpoint}/v2.0/public_ips
- Sample Request Body (public_ip.json)
{
"public_ip": {
"internet_gw_id": "baaed23d-a731-4ecc-b079-56fea18e80bd",
"name": "Example public ip 1",
"submask_length": 28
}
}
- Sample Response Body
{
"public_ip": {
"cidr": "100.127.251.160",
"description": "",
"id": "1cf0352a-8300-4ed2-b19c-32ea184807d4",
"internet_gw_id": "baaed23d-a731-4ecc-b079-56fea18e80bd",
"name": "Example public ip 1",
"status": "PENDING_CREATE",
"submask_length": 28,
"tenant_id": "6c0bdafab1914ab2b2b6c415477defc7"
}
}
Create Gateway Interface¶
Gateway Interface provides the ability to connect to the Network and configure the Gateway Interface with an IP address.
The Internet gateway is redundant by VRRP, so you must configure three IP addresses.
You can create a new Gateway Interface from the following API calls. See Gateway Interface for more information on the API.
$ curl -sS \
-H "Content-Type: application/json" \
-H "X-Auth-Token: {TOKEN}" \
-X POST -d @gw_if.json {api_endpoint}/v2.0/gw_interfaces
- Sample Request Body(gw_if.json)
{
"gw_interface": {
"gw_vipv4": "192.168.1.1",
"internet_gw_id": "baaed23d-a731-4ecc-b079-56fea18e80bd",
"name": "Example gateway interface 1",
"netmask": 24,
"network_id": "8bd9afc9-6d7f-496f-a2e2-7e50a9340292",
"primary_ipv4": "192.168.1.4",
"secondary_ipv4": "192.168.1.5",
"service_type": "internet",
"vrid": 2
}
}
network_id is the ID of the L2 Network Service that connects the Internet Gateway
- Sample Response Body
{
"gw_interface": {
"description": "",
"gw_vipv4": "192.168.1.1",
"id": "55b6ea31-41d0-4f98-9b22-81173c9eb9c7",
"internet_gw_id": "baaed23d-a731-4ecc-b079-56fea18e80bd",
"name": "Example gateway interface 1",
"netmask": 24,
"network_id": "8bd9afc9-6d7f-496f-a2e2-7e50a9340292",
"primary_ipv4": "192.168.1.4",
"secondary_ipv4": "192.168.1.5",
"service_type": "internet",
"status": "PENDING_CREATE",
"tenant_id": "6c0bdafab1914ab2b2b6c415477defc7",
"vrid": 2
}
}
Create Static Route¶
Static Route provides the ability to configure static routing and advertise BGP routes to the Internet.
The Static Route created below is an example and should be created with the IP address appropriate for your environment and use.
You can create a new Static Route from the following API calls. See Static Route for more information on the API.
$ curl -sS \
-H "Content-Type: application/json" \
-H "X-Auth-Token: {TOKEN}" \
-X POST -d @static_route.json {api_endpoint}/v2.0/static_routes
- Sample Request Body (static_route.json)
{
"static_route": {
"destination": "100.127.251.160/28",
"internet_gw_id": "baaed23d-a731-4ecc-b079-56fea18e80bd",
"name": "Example static route 1",
"nexthop": "192.168.1.3",
"service_type": "internet"
}
}
- Sample Response Body
{
"static_route": {
"description": "",
"destination": "100.127.251.160/28",
"id": "a1d8c47e-d6bf-4414-bbf5-7b1fe500627f",
"internet_gw_id": "baaed23d-a731-4ecc-b079-56fea18e80bd",
"name": "Example static route 1",
"nexthop": "192.168.1.3",
"service_type": "internet",
"status": "PENDING_CREATE",
"tenant_id": "6c0bdafab1914ab2b2b6c415477defc7"
}
}