Issues with Networking on KVM Guest

D

Deleted member 109343

Guest
Hello, I'm facing some trouble post-installation with networking on KVM Guests.
After spending around ~6 hours on setting up networking to work for containers, it appears that KVM Guests can't connect to the internet.

With that said, not all guests don't connect, Windows 10 guests connect with no problem which make me believe it is an issue with configuration on the guest side.
However, CentOS 7, Ubuntu 20.04 LTS Server and Debian 10 don't connect and Debian won't even install properly because of it.

This is my /etc/network/interfaces in the host:
Code:
### Hetzner Online GmbH installimage

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback
iface lo inet6 loopback

auto eno1
iface eno1 inet static
  address 176.x.x.x
  netmask 255.255.255.224
  gateway 176.x.x.x
  up route add -net 176.x.x.x netmask 255.255.255.224 gw 176.x.x.x dev eno1

iface eno1 inet6 static
  address 2a01:4f8:x:x::x
  netmask 128
  gateway fe80::1

auto vmbr0
iface vmbr0 inet static
  address 176.x.x.x
  netmask 255.255.255.224
  bridge_stp off
  bridge_ports none
  bridge_fd 0
  bridge_maxwait 0
  up route add -host 88.99.x.x dev vmbr0 # IP No. 1 from /29
  up route add -host 88.99.x.x dev vmbr0 # IP No. 2 from /29
  up route add -host 88.99.x.x dev vmbr0 # IP No. 3 from /29
  up route add -host 88.99.x.x dev vmbr0 # IP No. 4 from /29
  up route add -host 88.99.x.x dev vmbr0 # IP No. 5 from /29
  up route add -host 88.99.x.x dev vmbr0 # IP No. 6 from /29
  up route add -host 88.99.x.x dev vmbr0 # IP No. 7 from /29
  up route add -host 88.99.x.x dev vmbr0 # IP No. 8 from /29

iface vmbr0 inet6 static
  address 2a01:4f8:x:x:x::x
  netmask 64

Worth mentioning that on LXC containers networking works flawlessly, with a Dual-Stack connectivity.

I'll appreciate any help I can get, I saw similar issues on the forum, some even had partial resolutions for IPv4 connectivity in Ubuntu, but nothing about other distributions or IPv6 connectivity.

Thanks a lot and stay safe,
Daniel.
 
as you use /32 addresses, you need to configure point to point address.

config is different between centos, debian, ubuntu.

debian vm
--------------

Code:
auto ens18
iface ens18 inet static
  address 88.99.x.x /32
  gateway 176.x.x.x
  pointopoint 176.x.x.x    ##NEEDED for /32


ubuntu vm (netplan)
------------------------------
Code:
network:
  version: 2
  renderer: networkd
  ethernets: 
    ens18: 
      addresses: [ "88.99.x.x /32" ] 
      routes: 
        - to: 0.0.0.0/0 
          via: 176.x.x.x
          on-link: true      ##NEEDED for /32


centos7
-----------
Code:
# /etc/sysconfig/network-scripts/ifcfg-ens18
DEVICE=ens18
ONBOOT=yes
BOOTPROTO=static
IPADDR=88.99.x.x
NETMASK=255.255.255.255
SCOPE="peer 176.x.x.x"      ##NEEDED for /32

##/ etc/sysconfig/network-scripts/route-ens18
ADDRESS0=0.0.0.0
NETMASK0=0.0.0.0
GATEWAY0=176.x.x.x
 
as you use /32 addresses, you need to configure point to point address.

config is different between centos, debian, ubuntu.

debian vm
--------------

Code:
auto ens18
iface ens18 inet static
  address 88.99.x.x /32
  gateway 176.x.x.x
  pointopoint 176.x.x.x    ##NEEDED for /32


ubuntu vm (netplan)
------------------------------
Code:
network:
  version: 2
  renderer: networkd
  ethernets:
    ens18:
      addresses: [ "88.99.x.x /32" ]
      routes:
        - to: 0.0.0.0/0
          via: 176.x.x.x
          on-link: true      ##NEEDED for /32


centos7
-----------
Code:
# /etc/sysconfig/network-scripts/ifcfg-ens18
DEVICE=ens18
ONBOOT=yes
BOOTPROTO=static
IPADDR=88.99.x.x
NETMASK=255.255.255.255
SCOPE="peer 176.x.x.x"      ##NEEDED for /32

##/ etc/sysconfig/network-scripts/route-ens18
ADDRESS0=0.0.0.0
NETMASK0=0.0.0.0
GATEWAY0=176.x.x.x

Magnificent! That's just what I was looking for. Thank you so much.

How does that work with IPv6? I can't get IPv6 connectivity either. I assign each server with a /80 subnet (o.g. from /64).

Again, can't stress how much that helped me!
 
for ipv6, it's simpler, as you have a big subnet, you don't need point to point interface.
(the main need of /32 address, it to not loose 2 ips addresses on your /29, the network && broadcast addresses)

add an extra vmbr0 with ipv6

with only:

Code:
iface vmbr0 inet6 static
       address  youripv6/80


then in you vm, setup an ipv6 and use vmbr0 ipv6 address as gateway.
 
for ipv6, it's simpler, as you have a big subnet, you don't need point to point interface.
(the main need of /32 address, it to not loose 2 ips addresses on your /29, the network && broadcast addresses)

add an extra vmbr0 with ipv6

with only:

Code:
iface vmbr0 inet6 static
       address  youripv6/80


then in you vm, setup an ipv6 and use vmbr0 ipv6 address as gateway.

Hi, my vmbr0 is like the one above, or to be percise, to one in the thread (the one in the end) and yet my KVM guest fails to connect over IPv6. IPv4 works now.
 

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!