We have a proxy LXC container running on a Proxmox server with multiple IPs (and mac addresses) with no issues. The hosting company (OVH) indications have been to add each IP with its own virtual mac all pointing at the host machine default gateway. As explained this has been working fine for a while until we have now upgraded.
On Debian 9 for some unknown reason (probably related to the network config naming changes) the same setup only seems to work for the first IP but not subsequent ones. I've read similar issues happen on CentOS as it would not allow different interfaces pointing at the same gateway.
Proxmox solved this (up to Deb8 at least) by adding post up rules on the /etc/network/interfaces as so:
# --- BEGIN PVE ---
post-up ip route add xx.XX.XX.254 dev eth2
post-up ip route add default via XX.XX.XX.254 dev eth2
pre-down ip route del default via xx.XX.XX.254 dev eth2
pre-down ip route del xx.XX.XX.254 dev eth2
# END PVE ---
This does only seem to work now on the first interface but fails on the rest.
As we have not found the reason of the behaviour change from Deb8 to Deb9 we can only think of solutions in the form of:
- Declaring all the secondary IPs without a gateway and find the way
to create an IP ROUTE rule that does work similar to:
ip route add default via xx.XX.XX.254 dev eth2
but not having clear why it does not work hard to implement - Declare only the first IP/MAC address on the container and use new syntax to add additional IPs to the same interface
ip address add 94.xx.xx.xx/32 dev eth2 label eth2:extraIP1
but this approach will require to use a single virtual MAC address to ALL ips, which is something from our point of view removes in a way the reason of having various IPs
Any help would be greatly appreciated or alternatively some guidance about where to patch the suggested change... in order to PVE not to overwrite our changes on reboots or definition changes and ideally only if ethX has gone up (can not do it within interfaces definition itself as PVE insist in overwriting that file.
- /if-up.d/
- /interfaces.d/
- interfaces.tail (supposedly used by PVE at the end of interfaces)