delghen

New Member
Sep 8, 2024
2
0
1
Hello,
I would like to set up an environment with multiple VMs running on a single server and assign an individual static IP for each of the VMs. The main server would be connecting to a single router with a public static IP.
Is there even a way to do this? I am new to this so apologies if this is a simple query.
 
I assign the static ip inside the router. Each VM has her own MAC Adress
 
Sounds like you need a DHCP server on your network with static reservations or you need to hard code the IP address in each VM manually. LXCs you can specify the IP address in the config or use DHCP.
 
Sounds like you need a DHCP server on your network with static reservations or you need to hard code the IP address in each VM manually. LXCs you can specify the IP address in the config or use DHCP.
Could you break that down a little bit? I am a complete beginner.
What is the cheapest/easiest to implement?
 
The easiest way is to hard code the IP address in each LXC/VM. The LXC can be done in the Proxmox gui. Here is a screen shot of the Network tab as you create one. Change the IPv4/CIDR to your desired IP address for that LXC.

1726503413584.png

If you already have it created, you can click in the LXC and goto Network and view/change it:
1726503527505.png
The /24 on the end of the IP address means it is a Class C or a 24 bit network. Generally home use use 192.168.x.x where the first x is usually a 1 but as you see in my case, I used a 5. The second x can be anything from 1-254 (0 and 255 is reserved and can't be assigned). Your router will probably be either 1 or 254 (first or last ip address you can assign). As you see in my example above, mine is 1.

For the VMs, it depends on the guest you are installing. If you go with Ubuntu server, this is a link on how to do it. It will be similar for each flavor of linux but check the documentation. https://ubuntu.com/server/docs/configuring-networks

Keep in mind, if your current router assigns IP addresses already (DHCP) then you will need to not assign them in the range that your router does. Most don't use the full 256 IPs and just use a subset - typically something like between IPs ending between 100 and 199 or something like that.


If you decide to go the DHCP route (with static IP reservations) there are many options and that depends on if you want a gui to work with, can set reservations on your current router, or need to install a DHCP service on a VM (linux or windows). This is a better end solution in my opinion but will be a longer setup as you have to learn this side before you can deploy it.
 

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!