how configure VMs on a different networks than host?

bdario58

Member
Jul 20, 2019
8
0
6
66
Hello to all,
my environment:
host: proxmox 6.1-3 installed on a server with 4 nic:

- en0
IP: 172.16.1.100/24
d.g. 172.16.1.1
used for proxmox host management (to manage the physical server)

- en1
IP: 172.16.2.99/24
d.g. 172.16.2.1
used to connect the server to the network

- en2
not used

- en3
not used

my goal:
create a VM with the following characteristics:
guest: CentOS 7
IP: 172.16.2.99/24
D.G. 172.16.2.1
as in the picture

the issue:
I can't assign the IP address 172.16.2.99 to the VM
The IP address 172.16.2.99 is always assigned to ProxMox host

Please, can someone show me an easy how to do to follow?
 

Attachments

  • proxmox_1.jpg
    proxmox_1.jpg
    27.4 KB · Views: 34
Hi,

Usually, VM's are connected via bridges to the networks they belong to.
Set up a bridge vmbr0 with the ip 172.16.2.98/24
Assign your nic en1 to this bridge.
en1 does not need an ip-address.
Attach the nic of your vm to bridge vmbr0 and inside the vm give it the ip 172.16.2.99/24.

That's it.
Be aware that you can connect to the Proxmox-WebUI over all connectd interfaces.
So it's reachable over 172.16.2.0/24, too.
To prevent unwanted access, consider to configure the firewall within Proxmox to not allow traffic from vm to host.
 
As another note, bridges do not need to have an IP set. So if the NIC which is configured as bridge port should only be used for the VMs and not to access the Proxmox UI, just don't configure an IP address.

You can also create "internal" networks by not setting a bridge port.
 
Please correct me, if i'm wrong:

en1 without ip -> attached to eg vmbr0 with 172.16.2.98/24 -> WebUi could get reached from vm with ip 172.16.2.99/24 attached to vmbr0, too

vmbr0 without an attached nic and vm with 172.16.2.99/24 connected = only internal networking -> no connect to the outside

en1 with ip 172.16.2.98/24 -> attached to vmbr0 + vm with 172.16.2.99/24 attached to vmbr0, too = WebUI of the host not reachable?
 
en1 without ip -> attached to eg vmbr0 with 172.16.2.98/24 -> WebUi could get reached from vm with ip 172.16.2.99/24 attached to vmbr0, too
yes
vmbr0 without an attached nic and vm with 172.16.2.99/24 connected = only internal networking -> no connect to the outside
yep
en1 with ip 172.16.2.98/24 -> attached to vmbr0 + vm with 172.16.2.99/24 attached to vmbr0, too = WebUI of the host not reachable?
having the IP set on the bridge port and not the bridge is not a default setup. that might cause some issue but I am not sure. The webui should still be reachable. After a regular install with the installer that would be the setup you have out of the box. Not sue if it would be the same in the case of @bdario58 as there is already a NIC configured. But AFAIK the webui server will listen on any configured IP.
 
Hello guys,
I tried to follow gmed's directions but I lost the server. I will install it again following the gmed's directions
I'll let you know
cheers
Dario
 

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!