radvd icon indicating copy to clipboard operation
radvd copied to clipboard

FR: A including of config files

Open tsv1991 opened this issue 2 years ago • 12 comments

For large installations (more than 1000 interfaces) a including of config files is very lacking. It would be convenient to store a configuration for each interface in separate files. For example: /run/radvd/radvd.conf.d/br145.conf

tsv1991 avatar Aug 11 '23 12:08 tsv1991

On Fri, Aug 11, 2023 at 05:39:04AM -0700, Stanislav Tretiakov wrote:

It would be convenient to store a configuration for each interface in separate files.

The Feature Request has been seen.

stappersg avatar Aug 11 '23 16:08 stappersg

@tsv1991 can you provide some more details about this running with "more than 1000 interfaces".

  • Is it being run as a single large instance with all interfaces, or one instance per interface, something in-between?
  • Would you need globbing to include the config files?
  • This leads into the discussion of dynamic config reloads; what is the present behavior for a large config?
  • Does it start fast enough?
  • what if there's an error for a single interface?

robbat2 avatar Aug 20 '23 23:08 robbat2

@robbat2

  • We run radvd as one large instance.
  • Yes, it could be something like include radvd.conf.d/*.conf
  • Typical HUP call enough
  • It works fast enough, almost instantly:
Aug 22 01:40:36 debian-rt systemd[1]: Reloading radvd.service - Router advertisement daemon for IPv6...
Aug 22 01:40:36 debian-rt radvd[1199]: config file, /etc/radvd.conf, syntax ok
Aug 22 01:40:36 debian-rt systemd[1]: Reloaded radvd.service - Router advertisement daemon for IPv6.

On this example we have 1000 interfaces described in one file.

  • The same as with a single configuration file. I think that including files should work as an extension of the main one and the config should be combined as a single.

tsv1991 avatar Aug 21 '23 22:08 tsv1991

  • Should individual files pass validation in isolation?
  • Can a file be included multiple times (e.g. as common data)?
  • Should we detect/abort circular includes?

robbat2 avatar Aug 28 '23 16:08 robbat2

@robbat2 I think that all included files should processed as a single file config. Included files are just extension of main config. For example: radvd.conf:

interface dum3{
  IgnoreIfMissing on;
};
include{
 ./*.conf
};

config1.conf:

interface br9551 {
    IgnoreIfMissing on;
    AdvDefaultPreference medium;
    AdvManagedFlag off;
    MaxRtrAdvInterval 600;
    AdvReachableTime 0;
    AdvIntervalOpt on;
    AdvSendAdvert on;
    AdvOtherConfigFlag off;
    AdvRetransTimer 0;
    AdvCurHopLimit 64;
    prefix 2a0f:1::/64 {
        AdvAutonomous on;
        AdvValidLifetime 2592000;
        AdvOnLink on;
        AdvPreferredLifetime 14400;
    };
};

config2.conf:

interface br9553 {
    IgnoreIfMissing on;
    AdvDefaultPreference medium;
    AdvManagedFlag off;
    MaxRtrAdvInterval 600;
    AdvReachableTime 0;
    AdvIntervalOpt on;
    AdvSendAdvert on;
    AdvOtherConfigFlag off;
    AdvRetransTimer 0;
    AdvCurHopLimit 64;
    prefix 2a0f:2::/64 {
        AdvAutonomous on;
        AdvValidLifetime 2592000;
        AdvOnLink on;
        AdvPreferredLifetime 14400;
    };
};

And RADVD shoud treat this construct as a single config:

interface dum3{
  IgnoreIfMissing on;
};
interface br9551 {
    IgnoreIfMissing on;
    AdvDefaultPreference medium;
    AdvManagedFlag off;
    MaxRtrAdvInterval 600;
    AdvReachableTime 0;
    AdvIntervalOpt on;
    AdvSendAdvert on;
    AdvOtherConfigFlag off;
    AdvRetransTimer 0;
    AdvCurHopLimit 64;
    prefix 2a0f:1::/64 {
        AdvAutonomous on;
        AdvValidLifetime 2592000;
        AdvOnLink on;
        AdvPreferredLifetime 14400;
    };
};
interface br9553 {
    IgnoreIfMissing on;
    AdvDefaultPreference medium;
    AdvManagedFlag off;
    MaxRtrAdvInterval 600;
    AdvReachableTime 0;
    AdvIntervalOpt on;
    AdvSendAdvert on;
    AdvOtherConfigFlag off;
    AdvRetransTimer 0;
    AdvCurHopLimit 64;
    prefix 2a0f:2::/64 {
        AdvAutonomous on;
        AdvValidLifetime 2592000;
        AdvOnLink on;
        AdvPreferredLifetime 14400;
    };
};

I think that nginx has good config including implementation.

tsv1991 avatar Aug 29 '23 18:08 tsv1991