Add multiple IPs on a server

Currently you can only connect one floating IP per network and server. In other words, if you want to use multiple floating IPs on a server, you need to connect a new network interface to the server against a separate network and connect the floating IP to the server on the new interface.

Please note that in most cases you have to configure your server to send traffic through the correct interface, otherwise it will try and use the default gateway regardless on which interface the traffic targeted. For most linux system this is easiest done following the steps bellow;

ip rule add from <IP OF INTERFACE> table <NAME OF TABLE>


ip route add default via <GATEWAY OF INTERFACE> table <NAME OF TABLE>


In order for it to work properly upon reboot you can use:


post-up ip rule add from <IP OF INTERFACE> table <NAME OF TABLE>


post-up ip route add default via <GATEWAY TO USE> table <NAME OF TABLE>

Example

Here is an example that forces traffic received on IP 10.1.1.3 to use gateway 10.1.1.1:

ip rule add from 10.1.1.3 table 1
ip route add default via 10.1.1.1 table 1