Knowledgebase
Knowledgebase: Technical
Add multiple Floating IPs to a single instance
Posted by Matt Czajka, Last modified by Matt Czajka on 08 April 2016 10:57 AM

Sometimes, you require multiple floating IPs to be attached to a single instance.  To do this, multiple NICs must be added to the instance, and then some easy OS level configuration to ensure proper routing to and from the second floating IP.

 

The easiest way to proceed, would be to setup a second private network.  You can follow along our knowledge base article here: (https://helpdesk.auro.io/index.php?/Knowledgebase/Article/View/5/1/setting-up-your-own-private-network-in-auro) but you can skip the create router step as you should already have one.

 

Once created, create a new instance.  On the Network tab, attach both your private networks (remember to never attach ext-net, as this causes errors).  

 

Now, launch your instance, and attach floating IPs to each port.  SSH into the Floating IP attached to NIC1.

 

Now we need to do some configuration to bring up the second interface (eth1), and have it route properly.

UBUNTU: 

$ cd /etc/network/interfaces.d
$ cp eth0.cfg eth1.cfg

Now in the editor of your choice, change any references of eth0 to eth1 in the new eth1.cfg file.  There should only be a couple. Then bring up eth1:

$ sudo ifup eth1

Now the routing can be done via IP rules.

# 10.10.2.1 = gateway for the secondary interface
# 10.10.2.11 = ip address for the secondary interface eth1
$ ip route add default via 10.10.2.1 dev eth1 table 10 
$ ip rule add from 10.10.2.11 table 10


Now you should be able to ping and access the instance from both Floating IPs

(0 vote(s))
Helpful
Not helpful

Comments (0)