Tutorial · Proxmox VE 9 networking
Proxmox networking tutorial a public IP for every virtual machine
This Proxmox networking tutorial shows you how to give a virtual machine its own public IP on your Primcast server: attach it to the vmbr0 bridge, type in the address, gateway and netmask, and it is online. No reboot, and nothing to register with us first.
If you want more control, two other setups follow: traffic routed through the host, and private machines that share the host's address. We ran all three on our own network before writing them down.
- Netmask
- /24
- IPv4 gateway
- .1 of the range
- IPv6
- /64 · gw ::1
- Host DNS
- 209.244.0.3
Find your public IPs and the gateway each one uses
Your addresses are in the Dedicated Server Setup email we sent the day your server was built, IPv4 first and then IPv6. You can also see them any time in your account: open the server and look at the panel called Access, Networking & rDNS.
On a Proxmox server, only the first address is set up on the host. The email tells you this under the list of addresses. We stop there on purpose: a host holding every address would answer for all of them, and your virtual machines would have nothing left to use. The rest are yours to give to virtual machines, or to the host if you want it to have more than one.
You need the same few values every time you place an address:
- Netmask
- /24Which is 255.255.255.0.
- Gateway
- .1The .1 of the range the address sits in, so 203.0.113.58 uses 203.0.113.1.
- DNS on the host
- 209.244.0.3Your virtual machines can use any resolver you like.
- IPv6
- /64Gateway is the prefix followed by ::1. Step 06 has the details.
Check the gateway first when something fails. Addresses you got together share one range and one gateway. Addresses added to your server later can come from a different range of ours, and then they use that range's own .1. A wrong gateway is the most common reason a new virtual machine cannot reach anything.
Look at the Proxmox network bridge you already have
Sign in to the host over SSH as root and see what is there:
ip -br addr cat /etc/network/interfaces
A server we have just installed has a file that looks roughly like this. Your interface name and first address will be different:
/etc/network/interfaces
auto lo
iface lo inet loopback
iface eno1 inet manual
auto vmbr0
iface vmbr0 inet static
address 203.0.113.10/24
gateway 203.0.113.1
bridge-ports eno1
bridge-stp off
bridge-fd 0
Notice that vmbr0 is already a bridge with your network port plugged into it. That is all the bridged setup in step 03 needs, so for that one you leave this file alone.
Proxmox VE 9 runs on Debian 13 and uses ifupdown2, which means network changes apply without a restart. After you save the file, run:
ifreload -a
If you prefer the Proxmox web interface, your edits wait in /etc/network/interfaces.new until you click Apply Configuration.
Open the console in your account before you change anything. It reaches the server through its management card, not through the network, so it still works if a typo takes the server offline.
Which setup should you use?
| Question | Bridged | Routed | Private |
|---|---|---|---|
| Uses one of your public IPs | Yes | Yes | No |
| Changes on the host | None | Address moves to the network card | A second bridge |
| Host firewall sees the traffic | No | All of it | All of it |
| Reachable from the internet | Yes | Yes | Only ports you forward |
| DHCP allowed | No | No | Yes |
Bridged: a Proxmox public IP straight on the network
Most people should pick this one. Your virtual machine acts like its own computer on the same switch, talks to our routers directly, and the host needs no changes at all.
In Proxmox, add a network device to the virtual machine, choose vmbr0 as the bridge, and keep the MAC address Proxmox generates. Then set the address inside the virtual machine.
Debian or Ubuntu with ifupdown
/etc/network/interfaces
auto lo
iface lo inet loopback
auto ens18
iface ens18 inet static
address 203.0.113.58/24
gateway 203.0.113.1
dns-nameservers 209.244.0.3 1.1.1.1
Ubuntu with netplan
/etc/netplan/01-netcfg.yaml
network:
version: 2
ethernets:
ens18:
addresses: [203.0.113.58/24]
routes:
- to: default
via: 203.0.113.1
nameservers:
addresses: [209.244.0.3, 1.1.1.1]
Windows
Put the same address, netmask and gateway into the network adapter's IPv4 settings. The operating system makes no difference to us: your virtual machine is one more computer on the wire.
You do not need to tell us anything
There is no form to fill in for each new virtual machine, and you do not send us MAC addresses. Some hosts ask for both. We checked our side before saying so: the switch port your server uses has no limit on MAC addresses and port security is off. We also put a second address and MAC on one of our own servers and reached it from the internet.
A few rules keep it working:
- Give every virtual machine its own MAC address. If two share one, or one copies the host's, neither works properly.
- Use the gateway that matches the address's range, from step 01.
- Only use addresses that are on your account. This bridge connects to a network with other customers on it, and an address that is not yours takes their traffic away.
- Never run a DHCP server or send router advertisements on
vmbr0, for the same reason. If you want automatic addressing, use the private bridge in step 05.
Routed: send each virtual machine through the host
Pick this when you want the host's firewall to see every packet, or when you would rather your virtual machines never appear on the shared network. They still use real public IPs from your account. Only the path changes.
The public address moves from the bridge to the network card, the host forwards traffic, and it answers for the machines behind it. On the host:
/etc/network/interfaces (host)
auto lo
iface lo inet loopback
auto eno1
iface eno1 inet static
address 203.0.113.10/24
gateway 203.0.113.1
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up echo 1 > /proc/sys/net/ipv4/conf/eno1/proxy_arp
auto vmbr0
iface vmbr0 inet manual
bridge-ports none
bridge-stp off
bridge-fd 0
up ip route add 203.0.113.58/32 dev vmbr0
down ip route del 203.0.113.58/32 dev vmbr0
Add one up and one down line for each address you route. Inside the virtual machine, the address is a /32, and the host must be reachable through its own route before the default route:
/etc/network/interfaces (virtual machine)
auto lo
iface lo inet loopback
auto ens18
iface ens18 inet static
address 203.0.113.58/32
post-up ip route add 203.0.113.10 dev ens18
post-up ip route add default via 203.0.113.10
dns-nameservers 209.244.0.3 1.1.1.1
Keep the proxy_arp line. Our routers ask the network who holds each address, and that line makes the host reply for the machines behind it. Without it, they cannot be found. To make both settings permanent the sysctl way, put this in a file under /etc/sysctl.d/:
net.ipv4.ip_forward=1 net.ipv4.conf.eno1.proxy_arp=1
The extra work buys you a host that can filter and log all traffic. If you do not need that, the bridged setup has fewer moving parts.
Private: virtual machines that share the host's address
Many virtual machines only need to reach out, never be reached: build runners, workers, a database that should stay hidden. Give them private addresses on a second bridge, and the host translates their traffic to its own public IP. This uses none of your addresses, so you can run as many as the hardware allows.
Add a second bridge and leave vmbr0 as it is:
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 eno1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE
Attach the virtual machines to vmbr1 and give each one an address in that range, with 10.10.10.1 as the gateway. The internet sees them as your server. Nothing can reach them from outside until you forward a port, which takes one more pair of lines on a port the host is not using:
post-up iptables -t nat -A PREROUTING -i eno1 -p tcp --dport 8443 -j DNAT --to 10.10.10.2:443 post-down iptables -t nat -D PREROUTING -i eno1 -p tcp --dport 8443 -j DNAT --to 10.10.10.2:443
Because vmbr1 has no physical port, a DHCP server on it is safe, and it is an easy way to address many machines.
Add your IPv6 addresses
You get individual IPv6 addresses, not a block to split up. They are listed at the end of the setup email, and you place them one by one, just like IPv4: one on the host if you want the host reachable over IPv6, the others on the virtual machines that need them. None of them are set up for you at install time.
Write each address with /64. The gateway is the prefix followed by ::1, so an address in 2001:db8:1234::/64 uses 2001:db8:1234::1. On the host, next to the existing bridge:
iface vmbr0 inet6 static
address 2001:db8:1234::2/64
gateway 2001:db8:1234::1
In a virtual machine on the bridge:
iface ens18 inet6 static
address 2001:db8:1234::5/64
gateway 2001:db8:1234::1
Run ifreload -a again. Since these addresses are not a block of your own, do not advertise routes or hand out addresses you were not given. If you need more, ask us.
Set reverse DNS on each address
You can set reverse DNS on any of your addresses yourself. Sign in, open the server, and go to Access, Networking & rDNS. Each address shows its current name with an Edit rDNS button beside it, and IPv6 addresses work the same way.
Enter a hostname: letters, numbers, hyphens and dots, at least two parts, each 1 to 63 characters long. The trailing dot is added for you. The change takes a few minutes.
If a virtual machine sends email, set reverse DNS on the address the mail leaves from. In the private setup that is the host's address. Add the matching forward record at your DNS provider too, because receiving mail servers check that both agree and reject mail when they do not.
Proxmox networking questions, answered
01How do I give a Proxmox VM a public IP?
Attach the virtual machine to the vmbr0 bridge and set one of your extra public IPs inside it, with a /24 netmask and the .1 of that address's range as the gateway. On a Primcast server the host needs no changes for this, and you do not have to register the MAC address with us.
02My virtual machine is running but has no network. What should I check?
Start with the gateway: it must be the .1 of the range the address belongs to, and addresses added at different times can sit in different ranges. Then make sure the address is on your account, the netmask is /24, and no other machine uses the same MAC address.
03Do I have to send Primcast each virtual machine's MAC address?
No. Your switch port learns as many MAC addresses as you use and port security is off, so a virtual machine shows up like any physical computer. Keep the MAC address Proxmox generates and never give two machines the same one.
04Why is only one IP configured on my new Proxmox server?
So your virtual machines have addresses to use. If the host held them all, it would answer for every one of them. We configure the first address so you can reach the server, and the setup email notes this under your list of addresses.
05Should I use bridged or routed networking in Proxmox?
Use bridged unless you need the host to filter traffic. It changes nothing on the host and each virtual machine behaves like a normal computer on the network. Routed suits you when the host's firewall must see every packet, in return for a little more setup inside each machine.
06Can I use DHCP for my Proxmox virtual machines?
Yes, on a private bridge with no physical port, such as vmbr1 in step 05. Never on vmbr0: it connects to a network other customers share, and a DHCP server or router advertisements there would answer machines that are not yours.
07I applied a bad network config and lost the server. How do I get back in?
Open the console from your Primcast account. It goes through the server's management card rather than its network, so it works while networking is broken. Fix /etc/network/interfaces, run ifreload -a, and the server is reachable again.
08How do I get more IP addresses for my virtual machines?
Ask on live chat or open a ticket, and tell us what each address is for, since the address registries require a reason for every assignment. Extra IPv4 addresses are billed monthly on the same account and appear in your control panel once they are allocated.
Stuck on a step? Ask us on chat.
Our AI assistant answers in seconds and can check your server and its addresses for you. Ask for a person whenever you want one.