[SOLVED] Proxmox guest VM IP setup

izghitu

Member
Apr 4, 2018
8
1
8
40
Hi,

I have a Proxmox server running on Debian 10. It is new and I am trying to properly setup the networking for the gues VMs. I need to be able to set each guest VM with its own external IP.

On proxmox Host I have this:
Code:
cat /etc/network/interfaces
...
auto enp65s0f0
iface enp65s0f0 inet static
        address 192.80.131.4/24
        gateway 192.80.131.1
        dns-nameservers 8.8.8.8 1.1.1.1

auto vmbr0
iface vmbr0 inet static
        address 192.80.131.5
        netmask 255.255.255.0
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        up ip route add 192.80.131.6 dev vmbr0
        post-up iptables -t nat -A POSTROUTING -s 192.80.131.0/24 -o vmbr0 -j MASQUERADE
        post-up iptables -t nat -A POSTROUTING -s 192.80.131.0/24 ! -d 192.80.131.0/24 -o enp65s0f0 -j MASQUERADE

On guest VM:
Code:
cat /etc/netplan/50-cloud-init.yaml
network:
    ethernets:
        ens18:
            addresses:
            - 192.80.131.6/24
            gateway4: 192.80.131.5
            nameservers:
                addresses:
                - 8.8.8.8
    version: 2

And I have ipv4 forwarding enabled.

I do get the internet connection on the guest VM but when I check the external IP using "curl ipecho.net" I get the IP of proxmox host.

What I need is for each guest VM to have its own external IP that I setup. I own the whole 192.80.131.0/24 CIDR and I need to run as many VMs as I want that will have its own external IP.

Is there any guide that shows how I need to setup the networking, routing and firewall rules in order to achieve this?

Please help
Thanks in advance.
 
Glad the reference documentation helped!
Please mark the thread as 'SOLVED' (by clicking on the 3 dots '...' above your first post -> Edit Thread -> Select 'SOLVED' as prefix)

This helps other users with similar issues

Thanks!
 

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!