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

    1. Create a network load balancer as described in Creating a Network Load Balancer.
    2. 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.
    3. 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-ips parameter.

    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/file syntax.

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the CreateNetworkLoadBalancer operation. Include the reservedIps parameter.

When Updating a Network Load Balancer

When adding a reserved IPv6 address from the network load balancer's subnet during an update, the only supported transition is from an IPv4-only configuration to a dual-stack IPv4/IPv6 configuration by adding a reserved IPv6 address. You can only select a reserved private IPv4 address when you create the network load balancer.
Note

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.
    1. On the Network load balancers list page, select the network load balancer that you want to work with. If you need help finding the list page or the network load balancer, see Listing Network Load Balancers.
    2. On the details page, select Edit.
      The Edit network load balancer panel opens.
    3. Under IPv6 assignment, enable Allow IPv6 address assignment.
      Enabling this feature provides a dual-stack IPv4/IPv6 implementation for your network load balancer.
    4. Select the Reserved IP address option.
    5. Select one of the following reserved IP address options:
      • Select existing reserved IP address: Select an existing reserved IP address from the list.
      • Create new reserved IP address: Enter the name and IP address for the reserved IP address you're creating.
    6. Select Save.
    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-id parameter. You must also include the --nlb-ip-version parameter with the value IPV4_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, set reservedIpv6Id to the OCID of the reserved IPv6 address and set nlbIpVersion to IPV4_AND_IPV6.