Proxmox VE 7.2 server with VM router for IP Address distribution for Vms

galvatec

Member
Sep 1, 2021
29
0
6
48
I have this Proxmox hosted on oneprovider.com with only one IP and I need to make this IP reach the OS router for it to distribute internet and Vms.

I created a VM with Nethserver and configured it as a gateway for the other VMs and now these others are getting IP and accessing the internet

Now my question is how can I access the Nwethserver through the public IP and thus be able to redirect the ports to the VMs?
 
Last edited:
Hi,

Now my question is how can I access the Nwethserver through the public IP and thus be able to redirect the ports to the VMs?
Using iptables in your PVE network configuration, e.g.:

Code:
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport <PORT> -j DNAT --to <VM or CT Ip address>:<PORT>
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport <PORT> -j DNAT --to <VM or CT Ip address>:<PORT>