How To Configure A Proxmox Private Network
A Proxmox private network or internal network allows you to assign an internal IP to VMs and Containers. This is useful if you do not have any public IPs. Usually, you would use this on a home setup if you had installed Proxmox VE locally. Or, you could use an internal IP for a DHCP server. Internal IPs for VMs and Containers have many uses. In this guide, we will configure a private network then configure our networking to allow Containers and VMs to access the outside world using the hosts IP address.
Let’s configure a private network on vmbr1 which includes 10.10.10.1 for the address. There is a DHCP server running on 10.10.10.254 and we forward all connections from the 10.10.10.0/24 subnet to the ethernet device on our server. This allows for outgoing connections on guests. Let’s get started!
Add Private Network To Interfaces
Open up the interfaces file and add your private network.
nano /etc/network/interfaces auto vmbr1 iface vmbr1 inet static address 10.10.10.1/24 netmask 255.255.255.0 bridge-ports none bridge-stp off bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward# Change enp5s0 for your ethernet device which is displayed at the top of the interfaces # file
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o enp5s0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o enp5s0 -j MASQUERADE
Restart the networking with service networking restart or reboot the host.
Create Container With Private IP
Now, in the Proxmox GUI add a new container. In the network settings specify the IPv4 of the container. This will be an IP from your internal network pool. In our example, you can see we have used 10.10.10.254 which is a DHCP server. But remember, the gateway is the main IP of your vmbr1 interface and not the main IP of the host.
Once configured start the container and enter it with pct enter ID. You should now be able to ping the outside world.
root@dhcp-de:~# ping 18.104.22.168 PING 22.214.171.124 (126.96.36.199) 56(84) bytes of data. 64 bytes from 188.8.131.52: icmp_seq=1 ttl=117 time=5.01 ms 64 bytes from 184.108.40.206: icmp_seq=2 ttl=117 time=4.87 ms 64 bytes from 220.127.116.11: icmp_seq=3 ttl=117 time=4.99 ms 64 bytes from 18.104.22.168: icmp_seq=4 ttl=117 time=4.98 ms --- 22.214.171.124 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 7ms rtt min/avg/max/mdev = 4.873/4.964/5.008/0.073 ms
That’s it. The internal network is now configured and ready for use.
How was this article?
You might also like
More from Proxmox
In our previous article, we created a central Ubuntu NFS Server that is providing our templates over the network. Each …