[__bird_radv] add --default-lifetime parameter

This commit is contained in:
fnux 2024-02-21 13:38:08 +01:00
parent f101ea4afa
commit f01f110463
No known key found for this signature in database
GPG key ID: 4502C902C00A1E12
3 changed files with 13 additions and 0 deletions

View file

@ -34,6 +34,11 @@ route-preference
This option specifies the default value of advertised route preference for This option specifies the default value of advertised route preference for
specific routes. Default: medium. specific routes. Default: medium.
default-lifetime
This option specifies the time (in seconds) how long (since the receipt of RA)
hosts may use the router as a default router. 0 means do not use as a default
router. Default: 3.
OPTIONAL MULTIPLE PARAMETERS OPTIONAL MULTIPLE PARAMETERS
---------------------------- ----------------------------
route route

View file

@ -73,6 +73,12 @@ then
ROUTE_PREFERENCE="route preference $(cat "${__object:?}/parameter/route-preference");" ROUTE_PREFERENCE="route preference $(cat "${__object:?}/parameter/route-preference");"
fi fi
DEFAULT_LIFETIME=
if [ -f "${__object:?}/parameter/default-lifetime" ];
then
DEFAULT_LIFETIME="default lifetime $(cat "${__object:?}/parameter/default-lifetime");"
fi
__file "${confdir:?}/radv-${__object_id:?}.conf" \ __file "${confdir:?}/radv-${__object_id:?}.conf" \
--mode 0640 --owner root --group bird \ --mode 0640 --owner root --group bird \
--source - << EOF --source - << EOF
@ -91,6 +97,7 @@ protocol radv ${__object_id:?} {
interface "$(cat "${__object:?}/parameter/interface")" { interface "$(cat "${__object:?}/parameter/interface")" {
$MTU $MTU
$DEFAULT_LIFETIME
$DEFAULT_PREFERENCE $DEFAULT_PREFERENCE
$ROUTE_PREFERENCE $ROUTE_PREFERENCE
}; };

View file

@ -1,3 +1,4 @@
mtu mtu
default-preference default-preference
route-preference route-preference
default-lifetime