Route IP to LXC Container

chip

Member
Jun 10, 2017
1
0
6
59
Hi together,

currently I'm trying to migrate to proxmox 4. I successfully converted my OpenVZ container to LXC.

Now I need to point my failover IP to this LXC container. The failover IP is without a dedicated MAC address, which means my proxmox host must route the IP to the LXC container itself.

What I have done so far is to connect the failover IP to eth0 which is already working:
Code:
ip addr add xxx.xxx.xxx.xxx/32 dev eth0

But how can I route the IP to my LXC container?
 
What I have done so far is to connect the failover IP to eth0 which is already working:
Code:
ip addr add xxx.xxx.xxx.xxx/32 dev eth0

But how can I route the IP to my LXC container?


Assuming failover IP is 55.66.77.88 and the local container IP is 192.168.10.11 set in Proxmox host

Code:
iptables -t nat -A PREROUTING -d 55.66.77.88 -j DNAT --to-destination 192.168.10.11
iptables -t nat -A POSTROUTING -s 192.168.10.11 -j SNAT --to-source 55.66.77.88


Should work in most cases (i.e. when the protocol works with a NAT).
 

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!