How do you configure multiple IPs in Proxmox ?
Thanks to @VirMach and his virtbot deals, I ended up with a VM with 6 IPs available.
So what is the best way to configure these to integrate in to Proxmox.
It would be great if you could give examples of /etc/network/interfaces allocation and how you set Proxmox, I assume using a virtual bridge?
I don't need NAT (already got that configured for the main ip). So each extra IP woulld be dedicated to just a single LXC / VM.
Hopefully these details will also prove handy for others.
Thanks.
Thanked by (1)VirMach
Comments
You choose one of the IPs for the host and configure the gateway, like
Then the other IPs (assuming on the same subnet) are configured in the respective container/VM.
If the hypervisor doesn't filter out extra MACs, you can just slap network interfaces into a bridge and bob's your uncle.
Otherwise you need a routed setup,
or if you're feeling a bit adventurous configure them on the host then DNAT them into the VM/CTs.
Here's my interfaces snippet, to get you started. Then just add one of your other IPs to a newly created VM, using the same gateway as the host.
Your primary network device name (enp2s0) may be different.
Notes: other methods are possible. I run CSF as the firewall on the host, rather than the Proxmox one. None of my multi-IP Virmach VPS have sufficient RAM for Proxmox, so the above is on a dedicated server.
[Edit] Hmm, tempted to at least try on a 2GB RAM VPS, just for kicks.
It wisnae me! A big boy done it and ran away.
NVMe2G for life! until death (the end is nigh)
'Cos I prefer to partition..
https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm
It wisnae me! A big boy done it and ran away.
NVMe2G for life! until death (the end is nigh)
just enter ip and gateway by hand to the vps
Oh ffs - that was so simple !!!
I did mess around with bridges etc etc and was really struggling. Why is it that engineers never take the most obvious route ?
Seeing as you're sorted, I'll leave my already configured server alone.
It wisnae me! A big boy done it and ran away.
NVMe2G for life! until death (the end is nigh)
Oh go on, you know your really want to bugger things up - think of the learning experience
Mine is already part of a cluster and I didn't fancy all of hassle of removing it, rebuilding and then somehow joining to the cluster again.
@msatt
Took a new @Virmach VPS with only 1.5GB RAM and gave it 3GB swap. Installed Debian 12, manually partitioning the storage. Disabled pve clustering stuff (to save resources).
Needed the previously quoted interfaces example, to create a bridge - CT (container) required a bridge in the GUI.
Installed Turnkey lighttpd-php-fastcgi using only 512MB RAM & 512MB swap. I used the additional IP address, as supplied.
Works great!
It wisnae me! A big boy done it and ran away.
NVMe2G for life! until death (the end is nigh)
Precisely no need to add to the main interface.
Free Hosting at YetiNode | Cryptid Security | URL Shortener | LaunchVPS | ExtraVM | Host-C | In the Node, or Out of the Loop?
When created in the GUI a bridge is required, perhaps not the case if using CLI (I don't know).
It wisnae me! A big boy done it and ran away.
NVMe2G for life! until death (the end is nigh)
Just did it and didn't need to, IP/29 on bridge assigned IP to kvm container. Works fine.
If it is setup correctly the bridge is the interface not eth0 or whatever it is named for you.
Free Hosting at YetiNode | Cryptid Security | URL Shortener | LaunchVPS | ExtraVM | Host-C | In the Node, or Out of the Loop?
Weird. When I find time I'll fire up the testbed and try again.
It wisnae me! A big boy done it and ran away.
NVMe2G for life! until death (the end is nigh)
As long as you add the correct subnet mask eg. /29 plus the netmask, gateway to the interface you should be able to assign any IP inside it to a vm.
Example:
IPADDR="192.158.0.1/29"
NETMASK="255.255.255.0"
Gateway="192.168.0.1"
Free Hosting at YetiNode | Cryptid Security | URL Shortener | LaunchVPS | ExtraVM | Host-C | In the Node, or Out of the Loop?
Create bridge and set your vm network using the bridge.
Add ip to your vm as you wish