Proxmox Guests static Ip with DHCP

evilsephiroth

Member
Aug 30, 2014
36
0
6
Monopoli, Italy
Hi to all.

First, thanks for all nice features packed in proxmox. I know It's a huge work and it's really a nice platform also for home server.

I've got a simple problem.

My proxmost has only one ethernet interface configured as bridge.

Host:

auto vmbr0
iface vmbr0 inet static
address 192.168.1.12
netmask 255.255.255.0
gateway 192.168.1.1
bridge_ports eth0
bridge_stp off
bridge_fd 0



1 VM guest(kvm) is configured :

# The loopback network interface
auto lo
iface lo inet loopback


# The primary network interface
auto eth0
iface eth0 inet dhcp

Ip released from dhcp 192.168.1.18. The VM can connect outside lan and ping google.

I want to make this IP (192.168.1.18) fixed inside my lan.
Is there a way to make this IP static retaing dhcp configuration?

I've tried with:
auto eth0
iface eth0 inet static
address 192.168.1.18
subnet 255.255.255.0
gateway 192.168.1.1(my gateway)

Ip is correct but no connection outside...

Thanks in advance
 
Hi,
of course you can use static addresses inside the VM - but it's dangerous to take an address from your dhcp-range (can be used by another guest)!

Seems you have an typo: subnet should be netmask.

Another good solution is to use the dhcp-server to give the mac-address of your server every time the right (and same) IP (different from your normal dhcp-range).

Udo
 
Hi,
of course you can use static addresses inside the VM - but it's dangerous to take an address from your dhcp-range (can be used by another guest)!

Seems you have an typo: subnet should be netmask.

Another good solution is to use the dhcp-server to give the mac-address of your server every time the right (and same) IP (different from your normal dhcp-range).

Udo

First: Yes, it was a typo :D I've got all address on my router mapped with MAC address so no risk but in ubuntu 14.04 VM configuring static ip, the VM can't access internet.

Second: How can I configure Mac Address -Ip mapping in dhcp-server on proxmox?
 
nevermind. :D

My router wasn't refreshing dhcp ip released so I wouldn't see my new ip.

Added mapping VirtualMac-Ip(192.168.1.18==> Mac Address) on router and now my IP is correct with outside access.

Thanks a lot :D