Hetzner: Routing of additional IPs on vmbr0 from a different subnet

thommie

New Member
Aug 19, 2019
13
1
3
74
Hi all,

I have a problem with the routing of additional IPs on vmbr0 which are from a different subnet. My installation is a proxmox PVE community 6.x on a hetzner root server. The networking setup is routed and my primary network segment is 138.201.52.x/26 with 138.201.52.41 as the main hardware/proxmox IP. Additional IPs on VMs and containers in the SAME segment (138.x, /26) and connected through vmbr0 work without any problems.

The problems begin with additional IP assigned by Hetzner which are from a DIFFERENT segment: 136.243.85.155 and 136.243.85.156 (CIDR /27) with 136.243.85.129 as gateway. I added these IPs in the vmbr0 configuration with


up ip route add 136.243.85.155/27 dev vmbr0
up ip route add 136.243.85.156/27 dev vmbr0


which does not work (no IP connection to these IPs from outside and also not from inside - from the PVE server to the VMs). According to Hetzner support, the new IPs are correct and routable through the standard eth0 physical device where the vmbr0 is attached to.

current config on PVE:

# eth0 primary ipv4
auto enp0s31f6
iface enp0s31f6 inet static
address 138.201.52.41
netmask 255.255.255.192
gateway 138.201.52.1
pointopoint 138.201.52.1

# vbridge for public network
auto vmbr0
iface vmbr0 inet static
address 138.201.52.41
netmask 26
bridge-ports none
bridge-stp off
bridge-fd 0
up ip route add 138.201.52.38/26 dev vmbr0
up ip route add 138.201.52.53/26 dev vmbr0
up ip route add 138.201.52.27/26 dev vmbr0
up ip route add 136.243.85.155/27 dev vmbr0
up ip route add 136.243.85.156/27 dev vmbr0


and on the VM (netplan):

network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
addresses:
- 136.243.85.155/27
# gateway4: unset, only static routes
nameservers:
addresses: [ 213.133.98.98, 213.133.99.99, 213.133.100.10]
routes:
- to: 0.0.0.0/0
via: 136.243.85.129
metric: 100


Any ideas/comments? As far as I understand it, it should be possible to route those /27 adresses also on vmbr0, or am I totally wrong? I tested different setups/configs, but without any success and I am running out of ideas .... ;-(. Any help would be great ...
 

Adrian Reyer

New Member
Jan 26, 2019
11
2
3
Stuttgart
lihas.de
Host:
auto enp0s31f6
iface enp0s31f6 inet manual
up ip link set $IFACE up

auto vmbr0
iface vmbr0 inet static
address 138.201.52.41
netmask 26
gateway 138.201.52.1
bridge-ports enp0s31f6
bridge-stp off
bridge-fd 0

Gast:
so wie Du es hattest.

Evtl. musst Du im Hetzner-Robot die MAC/IP-Adressen zuweisen.

Tschoe,
Adrian
 

thommie

New Member
Aug 19, 2019
13
1
3
74
Die Lösung von Adrian funktioniert :)

PVE /etc/network/interface:

# eth0 primary ipv4
auto enp0s31f6
iface enp0s31f6 inet manual
address x.x.x.x
netmask 255.255.255.192
gateway y.y.y.y


# vbridge for public network
auto vmbr0
iface vmbr0 inet static
address x.x.x.x
netmask 26
gateway y.y.y.y
bridge-ports enp0s31f6
bridge-stp off
bridge-fd 0

Im Hetzner Robot müssen für die zusätzlichen IPs, die außerhalb des Standardnetzwerks liegen (hier waren das 136.243.85.155/156, separate MACs angefordert werden. Diese sind in der PVE Konfig für die net0/eth0 der VM/denContainer einzutragen.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!