Off-subnet Gateway configuration for XCP-NG/XenServer 8 Dedicated Server
... / Off-subnet Gateway config...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

Off-subnet Gateway configuration for XCP-NG/XenServer 8 Dedicated Server

by
tcsadgg
Created on 2025-08-13 08:23:34 (edited on 2025-08-13 10:29:05) in Dedicated Servers

Public IP: 46.x.y.z/32

GW: 100.64.0.1/32

temporary configuration is possible via ip route command:

ip route add 100.64.0.1 dev xenbr0

ip route add default via 100.64.0.1

but i've problem with permanent configuration 

xe network-param-set uuid=<xe_network-list_xenbr0_uuid> other-config:static-routes=10.64.0.1/32/0.0.0.0

due to fails to apply Default Gatewa via Xen network configuration and via ip route command

ip route add default via 100.64.0.1

(Error: Nexthop has invalid gateway )

there is a chance to remediate to this behavior?


2 Replies ( Latest reply on 2025-08-13 13:13:01 by
le_sbraz
)

Hello,

I've never used XCP-NG but the keyword to look for, that most Linux distributions apply for this kind of route outside of the interface's subnet, is "onlink" (pretend that the nexthop is directly attached to this link, even if it does not match any interface prefix).

For instance, Debian's ifupdown adds it automatically since 2016: https://salsa.debian.org/debian/ifupdown/-/commit/8b7bca9597d2f75670b182f0fc149cdbaec3544c
I don't think xe supports this so maybe you could file a bug report?

A workaround could be adding a SystemD service that runs before XCP-NG's networking service and whose only job is to run "ip route add 100.64.0.1 dev xenbr0"? I don't know if that's possible, depending on whether xenbr0 has already been created by then.