New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
hosting proxmox vms with single ip, NAT forwarding help
I followed this guide https://wiki.abyssproject.net/en/proxmox/proxmox-with-one-public-ip
where i completed 1. Routing configuration 2. DHCP for virtual machines
It is working however virtualmin get installed on private ip. how to fix it?
how to allow NAT forwarding for all the important ports 22, 23, 80, 443, 10000 to access vm outside proxmox?
Thanks.


Comments
If your server is a cloud server and it's easy to do a system reinstall, I would first recommend trying https://www.spiritlhl.net/en/guide/dashboard.html for a one-click setup.
You will only have 5 to 10 Max vm in proxmox right? Dont use dhcp and make it more complicated give ips by hand and add required nat config lines to networking thing...
There are many ways to achieve this, the "simplest" is using iptables, but virsh will trample over your rules every time you bring up a new VM. I should note that I use virsh directly rather than proxmox. But anyway, the important thing is the iptables DNAT rules.
I've settled on using the package
netfilteron debian. I have many configs, one per service, for example/usr/share/netfilter-persistent/plugins.d/21-haproxylooks like this:still looks complicated, adding additional ip will work? i assume i can route traffic using a vm pfsense for 2nd ip?
How the hell is it complicated, it's literally a one-liner:
iptables -t nat -I PREROUTING -d 1.1.1.1 -p tcp --dport 2222 -j DNAT --to-destination 2.2.2.2:22Some compromise has to be done if you're skimping out on something, if you don't want complexity then cough up the cash and just get another IP.
i can get another ip but not when you have to manage 5-10vms.
Just buy a second IP.
If you are not familiar with the ins and outs of Linux networking, and remote VM hosting you will probably not appreciate the difficulties when you get it wrong trying to share one IP address!
Does your server have a 2nd (private) ethernet port? If so you could probably pay a low monthly fee for VPN access to admin the machine via the 2nd port and use the main port for proxmox VM access.
Or you could use tailscale for private access. Look that up - its wireguard on easy mode using SSH security. ;-)
If this is all new to you, ... just pay for the simple option, get it working, then teach yourself how to do it the other ways.
just my 2 sitoshis ! ;-)
This simple script done by @loay will make it easier for you
I'd suggest a LXC container running OpenWRT instead of a PFsense, it uses less resources and i believe that is more user friendly!
kinda off topic but that guide tells you to use ufw with pve. don't. ufw breaks pve's builtin firewall (including ipset filters), just use pve's directly, even has a nice ui
you mean using lxd instead of proxmox?
not offtopic, thanks. i am just looking optional ways if i can setup a gui based container after buying additional ip to run multiple vms.
proxmox does containers. but it looks like you're looking for something simpler like docker/podman, not full proxmox. depends on what you want to do really
sorry, i just checked, CT is lxc container for only linux distribution. i want to use proxmox > cloudpanel for running sites.
install proxmox, set vmbr1,add masquareds to networking, list the ports that cloud panel uses, install cloudpanel, add the required iptable codes about ports to networking... Use your ip to access cloudpanel
if you plan to add multiple websites in cloud panel add and configure haproxy (i think...)
you can use/forward each port only once if using regular NAT. just in case you plan on running multiple VMs for webhosting, this won't work with a single IP and only forwarding rules. for that you would indeed need some proxy on the node itself. same for mail and so on...
read up on NAT and networking, it feels like you are missing quite some basics here...
i am very new to NAT and networking. i recently tried to resetup and it all worked.
i understand the port 80, 443 will work with only one vm as all the vm pointing to same ip:port will not work. i reviewed and reconfigured it and got my main vm needed for cloudpanel working. i can now use the idle resources for other stuff that not requires those ports.
Really worth looking at https://community-scripts.github.io/ProxmoxVE/scripts. You can install openwrt which allows you to create many internal networks.
Also the site has many other handy tools for proxmox.
this is really useful. Thanks.