Floating IP addresses enables dynamic IP address association with virtual machine instances (they can be associated with a VM, transferred between VMs, or removed back to the pool while the VMs are still running). On Securiace IaaS Cloud, all external IP addresses are floating IP addresses, and a virtual machine instance is allocated one when it is created.
You can assign up to three additional IP addresses (four total) to each virtual machine instance. This can be done by selecting a virtual machine instance, clicking on the IP tab, and adding additional IP addresses.
Note that your VM will have multiple internal IPs, each of which maps to one external floating IP.
For example, your VM may have two IP addresses
192.168.0.5 → 220.127.116.11
192.168.0.6 → 18.104.22.168
To accept incoming connections on the different IP addresses, you should configure your applications to listen on one of the internal IP addresses.
To connect via a specific floating IP, configure your application to bind the outgoing connection to the corresponding internal IP.
The virtual router will handle translation between internal and external IPs automatically.
Configuring software for floating IP addresses
If you have one IP address assigned to your VM, typically special configuration is not needed. The configuration below is generally intended to manage multiple IP addresses assigned to one container.
cPanel provides 1:1 NAT support to make it easy to use the panel on cloud infrastructures such as Securiace IaaS Cloud. See http://releases.cpanel.net/releases/11-40/11-nat-support/ or details on how you should add the IP addresses to cPanel. Note that "public IP address" in the link refers to the floating IP address, while "private IP address" refers to the address configured on the network interface on your VM.
Suppose that you are assigned two floating IP addresses for two private interfaces:
- 22.214.171.124 for 172.20.0.2
- 126.96.36.199 for 172.20.0.3
If you want to run a website on 188.8.131.52, use 172.20.0.2 in the Apache configuration. If you want to run a website on 184.108.40.206, then use 172.20.0.3.
Note: Depending on your installed operating system, your interface number may change after adding or removing an IP address (e.g. rename from eth0 to eth1). If this happens, you can fix the numbering by deleting /etc/udev/rules.d/70-persistent-net.rules and then rebooting the VM.