Proxmox Single-IP NAT and Port Forwarding Setup Guide
Configure an internal bridge (vmbr1) on a single-IP Proxmox server, route VMs to the internet via MASQUERADE NAT, and forward ports safely with iptables.
When you rent a dedicated server that only includes one public IPv4 address, buying extra IP blocks for internal services or test VMs gets expensive quickly. Putting guests onto a private subnet behind Proxmox NAT lets every VM reach the internet while sharing that single host IP.
The golden rule here is to leave your main management bridge (vmbr0) untouched. One syntax slip on vmbr0 locks you out of SSH. Build a separate internal bridge (vmbr1) and put all NAT and forwarding rules inside that block.
Step 1: Add the private bridge (vmbr1) and NAT rules
Open /etc/network/interfaces and append the block below at the bottom (replace vmbr0 if your uplink interface uses another name):
auto vmbr1
iface vmbr1 inet static
address 10.10.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
Those last two raw conntrack lines are easy to miss, yet they prevent silent packet drops whenever the built-in Proxmox Firewall is turned on.
Apply the configuration without dropping active SSH sessions using ifupdown2:
ifreload -a
Run ip a show vmbr1 and check that 10.10.10.1/24 is up.
Step 2: Configure the guest VM network
Attach your VM's NIC to vmbr1 and assign a static IP inside the guest OS:
- IP Address:
10.10.10.10/24 - Gateway:
10.10.10.1 - DNS:
1.1.1.1and8.8.8.8
Test outbound connectivity with ping 1.1.1.1. The guest can now pull updates while staying invisible to direct external scans.
Step 3: Forward external ports to a VM (DNAT)
To forward external port 2210 to SSH (22) on 10.10.10.10 and external port 8080 to port 80, add these lines inside the same vmbr1 block:
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2210 -j DNAT --to 10.10.10.10:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2210 -j DNAT --to 10.10.10.10:22
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 8080 -j DNAT --to 10.10.10.10:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 8080 -j DNAT --to 10.10.10.10:80
Do not forward ports 22 or 8006 to a guest unless you want to cut off your own host SSH and Proxmox UI access. Stick to high non-conflicting ports like 10000–60000.
Use a reverse proxy when hosting multiple web apps
If five different internal VMs all serve websites, forwarding 8081, 8082, and 8083 gets messy fast. Put a tiny Nginx or Caddy container at 10.10.10.2, forward only ports 80 and 443 to it, and let it route traffic by hostname with automatic TLS.
Once you sell commercial VPS/VDS plans where each customer needs a dedicated public IPv4 and rDNS entry, move beyond NAT with our Proxmox bridge and VLAN network guide or automate conflict-free IPv4 pool allocation inside VMRobot.