Additional ip nat?

Dinip

New Member
Sep 30, 2017
1
0
1
29
Hello I currently have a dedicated server on hetzner with 2 extra ips. So in total I have the default ip that is included with the server (xxx.xxx.61.76) and the other 2 are (xxx.xxx.61.116 and xxx.xxx.61.117).
With only the default ip I had my vms "natted" with internal subnet to that public ip. Now my objective is to have that default ip only to proxmox panel and ssh and the other 2 to vms, but I have 4 different vms. My idea is to have the 2 webservers vm use one of the 2 ips that I bought (xxx.xxx.61.116) and the other 2 vms with the other ip (xxx.xxx.61.117). Can I do something like what I did with the single ip? I've followed this tutorial (https://forum.proxmox.com/threads/1-public-ip-nat-masquerade-issue.22716/) and I was port forwarding in iptables on proxmox server.
I've also tried following a post on hetzner wiki, I cannot post external links here so... wiki.hetzner.de/ index.php/ KVM_mit_Nutzung_aller_IPs_aus_Subnetz/en
 
Your request is not quite clear for me.

If you want to use the public IPs as "main IP" in the VM:
* Bridge the VM's interface to the main host interface and assign a MAC to it which is accepted by the provider (don't know if your provider offers it, but it works e.g. at provider ovh) and add the gateway address to the route table in the VMs

If you want to use the public IPs only dor a web service located in the VM(s):
* let run Proxmox host as a proxy (easiest is to use apache2) and make "virtual-host" entries accordingly, e.g.:

Code:
<VirtualHost xx.xx:80>
   ServerName xx.xx
   ProxyRequests Off
   ProxyPreserveHost On
   <Proxy *>
       Order deny,allow
       Allow from all
   </Proxy>


   ProxyPass / http://192.168.x.y/   
   ProxyPassReverse / http://192.168.x.y/
   <Location />
       Order allow,deny
       Allow from all
   </Location>
</VirtualHost>

or define simply port forwarding via iptables.
 

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!