Hetzner Dedicated Server - Dual public IP setup

Mike.

New Member
Oct 22, 2023
2
0
1
Hello my friends!


I have bought a Dedicated Server at Hetzner and ordered an additional IP address in order to have one for the Proxmox VE itself, and another for a VM I will create inside Proxmox VE.

Now, my problem is, I have tried for around 5-6 hours to use some instructions found on the internet ( e.g. , or e.g.2 ) but I did not manage to make a VM have internet access. Please, I am desperate, could someone help me?

In the following I will use:
<IP0> = Main IP of the server ( which I use to connect to Proxmox VE )
<IPV6> = Main ipv6 of the server
<IP1> = Secondary IP that I have bought
<GATEWAY0> = gateway ip indicated by Hetzner


After a fresh install of proxmox using installImage from Hetzner, my /etc/network/interfaces looks something like this:
Code:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
iface lo inet6 loopback
auto enp35s0
iface enp35s0 inet static
        address <IP0>/27
        gateway <GATEWAY0>
        up route add -net <aa.bb.cc ( identical with IP0)>.224 netmask 255.255.255.224 gw <GATEWAY0> dev enp35s0
# route <aa.bb.cc ( identical with IP0)>.224/27 via <GATEWAY0>

iface enp35s0 inet6 static
        address <IPV6>/64
        gateway fe80::1

iface eth0 inet manual    # <- Topic Author comment: I think this is actually useless


Now, from what I understand, I am able to create a network like 192.168.100.x , which can have multiple machines that use my <IP0> as a "gateway", something like this:
Code:
auto vmbr0
iface vmbr0 inet static
        address  10.10.10.1
        netmask  255.255.255.0
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr1 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr1 -j MASQUERADE


Then, can someone help me setup a network config file that has one "vmbr0" for example which allows a VM to have <IP1>, and a "vmbr1" which is a 'subnet' just like the one mentioned in the code right above this paragraph?
 
Last edited:
Hi,

I have quite the same setup and gladly share my learnings. To be frank, it took me a while as well.
Don't forget to order custom MAC addresses from Hetzner for the 2nd-IP and subsequently configure the VM accordingly.
I shortend the config to show ipv4 only.

PVE config

auto lo
iface lo inet loopback

auto vmbr0
iface vmbr0 inet static
address MAINIP/27
gateway GATEWAYIP
bridge_ports eno1
bridge_stp off
bridge_fd 0
bridge_maxwait 0
up route add -net SUBIP netmask 255.255.255.224 gw GATEWAYIP dev vmbr0

VM config
other NICID may apply

iface lo inet loopback
allow-hotplug ens18
iface ens18 inet static
address SUBIP/27
gateway GATEWAYPI

Best
 

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!