Learn how to update the properties of an existing subnet. This can be needed if you want to comply with the prerequisites to be able to use the Public Cloud Gateway: have a gateway IP defined in your subnet.
For this example, we will use a private network and a subnet with the following properties:
- CIDR 10.4.0.0/16
- DHCP enabled with allocation pool on the global range
- No gateway IP
We will see how to update it to have a Gateway IP set to 10.4.0.1
and remove that IP from the allocation pool.
Requirements
- created a private network and a subnet as explained in this guide.
Instructions
Using the OVHcloud Control Panel
It is currently not possible to update a subnet through this interface but you can use our Horizon interface instead (see the instructions below).
Using Horizon
Connect to Horizon and choose the region where the subnet is defined as explained in this guide.
Click on Project > Network > Networks
. The page will display the list of networks available that contain an OVHcloud-managed network for public connectivity (Ext-Net
) as well as your network.
In that list, click on your network name ("Private_Network_VIN" in this example). The network detail page is then displayed.
Click the Subnets
tab to see the subnets from the private network.
Click on Edit Subnet
. For this guide, our target is to add a gateway IP:
- Uncheck the
Disable Gateway
box. The fieldGateway IP
will appear. Fill it in with an IP within your CIDR (usually the first IP of the range is used). In our case,10.4.0.1
.
- Click on
Subnet Details
. Update theAllocation Pools
to remove the Gateway IP that you entered in the previous step. In our case, we need to update from10.4.0.1,10.4.255.254
to10.4.0.2,10.4.255.254
Click on Save
and your subnet is updated with a Gateway IP!
Using the OpenStack Command Line Interface
You need to have your CLI environment set up and your variables defined.
Run the following command (replace Private_Network_VIN
with the name of your private network):
Example result:
In this output, the subnets
line provides the UID of your subnet. You can check your subnet details by running the following command (update the UID according to your value):
Example result:
Now let's update the gateway_ip
and the allocation_pool
:
You can check that the subnet has been updated:
Example result:
Go further
For more information and tutorials, please see our other Public Cloud Networking support guides or explore the guides for other OVHcloud products and services.
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.