Problem: (No Internet & No DHCP)
I cannot seem to get my VM's to connect to the internet nor am I able to setup a DHCP server to automatically assign IPs to them.
Introduction/PSA for dupes: I've seen several articles, videos and questions here on exchange with regards to network best practices with Proxmox. However, over a few days, 11 server reinstalls and frustration I'm unable to get results with my setup, through perhaps outdated articles and/or lack of knowledge. It's also important to mention that I have only ever used Proxmox on a home network, behind a router.
An issue I'm facing is that the configuration OOB from OVH seems slightly different compared to the documentation and articles I've been reading. Here's an example of the networking, unmodified from installation. (vmbr0 comes OOB with the public IP/gateway attached, rather than the network device)
And in /etc/network/interface
Setup:
- Proxmox Version: Virtual Environment 7.4-3
- Public IPs: 1
- Dedicated, cloud hosted server with OVH
Goal/s:
- To use a single public IP for all traffic
- Any VM will have internet access (if assigned bridge)
- Any VM will be automatically assigned a local IP using DHCP (Low Priority) (if assigned bridge)
- Use dnsmasq/other on either a VM or Proxmox itself for DHCP (Low Priority) (if assigned bridge)
- To understand the network and rationale
What I've Tried:
Part 1
Masquerading (NAT) with iptables (https://pve.proxmox.com/wiki/Network_Configuration)
I'm confident that this is the correct approach to what I'm trying to achieve, based on it's description in the docs.
Firstly I added a new Linux bridge, with no gateway or IP assigned.
Then I applied the configuration which added this new iface to the /etc/network/interfaces
configuration file, then added the address, post-up, post-down lines to it using vmbr0 bridge, since that's where my gateway is. IP's can range from: 10.10.10.1 - 10.10.10.254
.
My assumption here is that 10.10.10.1
will be the IP assigned to the Linux bridge (acting as a managed switch?)
(address=
does not have =
in prod, this was a screenshot example typo)
I then rebooted the entire server to ensure that the network configuration has been applied. I do this rather than restart the service to eliminate any red-herrings because I noticed some randomness in applying them in some of my earlier attempts at this.
Upon successful start-up, I re-checked the network tab in Proxmox and the /etc/network/interface
configuration file. Everything was present and 'correct' according to what I'd changed so far.
The next step was to create a virtual machine. I chose ubuntu-22.04.2-live-server and applied the vmbr1 network interface to it and started the vm. Once I reached the network connections configuration I selected manual IPV4 setup and entered the following details:
Following a save of this dialogue, the proceed button, Continue without network
, was changed to Done
. So I believe my config here to be correct (at least for LAN). Jumping ahead slightly, Checking for installer update
& Featured Server Snaps
fails to load, but I decided to continue with the installation. After this was all completed, I ran apt-get update
, ping 1.1.1.1
, ping 10.10.10.1
and ping 10.10.10.0
which showed no signs of life.
Running ip a
, shows the following, which seems correct?:
These results tell me that my bridge configuration in /etc/network/interfaces
is wrong.....
Part 2
Using the previous steps in Part 1
, I'd followed them exactly, however I re-assigned my IP/gateway to the network device and used vmbr0
instead of vmbr1
as seen in the screenshots.
Part 3
I went on to think that this could also be an issue with how I was setting up the network on the VM so I'd attempted to setup a DHCP server using dnsmasq
and dnsutils
in the Proxmox host shell. Followed by re-tracing my steps afterwards as seen in Part 1
. No IP was automatically assigned to the VM upon installation however.... (Ideally I'd setup a DHCP server within a separate VM anyway).
Part 4
Attempted to install Pfsense
however, I realised that if I could not fix my bridge configuration this would never work either.
Any help/knowledge/advice is greatly appreciated on this, I usually work best by trial and error, but this time it's not worked!
Thanks for reading my monologue.
References/Articles:
Proxmox VE - problems in setting private network
How accessing a NATed, virtualized (LXC) server over public IP from client itself on a bridged network?
Proxmox: 1 NIC, 1 Public IP, unable to get WAN interface working in VMs
https://forum.proxmox.com/threads/how-can-i-connect-a-bridge-to-another-bridge.98510/ (Interesting? Maybe Part 1 wont work at all anyway?)
https://bobcares.com/blog/dnsmasq-dhcp-server-in-proxmox/
https://forum.proxmox.com/threads/1-public-ip-two-bridges-port-forwarding.110820/
https://unix.stackexchange.com/questions/633668/how-to-set-up-a-bridge-interface-add-eth0-to-it-and-have-internet-connection