Sample Header Ad - 728x90

ip route add fails with next hop invalid although next hop on directly connected network

9 votes
2 answers
50549 views
When I check the routing table I get following information: root@vmi24:/home/user# ip route default via 194.104.212.225 dev eth0 onlink 194.104.212.224/27 via 194.104.212.225 dev eth0 When I want to add a route to 10.0.0.0/24 via 194.104.212.226 (which is part of the directly connected 194.104.212.224/27 network, I get following error: root@vmi24:/home/user# ip route add 10.0.0.0/24 via 194.104.212.226 Error: Nexthop has invalid gateway. Another strange issue is that if I delete the default gateway, I cannot add it again because the add command for the default gateway fails with the same "Nexthop has invalid gateway" error. I am using Debian 10 on a hosted VM. When I try this on a KALI based machine have no issue adding a static route. I am running out of options, as this phenomenon prevents me from activating an openvpn (it fails inserting the /32 route to the openvpn server via the directly connected gateway on the eth0 interface What do I fail to see? What do I overlook? I have found many problems with next-hop documented but most if not all are due to not directly connected or unreachable next-hops.
Asked by Patrick De Groote (91 rep)
Jul 29, 2020, 06:40 PM
Last activity: Feb 22, 2025, 01:35 AM