route a failover-IP directly to a vm

CRaSH3k

New Member
Jan 9, 2011
2
0
1
Hi,

I got 3 Proxmox-Servers running as a cluster.
Each Server has its own public ip.
I also got 3 failover-IPs that can be routed to each of those 3 servers.

What I want to achive is that 3 different VMs running on the cluster are each tied to one of those failover-IPs.

I can already route the failover-IPs to the nodes of the cluster but I do not know how to forward them from there to a specific VM and how the network of that VM has to be configured.
Please help me with this...


greetings,
crash3k


Here is my /etc/network/interfaces of the first node of the cluster:

Code:
auto lo
iface lo inet loopback


# device: eth0
auto  eth0
iface eth0 inet static
  address      1.2.3.84
  netmask      255.255.255.224
  gateway      1.2.3.65
  nameserver   8.8.8.8


  # default route to access subnet
  up route add -net 1.2.3.64 netmask 255.255.255.224 gw 1.2.3.65 eth0




# FailoverIP 1
auto eth0:0
iface eth0:0 inet static
  address      4.5.6.162
  netmask      255.255.255.255
  broadcast    4.5.6.162
  nameserver   8.8.8.8


# FailoverIP 2
auto eth0:1
iface eth0:1 inet static
  address      4.5.6.163
  netmask      255.255.255.255
  broadcast    4.5.6.163
  nameserver   8.8.8.8


# FailoverIP 3
auto eth0:2
iface eth0:2 inet static
  address      4.5.6.164
  netmask      255.255.255.255
  broadcast    4.5.6.164
  nameserver   8.8.8.8

(Bonus Question: Is there a way to automatically run a script, whenever a VM is migrated to another node? So that this script can update the failover-IP via an API?)
 
Actually you don't need to route, you need to bridge them. I.e. you need to set those failover IPs on the VMs, not on the physical nodes. Remove those aliases from host nodes (to avoid IP conflicts). Then from the proxmox create a bridge device vmbrX, attached to eth0 (or what your physical interface routes those IPs are). Then on the VM hardware tab create a new network device attached to that bridge and then setup required IP inside your VM.
EDIT: PRoxmox network model are pretty well described here: https://pve.proxmox.com/wiki/Network_Model
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!