Error: Nexthop has invalid gateway.

rcd

Active Member
Jul 12, 2019
235
20
38
62
I have a Proxmox server with Hetzner, with a ip range 123.123.123.112/28 (.112-.127, 16 hosts, .112 = gateway, 127= broadcast)

The host has two bridges, vmbr0 with CIDR 123.123.123.112/28 and vmbr1 with CIDR 10.10.10.1/24.

On this server I have a number of virtual machines that all work fine, but there is one Debian VM where I can't get it to accept using 123.123.123.112 as the default gateway. It accepts 10.10.10.1 but that cause all outgoing traffic from this VM to appear as coming from the Proxmox node.

The problem only occurs with this single VM, so it must be something to do with the network config of this VM.

My /etc/network/interfaces are like this, this works fine in other VM's (with their IP addresses of course, but same gateway)

Code:
allow-hotplug ens18
iface ens18 inet static
        address 123.123.123.113/28
        gateway 123.123.123.112

allow-hotplug ens19
iface ens19 inet static
        address 10.10.10.107/24

On this server the gateway isn't accepted though, it comes up like this:
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.10.10.0      0.0.0.0         255.255.255.0   U     0      0        0 ens19
123.123.123.112 0.0.0.0         255.255.255.240 U     0      0        0 ens18

If I try to add the gateway manually, I get this error:

Code:
# ip route add 123.123.123.112 dev ens18
# ip route add default via 123.123.123.112 dev ens18
Error: Nexthop has invalid gateway.

What am I missing here? Does it have something to do with the IP address being one after the gateway? It's the only difference I can see? (EDIT: I tried changing to another IP address, but still the same problem, so that's not the problem. So what is going on?)

For comparison, this is another (test) debian VM I created where it works as it should:

Code:
allow-hotplug ens18
iface ens18 inet static
        address 123.123.123.121/28
        gateway 123.123.123.112

allow-hotplug ens19
iface ens19 inet static
        address 10.10.10.101/24


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         123.123.123.112 0.0.0.0         UG    0      0        0 ens18
10.10.10.0      0.0.0.0         255.255.255.0   U     0      0        0 ens19
123.123.123.112 0.0.0.0         255.255.255.240 U     0      0        0 ens18

Is there any other file than /etc/network/interfaces that affects the network on Debian? It's the only populated file under /etc/network ...
 
Last edited:
I just tried creating an Almalinux 8 VM, and ran into exactly the same problem. I can add the hosts main IP address as gateway, but not the gateway of the assigned IP range. What is going on, is this a Proxmox problem or a Hetzner problem?
 

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!