Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/frr: staticd config not working at first startup after boot #316163

Open
woffs opened this issue May 31, 2024 · 4 comments · May be fixed by #327099
Open

nixos/frr: staticd config not working at first startup after boot #316163

woffs opened this issue May 31, 2024 · 4 comments · May be fixed by #327099

Comments

@woffs
Copy link
Contributor

woffs commented May 31, 2024

Describe the bug

After applying #274425 which I remember running fine with frr-9 we now run into
FRRouting/frr#15812

static configuration does not get recognized anymore, it has to be moved to mgmt to work again. The logic to enable mgmt when static is enabled is not the right solution anymore.

Steps To Reproduce

take a config which worked before, like

services.frr.static = {
  enable = true;
  config = ''
    ip route 10.0.0.0/8 Null0
    ip route 172.16.0.0/12 Null0
    ip route 192.168.0.0/16 Null0
  '';
};

and get

mgmtd[852]: [SHWNK-NWT5S][EC 100663304] No such command on config line 3: hostname myhost
mgmtd[852]: [SHWNK-NWT5S][EC 100663304] No such command on config line 4: log syslog
mgmtd[852]: [SHWNK-NWT5S][EC 100663304] No such command on config line 5: service password-encryption
mgmtd[852]: [SHWNK-NWT5S][EC 100663304] No such command on config line 7: ip route 10.0.0.0/8 Null0
mgmtd[852]: [SHWNK-NWT5S][EC 100663304] No such command on config line 8: ip route 172.16.0.0/12 Null0
mgmtd[852]: [SHWNK-NWT5S][EC 100663304] No such command on config line 9: ip route 192.168.0.0/16 Null0
mgmtd[852]: [SHWNK-NWT5S][EC 100663304] No such command on config line 3: hostname myhost
mgmtd[852]: [SHWNK-NWT5S][EC 100663304] No such command on config line 4: log syslog
mgmtd[852]: [SHWNK-NWT5S][EC 100663304] No such command on config line 5: service password-encryption

and a empty staticd running config with frr-10, instead of the expected routes.

Workaround

This can be worked around like

services.frr = {
    static.enable = true;
    mgmt = {
      # RFC1918 default discard
      config = ''
        ip route 10.0.0.0/8 Null0
        ip route 172.16.0.0/12 Null0
        ip route 192.168.0.0/16 Null0
      '';
    };
};

Solution?

I think we have to change nixos/modules/services/networking/frr.nix to put "static" configuration into mgmt, to not break existing setups. Later we have to change to unified config at all. @mweinelt

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.32, NixOS, 24.05 (Uakari), 24.05.20240530.0f1a94c
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.18.2
  • channels(fd): ""
  • channels(root): ""
  • nixpkgs: /nix/store/v0sia9lh4vl46dsx8dcw1q5vpj1gzndm-source
woffs added a commit to woffs/nixpkgs that referenced this issue May 31, 2024
drop a warning when a config is used which is migrated to mgmtd

quick fix for NixOS#316163
@woffs
Copy link
Contributor Author

woffs commented Jun 21, 2024

After investigating I don't think this is the case anymore. After reloading zebra the static routed get activated even if configured in static.config. So I think the startup procedure has to be fixed/reworked, or alternatively reworked to use integrated config.

@woffs woffs changed the title nixos/frr: staticd config has to go into mgmtd nixos/frr: staticd config not working at first startup after boot Jun 21, 2024
@covert8
Copy link

covert8 commented Jun 24, 2024

In my testing the mgmt config seems to use a different syntax and /etc/frr/mgmt.conf seems unrelated to routing.
The integrated config should be easy to handle as every .conf should just be appended to /etc/frr/frr.conf.
But as you said the startup had to be reworked

@woffs
Copy link
Contributor Author

woffs commented Jul 10, 2024

Refactoring is in progress.

woffs added a commit to woffs/nixpkgs that referenced this issue Jul 12, 2024
- use upstream service and scripts
- switch to integrated-vtysh-config, abandon per-daemon config
- use always daemon names in options (e.g. ospf -> ospfd)
- zebra, mgmtd and staticd are always enabled
- abandon extraOptions, vtyListenAddress, vtyListenPort options; use
  just "options" instead
- extend test to test staticd
- pkgs.servers.frr: fix sbindir and remove FHS PATH

fixes: NixOS#316163
woffs added a commit to woffs/nixpkgs that referenced this issue Jul 12, 2024
- use upstream service and scripts
- switch to integrated-vtysh-config, abandon per-daemon config
- use always daemon names in options (e.g. ospf -> ospfd)
- zebra, mgmtd and staticd are always enabled
- abandon extraOptions, vtyListenAddress, vtyListenPort options; use
  just "options" instead
- extend test to test staticd
- pkgs.servers.frr: fix sbindir and remove FHS PATH

fixes: NixOS#316163
@woffs woffs linked a pull request Jul 14, 2024 that will close this issue
13 tasks
@woffs
Copy link
Contributor Author

woffs commented Jul 15, 2024

PR #327099 is ready for a gentle review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants