New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Public IP for VM in proxmox with the main IP in the same subnet with IP for VM
windytime90
Member
in Help
Hi,
I have a server with a /28 IP allocation (100.100.100.96/28 for example). I'd like to setup proxmox for virtual environment. My network model should be like this:
- Gateway: 100.100.100.97
- Main IP for proxmox host: 100.100.100.98
- IP for VMs: 100.100.100.99 ~ 100.100.100.109
After some researches, I found that the below configuration is mentioned a lot:
For proxmox host:
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 100.100.100.98
netmask 255.255.255.240
gateway 100.100.100.97
# The bridge
auto vmbr0
iface vmbr0 inet static
address 100.100.100.98
netmask 255.255.255.255
bridge_ports none
bridge_stp off
bridge_fd 0
up ip route add 100.100.100.99/32 dev vmbr0
down ip route del 100.100.100.99/32 dev vmbr0
...
And for VM:
IP: 100.100.100.98
Netmask: 255.255.255.255
My VM is Windows VM. With these configuration, I can ping from my Windows VM to proxmox host but cannot get internet connection. Did I do something wrong? Please help me clear a bit.
Thank you in advance.
Comments
make eth0 part of vmbr0, setup public IP on vmbr0 and configure the VMs with IPs normally. What you're doing here is going around, likely unnecessarily, and to work still requires arp proxy at least.
For the Windows VM:
IP Address:100.100.100.99
Netmask: 255.255.255.240
Gateway:100.100.100.97
@hwt iptables rules in route command ? Additionally, why would you be masquerading on public IP space ?
My mistake, it appears that the last line (up) isn't needed.
Hi,
Thank you for all the recommendation.
@hwt: In proxmox wiki, they said that
Most hosting providers do not support the above setup (the configuration like yours) . For security reasons they disable networking as soon as they detect multiple MAC addresses on a single interface. See discussion on multiple subnets on proxmox using different gateways.
So I wonder if these settings are OK for long-term usage? Thank you.
Clouvider: Thank you for your suggestion but I am a newbie in Linux routing. Could you please help me with a little more detail so I can have a clue to dig more? Thanks.
@hwt example without the 'up' line is good.
In regards to what you refer to in the Wiki, you need to check with your provider, only they know their policies.