NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.33k stars 14.3k forks source link

GatewayOnLink option problem #262035

Open dzxx36gyy opened 1 year ago

dzxx36gyy commented 1 year ago

Describe the bug

I am building a NixOS VM template with cloud-init (using systemd-networkd), since I push IP to the VM with cloud-init, when I use a gateway that requires GatewayOnLink = true, I have no way to set it up automatically.

If I use routeConfig, then the 10-cloud-init-eth0.network won't be generated by cloud-init (seems the pre-network just failed directly). If I use networkd-dispatcher, then the sytemd-networkd will be hanging on the "Configuring" status, unless I write the route manually (In this case, I must disable networkd-dispatcher or the switch will failed).

Want to know if there's any way to solve that, or can any maintainer consider providing an option to enable the GatewayOnlink within the configuration.nix.

Expected behavior

Add an option so that I can enable GatewayOnLink without affecting the normal usage with cloud-init.

Majiir commented 1 year ago

Can you share the config where you tried to use routeConfig?