Using a public IP for each created VM

hayzam

Member
Jul 9, 2021
1
0
6
24
Hello guys,

I'm pretty new to Proxmox and virtualization/networking in general and I've searched for this topic quite a bit. So basically my problem is that I have a dedicated server on Hetzner with the IP (65.21.121.xxx) and I got a subnet package from them for me to assign an IP(135.181.166.xxx) to each of my new VMs that I will create.

This is what my /etc/network/interfaces file looks like now, I tried a bunch of stuff but none of them work but this config atleast let me SSH in from the (135.181.166.xxx) IP.

Code:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback
iface lo inet6 loopback

auto enp195s0
iface enp195s0 inet static
  address 65.21.121.xxx
  netmask 255.255.255.192
  gateway 65.21.121.xxx
  up route add -net 65.21.121.xxx netmask 255.255.255.192 gw 65.21.121.xxx dev enp195s0

iface enp195s0 inet6 static
  address 2a01:4f9:3b:4xx9::2
  netmask 64
  gateway fe80::1

auto enp195s0:1
iface enp195s0:1 inet static
  address 135.181.166.xxx
  netmask 255.255.255.248
  gateway 65.21.121.xxx

I'm using Debian 10 as my host and Ubuntu 20.04 as the VM if that helps (annoying because I'm not used to the net plan config)

Any help on how I can config for me to able to connect each subnett-ed IP to each of the VMs I create will be very helpful, thank you!
 

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!