About Public IPs

A public IP is an IPv4 address that you can allocate to your account and then associate with one of your resources.

You can disassociate a public IP from its resource at any time, and then reassociate it with another one. You can also fix a public IP to the virtual machine (VM) it is associated with through the stop and start process using an OUTSCALE tag. For more information, see Configuring a VM with User Data and OUTSCALE Tags.

General Information

Public IPs are public IPv4 addresses that you can allocate to your account. You can then associate them with the following resources:

  • Instances

  • Network interfaces

  • Internet-facing load balancers

  • NAT services

Public IPs enable communication with the Internet. For more information, see About Nets > IP Addressing and Access to the Internet.

To associate a public IP in a Net, the Net must have an Internet gateway attached. For more information, see Connecting VMs in a Net to the Internet.

You can disassociate and reassociate a public IP at any time. For example, this enables you, in case of VM failure, to transfer the public IP to another VM. Therefore, the new VM has the same public IP, which means that scripts or applications using this public IP do not encounter any issue. For more information, see the [public IP Association] section below.

After you disassociate a public IP, it is still allocated to your account. If you do not use an allocated public IP anymore, you can release it to make it available for other accounts. For more information, see Unlinking a Public IP from a VM or a Network Interface and Releasing a Public IP from Your Account.

Ensure that none of your applications or scripts use the public IP you release.

Public IP Association

You can associate a public IP with only one resource at a time.

If you associate a public IP with a VM or a network interface, using Cockpit you always need to disassociate the public IP before you can reassociate it with another resource. Using the APIs, you can configure a reassociation behavior: either prevent it, or automatically disassociate the public IP and reassociate it with the new VM or network interface you specify. For more information, see Linking a Public IP with a VM or a Network Interface.

If you create a NAT service, you need to specify a public IP. To modify the public IP associated with a NAT service, you need to delete the NAT service and re-create it with the new public IP. For more information, see Creating a NAT Service.

You can also associate a public IP with an internet-facing load balancer when managing the load balancer. For more information on the association behavior, see About Load Balancers > Public IP. For more information on managing the load balancer, see Creating an Internet-facing Load Balancer in the Public Cloud or Creating an Internet-facing Load Balancer in a Net.

In the Public Cloud

An associated public IP replaces the default public IP of the VM. You can associate a public IP to a VM using one of the following solutions:

  • Non-persistent association:
    This solution instantly associates the public IP with a running VM. However, the public IP is disassociated from the VM every time you stop and start the VM. For more information, see Linking a Public IP with a VM or a Network Interface.

  • Persistent association:
    This solution involves using a tag, osc.fcu.eip.auto-attach. This tag enables you to associate a public IP with a VM and fix this public IP to the VM through the stop and start process. The tag is taken into account only at boot, that is, after creation and after a stop start. You can add this tag using regular tags or in the user data of the VM, with osc.fcu.eip.auto-attach as Key and the public IP as Value. For more information, see Tagging Your Resources or Configuring a VM with User Data and OUTSCALE Tags.

    • If you do not have time to stop and start your VM to associate the public IP with the VM using the osc.fcu.eip.auto-attach tag, you can associate the public IP using the non-persistent solution, and then add this tag to the VM using the same public IP as value. Therefore, the public IP will be fixed to the VM the next time you stop and start the VM.

    • If you add the osc.fcu.eip.auto-attach tag to a VM that already has a public IP associated or replace its value with another public IP, the current public IP will be removed and replaced with the new public IP you specify as value the next time you stop and start the VM.

    • As network interfaces do not follow a stop and start lifecycle, the association between a public IP and a network interface is always persistent.

In a Net

The public IP attaches to the VM or to the primary network interface. If you are working with several network interfaces, you can choose to associate the public IP with any of the network interface cards (NICs). For more information, see About NICs.
In a Net, public IP associations are only persistent. You can associate a public IP to a VM using one of the following solutions:

  • Using a tag:
    This solution involves using a tag, osc.fcu.eip.auto-attach. This tag enables you to associate a public IP with a VM and fix this public IP to the VM through the stop and start process. The tag is taken into account only at boot, that is, after creation and after a stop start. You can add this tag using regular tags or in the user data of the VM, with osc.fcu.eip.auto-attach as Key and the public IP as Value. For more information, see Tagging Your Resources or Configuring a VM with User Data and OUTSCALE Tags.

    If you add the osc.fcu.eip.auto-attach tag to a VM that already has a public IP associated or replace its value with another public IP, the current public IP will be removed and replaced with the new public IP you specify as value the next time you stop and start the VM.

  • Using the UpdateSubnet Method:
    This solution involves setting the MapPublicIpOnLaunch parameter of the Subnet to True. It assigns a random IP to the VM in the Net and fix it to the VM through the stop and start process. For more information, see the UpdateSubnet method.

Related Pages