Reserving Private IP Addresses in a Network Load Balancer
Reserve private IP addresses for your network load balancers so that the addresses remain available for use.
You can reserve a private IPv4 or IPv6 address for your network load balancer when you create it. Reserving the address prevents it from returning to the ephemeral pool for the subnet when you delete the network load balancer. The reserved IP address remains available for a subsequent network load balancer instead of being allocated to another resource.
You can enable this feature by specifying the IP address in the Console or its corresponding OCID by using the CLI or API when you create a network load balancer. You can select an existing reserved IP address or specify a particular IP address. This feature supports both IPv4 and IPv6 addresses on public and private network load balancers. You can't change a reserved IP address after you create the network load balancer. When you create the network load balancer, select an existing reserved private IP address or create a new reserved private IP address.
When Creating a Network Load Balancer
- Create a network load balancer as described in Creating a Network Load Balancer.
- On the Add Details page of the create workflow, select an existing reserved IP address or create a new one from the network load balancer's subnet in the Reserved IPv4 private address field or Reserved IPv6 field.
- Continue with the network load balancer creation.
Create a network load balancer using the CLI as described in Creating a Network Load Balancer. Include the optional
--reserved-ipsparameter.This option is a JSON list with items of type ReservedIP. For more information, see ReservedIP API reference. This is a complex type whose value must be valid JSON. You can provide the value as a string on the command line or in a file by using the
file://path/to/filesyntax.For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the CreateNetworkLoadBalancer operation. Include the
reservedIpsparameter.
When Updating a Network Load Balancer
Don't reserve your network load balancer's already assigned ephemeral address. You can't convert that address to a reserved IP address. You can reserve a private IPv4 address only when you create the network load balancer. When you add a reserved IP address to an existing network load balancer, you can reserve an IPv6 address only while converting an IPv4-only NLB to dual-stack.
The reserved IPv6 address is attached to the network load balancer's VNIC. Update a network load balancer using the CLI as described in Editing a Network Load Balancer. Include the optional
--reserved-ipv6-idparameter. You must also include the--nlb-ip-versionparameter with the valueIPV4_AND_IPV6. For example:oci nlb network-load-balancer update --network-load-balancer-id network_load_balancer_ocid --reserved-ipv6-id reserved_ipv6_ocid --nlb-ip-version IPV4_AND_IPV6 [OPTIONS]For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the UpdateNetworkLoadBalancer operation. In
UpdateNetworkLoadBalancerDetails, setreservedIpv6Idto the OCID of the reserved IPv6 address and setnlbIpVersiontoIPV4_AND_IPV6.