VM has no connection to the outside world

pve n00b

Member
Oct 21, 2017
8
1
8
56
Hi,
first, I am new to Proxmox and hassle with the networking stuff.
I know, this - or similiar problems - are discussed all over the net but I checked out a lot of tutorials and forum posts like
debianforum.de/forum/viewtopic.php?f=30&t=149440 or
wiki.hetzner.de/index.php/Proxmox_VE#Netzwerkkonfiguration_Gastsystem_OpenVZ or this one:
https://pve.proxmox.com/wiki/Network_Model#Routed_Configuration .
Unfortunately, none of the configurations discussed are working for me or I didn't get it. I think, it's the second reason.... :/

Goal: I want to make all of my VMs and CTs accessible from the internet. Every VM/CT should have its own IP. These IPs are in another net than the main IP of the server.

PVE host has 62.xxx.xxx.99
Netmask 255.255.255.0
Gateway 62.xxx.xxx.1

Additional IPs are from 82.xxx.xxx.10 to 82.xxx.xxx.20
Netmask 255.255.254.0
Gateway 82.xxx.yyy.1

This is my current config of

/etc/network/interfaces (host):

Code:
auto lo
iface lo inet loopback

iface eno1 inet manual

auto eno2
iface eno2 inet static
        address 62.xxx.xxx.99
        netmask 255.255.255.0
        gateway 62.xxx.xxx.1
        post-up echo 1 > /proc/sys/net/ipv4/conf/eno2/proxy_arp
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward

auto vmbr0
iface vmbr0 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        bridge_ports none
        bridge_stp off
        bridge_fd 0
(taken from https://forum.proxmox.com/threads/i...cannot-access-the-internet.36061/#post-176699)

Here, the contetnt of "interfaces" at my test VM (Ubuntu 16.04):

Code:
auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
     address 82.xxx.xxx.10
     netmask 255.255.254.0
     gateway 192.168.0.1
     dns-nameservers 4.4.4.4 8.8.8.8

Result: VM can't be reached from the outside nor is the gateway (or any other address) reachable by the VM.

Can someone push me in the right direction, pls?

Thanks a lot.

Edit: To make it more visual, this is what I need to setup:
Code:
          Uplink
            ^
            |
            |
          P V E
     IP 62.xxx.xxx.99
            |
   -------------------
  |                   |
  CT                  VM
  82.xxx.xxx.10       82.xxx.xxxx11

Isn't that possible?
 
Last edited:
Okay, now I've changed the vmbr0 IP to the main IP of the server and added this IP as the gateway in the VM
I can ping the gateway of the VM now, but nothing else (unknown host).
The current config looks like this:

/etc/network/interfaces (Host):
Code:
auto lo
iface lo inet loopback

iface eno1 inet manual

auto eno2
iface eno2 inet static
       address 62.xxx.xxx.99
       netmask 255.255.255.0
       gateway 62.xxx.xxx.1
       post-up echo 1 > /proc/sys/net/ipv4/conf/eno2/proxy_arp
       post-up echo 1 > /proc/sys/net/ipv4/ip_forward

auto vmbr0
iface vmbr0 inet static
       address 62.xxx.xxx.99
       netmask 255.255.255.0
       bridge_ports none
       bridge_stp off
       bridge_fd 0
       pre-up brctl addbr vmbr0
       up ip route add 82.xxx.xxx.10/32 dev vmbr0
       down ip route del 82.xxx.xxx.10/32 dev vmbr0

/etc/network/interfaces (VM):
Code:
auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
    address 82.xxx.xxx.10
    netmask 255.255.254.0
    gateway 62.xxx.xxx.99
What do I miss?
 
I didn't touch the first part of the interfaces file where my ethernet adapter was specified and working. I did dump the ipv6 lines though... The only thing I did was add the following vmbr1 to the end of the file. Dump your vmbr0


Code:
### Hetzner Online GmbH installimage

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp4s0
iface enp4s0 inet static
  address 5.9.22.10
  netmask 255.255.255.224
  gateway 5.9.22.2
  # route 5.9.22.1/27 via 5.9.22.2
  up route add -net 5.9.22.1 netmask 255.255.255.224 gw 5.9.22.2 dev enp4s0

# for a subnet
auto vmbr1
iface vmbr1 inet static
       address  88.99.33.1  < first usable IP address from subnet>
       netmask 255.255.255.248  <your network mask from the subnet as specified in Robot>
       bridge_ports none
       bridge_stp off
       bridge_fd 0
       post-up echo 1 > /proc/sys/net/ipv4/ip_forward


For the client VM, do the following:

Code:
# device: eth0
auto  eth0
iface eth0 inet static
       address 88.99.33.2  < A usable IP address from the subnet >
       netmask 255.255.255.248  < Netmask of the subnet >
       gateway 88.99.33.1  < IP from the subnet configured in the Host system >
 

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!