Is this configured correct?

MoldyTaint

New Member
Dec 3, 2022
13
2
3
This is really my first time setting up a static IP address anywhere. Normally whenever I boot up my Proxmox host, do an install or whatever it's always pulling the 192.168.68.211 address which is great!

Before with Ubuntu Server + Docker everything just had the 192.168.68.211:Dockerporthere for my applications and it was easy to remember. Now with LXC's and VM's, everytime I create one I get a new random IP which just keeps confusing me. I went into the networks and tried changing the IP address value and the gateway value. At first I didn't change the gateway and left it blank as I just wanted the specific IP address but noticed I wasn't getting any internet connection, then I added the gateway address.1687479331815.png
1687479134040.png
 
Before with Ubuntu Server + Docker everything just had the 192.168.68.211:Dockerporthere for my applications and it was easy to remember.
That's because Docker handles such things automagically for you, usually; if you're just running containers without extra network configuration, it will use its default bridge network using the bridge network driver. Basically, it puts your containers in a separate virtual network by default and makes your host the gateway to your actual, (presumably) physical network.

Now with LXC's and VM's, everytime I create one I get a new random IP which just keeps confusing me.
I'm going to simplify a lot of things for the sake of explanation, but it kind of works like this:

Because virtual machines are just "computers inside a computer" they also require virtual hardware. So instead of the VM having a physical network interface, it has a virtual network interface - a program that acts like the physical world's counterpart. The operating system that you install in the VM usually doesn't notice any difference, it will just see it as another piece of hardware, even though it's virtual. Containers are a little different from that; regardless, the virtual machine will still need its own IP address if it wants to talk to other hosts or the internet.

Same thing happens with Docker containers, except that Docker makes that a little less explicit. (Unless you tell your Docker containers to use the host's network, that is.) Docker containers still need their own IP address, too.

You probably know this already anyway, but you get my point.

So, if you want to achieve mostly the same behaviour as Docker does, have a look at the Routed Configuration section in our documentation: https://pve.proxmox.com/wiki/Network_Configuration

You can also configure that via the GUI, of course.

Note that you still might need DHCP / DNS inside the virtual network, so you'll have to set that up yourself as well.

At first I didn't change the gateway and left it blank as I just wanted the specific IP address but noticed I wasn't getting any internet connection, then I added the gateway address.
Have a look at this: https://en.wikipedia.org/wiki/Gateway_address
 
  • Like
Reactions: MoldyTaint
That is such a well thought out and detailed reply to my questions! I totally get the concept of virtual hardware and network interfaces and the need fro them. Having docker do things "automagically" is great however I feel you seem to lose the magic in doing it yourself and learning why things work the way they do. I did take a look at the Routed Configuration and will do a little more research on it and look up some youtube videos on it in general.

I really do appreciate the time you spent to reply to everything in detail. It was super helpful.
 
  • Like
Reactions: Max Carrara

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!