From 6f439254d693714c4929452cd96720f61455d762 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 30 Mar 2026 20:41:40 +0530 Subject: [PATCH 01/21] keepalived: Fixed print_track_script_indent function This function was not correctly parsing track_script. Removed option value as it was of no use and replaced it with existing option name. Removed check where the section and option name had to be equal Signed-off-by: Rishabh --- net/keepalived/files/keepalived.init | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index ac59c8103fe7f8..8cc4a847942c7d 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -215,16 +215,14 @@ print_track_script_indent() { local name value weight direction config_get name "$section" name - [ "$name" != "$curr_track_elem" ] && return 0 + if [ -z "$name" ] && return 0 - config_get value "$section" value config_get weight "$section" weight config_get direction "$section" direction - [ -z "$value" ] && return 0 [ "$direction" != "reverse" ] && [ "$direction" != "noreverse" ] && unset direction - printf '%b%s' "$indent" "$value" >> "$KEEPALIVED_CONF" + printf '%b%s' "$indent" "$name" >> "$KEEPALIVED_CONF" [ -n "$weight" ] && printf ' weight %s' "$weight ${direction:+${direction}}" >> "$KEEPALIVED_CONF" printf '\n' >> "$KEEPALIVED_CONF" } @@ -333,7 +331,7 @@ vrrp_sync_group() { config_get group "$1" group [ -z "$group" ] && return 0 - # Check if we have 'vrrp_instance's defined for + # Check if we have 'vrrp_instance's defined for # each member and remove names with not vrrp_instance defined for m in $group; do vrrp_instance_check "$m" && valid_group="$valid_group $m" @@ -670,4 +668,3 @@ start_service() { procd_set_param respawn procd_close_instance } - From 6d48739c71df9dab76802784a9583b4f8dd0bde5 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 30 Mar 2026 20:43:47 +0530 Subject: [PATCH 02/21] keepalived: Added track_script option for sync group track_script was not present for sync_group. note that with sync group, option priority doesnt work with vrrp_script Signed-off-by: Rishabh --- net/keepalived/files/keepalived.init | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 8cc4a847942c7d..0b9f82cbd7b7fc 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -345,6 +345,17 @@ vrrp_sync_group() { print_elems_indent "$1" "$INDENT_1" no_val_smtp_alert no_val_global_tracking + # Handle track_script list for sync group + local track_script_val + config_get track_script_val "$1" track_script + if [ -n "$track_script_val" ]; then + printf '%btrack_script {\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + for t in $track_script_val; do + config_foreach print_track_script_indent vrrp_script "$t" "$INDENT_2" + done + printf '%b}\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + fi + print_notify "GROUP" "$name" "$INDENT_1" notify_backup notify_master \ notify_fault notify From 169fcb74ef70ffd0c13551984ba420fbc8866de7 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 30 Mar 2026 20:48:29 +0530 Subject: [PATCH 03/21] keepalived: Updated keepalived.config added a bit of documentation for vrrp_script for the missing options added new option for vrrp_sync_group Signed-off-by: Rishabh --- net/keepalived/files/keepalived.config | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/net/keepalived/files/keepalived.config b/net/keepalived/files/keepalived.config index 4410514c42154a..138efecbf047a0 100644 --- a/net/keepalived/files/keepalived.config +++ b/net/keepalived/files/keepalived.config @@ -75,9 +75,12 @@ config globals 'globals' # list route "route1" #config vrrp_sync_group -# option name "VI_sync_group_1" -# list group "VI_1" -# list group "VI_2" +# option name "VI_sync_group_1" +# list group "VI_1" +# list group "VI_2" +# Note that priority will not work with vrrp_script +# when in sync group +# list track_script "vrrp_script1" # option smtp_alert "1" # option global_tracking 1 @@ -132,11 +135,15 @@ config globals 'globals' # option accept "1" #config vrrp_script +# option name "vrrp_script1" # option script "" # option interval "5" +# weight will increase +10 if script status is OK, otherwise -10 # option weight "10" # option fall "2" # option rise "3" +# valid values for direction reverse|noreverse -- reverse flips weight change +# option direction "reverse" #config virtual_server # option enabled "1" From b956c7fdc74595c7181f4447cfcff1152eaedac4 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 30 Mar 2026 20:57:14 +0530 Subject: [PATCH 04/21] keepalived: Added option timeout in vrrp_script. Added option timeout in vrrp_script section Made corresponding changes to keepalived.config as well Signed-off-by: Rishabh --- net/keepalived/files/keepalived.config | 2 +- net/keepalived/files/keepalived.init | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.config b/net/keepalived/files/keepalived.config index 138efecbf047a0..db0c3d26452571 100644 --- a/net/keepalived/files/keepalived.config +++ b/net/keepalived/files/keepalived.config @@ -144,6 +144,7 @@ config globals 'globals' # option rise "3" # valid values for direction reverse|noreverse -- reverse flips weight change # option direction "reverse" +# option timeout "5" #config virtual_server # option enabled "1" @@ -198,4 +199,3 @@ config globals 'globals' # option name "url2" # option path "/testurl/test2.jsp" # option digest "22" - diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 0b9f82cbd7b7fc..a80de8eaf7ba0c 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -475,7 +475,7 @@ vrrp_script() { config_section_open "vrrp_script" "$name" - print_elems_indent "$1" "$INDENT_1" script interval weight fall rise + print_elems_indent "$1" "$INDENT_1" script interval weight fall rise timeout config_section_close } From 2983ba4d283278d32b828c5df963cd1a5fb7a899 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 30 Mar 2026 20:59:29 +0530 Subject: [PATCH 05/21] keepalived: changed curr_track_elem in vrrp_instance In the section handling the parsing of track script for vrrp_instance, changed curr_track_elem to vrrp_script Signed-off-by: Rishabh --- net/keepalived/files/keepalived.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index a80de8eaf7ba0c..13a188227f5700 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -422,7 +422,7 @@ vrrp_instance() { [ -z "$optval" ] && continue printf '%b%s {\n' "${INDENT_1}" "$opt" >> "$KEEPALIVED_CONF" for t in $optval; do - config_foreach print_track_script_indent track_script "$t" "$INDENT_2" + config_foreach print_track_script_indent vrrp_script "$t" "$INDENT_2" done printf '%b}\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" done From e527de8c5df5c733a58aecfd42eee7634dd387b8 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 30 Mar 2026 21:01:05 +0530 Subject: [PATCH 06/21] keepalived: Bumped keepalived PKG_RELEASE to 3 Signed-off-by: Rishabh --- net/keepalived/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/keepalived/Makefile b/net/keepalived/Makefile index 95e10dfd31a8b6..67f7e0231274f2 100644 --- a/net/keepalived/Makefile +++ b/net/keepalived/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=keepalived PKG_VERSION:=2.3.3 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.keepalived.org/software From 4285957cb250698f443a6ee9c62b089070fdd707 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Tue, 31 Mar 2026 14:11:37 +0530 Subject: [PATCH 07/21] keepalived: Removed keyword 'if' Removed an if statement that got pushed by mistake Signed-off-by: Rishabh --- net/keepalived/files/keepalived.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 13a188227f5700..f178e32d369b71 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -215,7 +215,7 @@ print_track_script_indent() { local name value weight direction config_get name "$section" name - if [ -z "$name" ] && return 0 + [ -z "$name" ] && return 0 config_get weight "$section" weight config_get direction "$section" direction From 8848d0b8c9c6d2f4bd6c750f25b47aee9042360f Mon Sep 17 00:00:00 2001 From: Rishabh Date: Tue, 31 Mar 2026 16:56:25 +0530 Subject: [PATCH 08/21] keepalived: added back the trailing lines Signed-off-by: Rishabh --- net/keepalived/files/keepalived.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index f178e32d369b71..56ef8efd4c6932 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -331,7 +331,7 @@ vrrp_sync_group() { config_get group "$1" group [ -z "$group" ] && return 0 - # Check if we have 'vrrp_instance's defined for + # Check if we have 'vrrp_instance's defined for # each member and remove names with not vrrp_instance defined for m in $group; do vrrp_instance_check "$m" && valid_group="$valid_group $m" From 70f77b5b6481407c71ac90099ba075dbfebe9a8e Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sun, 5 Apr 2026 18:22:50 +0530 Subject: [PATCH 09/21] keepalived: added new line ending --- net/keepalived/files/keepalived.init | 1 + 1 file changed, 1 insertion(+) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 56ef8efd4c6932..fca0572274276a 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -679,3 +679,4 @@ start_service() { procd_set_param respawn procd_close_instance } + From 294f983f98b07728bc2f5880984368e39a8780fe Mon Sep 17 00:00:00 2001 From: Rishabh Shah Date: Fri, 17 Apr 2026 12:54:45 +0530 Subject: [PATCH 10/21] keepalived: added indentation in config_section_open added indentation will help the conf file look more clean Before this you had to manually add indents every time when opening a config section --- net/keepalived/files/keepalived.init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index fca0572274276a..1c36fad1b0fa86 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -16,7 +16,9 @@ INDENT_4="${INDENT_1}${INDENT_1}${INDENT_1}${INDENT_1}" config_section_open() { local tag="$1" local name="$2" + local indent="$3" + [ -n "$indent" ] && printf '%b' "$indent" >> "$KEEPALIVED_CONF" printf '%s' "$tag" >> "$KEEPALIVED_CONF" [ -n "$name" ] && printf ' %s' "$name" >> "$KEEPALIVED_CONF" printf ' {\n' >> "$KEEPALIVED_CONF" From 1ed1a0795bc4e2bcc1074e6f18cd77d61c57dd62 Mon Sep 17 00:00:00 2001 From: Rishabh Shah Date: Fri, 17 Apr 2026 12:58:28 +0530 Subject: [PATCH 11/21] keepalived: added indent in config_section_close added option for indentation in config_section_close before this you had to manually add indents when closing a section Signed-off-by: Rishabh Shah --- net/keepalived/files/keepalived.init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 1c36fad1b0fa86..9c90249b10f735 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -25,6 +25,8 @@ config_section_open() { } config_section_close() { + local indent="$1" + [ -n "$indent" ] && printf '%b' "$indent" >> "$KEEPALIVED_CONF" printf '}\n\n' >> "$KEEPALIVED_CONF" } From d73d73b5f50cca925358080fe6b2c7547dec5a67 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 14:39:23 +0530 Subject: [PATCH 12/21] keepalived: updated parse logic for track_script updated open-close config logic for track_script in vrrp_instance Signed-off-by: Rishabh --- net/keepalived/files/keepalived.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 9c90249b10f735..14260bf6144581 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -424,11 +424,11 @@ vrrp_instance() { config_get "$opt" "$1" "$opt" eval optval=\$$opt [ -z "$optval" ] && continue - printf '%b%s {\n' "${INDENT_1}" "$opt" >> "$KEEPALIVED_CONF" + config_section_open "$opt" "" "$INDENT_1" for t in $optval; do config_foreach print_track_script_indent vrrp_script "$t" "$INDENT_2" done - printf '%b}\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + config_section_close "$INDENT_1" done # Handle track_interface lists From d9773e85b95b7cf2397a6a496c12c2c0f48566ce Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 14:58:48 +0530 Subject: [PATCH 13/21] keepalived: update in parse logic for track_script updated open-close config logic for track_script in vrrp_sync_group --- net/keepalived/files/keepalived.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 14260bf6144581..e98381441b9769 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -353,11 +353,11 @@ vrrp_sync_group() { local track_script_val config_get track_script_val "$1" track_script if [ -n "$track_script_val" ]; then - printf '%btrack_script {\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + config_section_open "track_script" "" "$INDENT_1" for t in $track_script_val; do config_foreach print_track_script_indent vrrp_script "$t" "$INDENT_2" done - printf '%b}\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + config_section_close "$INDENT_1" fi print_notify "GROUP" "$name" "$INDENT_1" notify_backup notify_master \ From ca3d0eb067dd11cbb57d176dca9fabab631e002f Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 15:05:47 +0530 Subject: [PATCH 14/21] keepalived: updated parse logic for virtual_routes updated open-close config logic for virtual_routes in vrrp_instance --- net/keepalived/files/keepalived.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index e98381441b9769..7dbbc2f2d6ca31 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -412,11 +412,11 @@ vrrp_instance() { config_get "$opt" "$1" "$opt" eval optval=\$$opt [ -z "$optval" ] && continue - printf '%b%s {\n' "${INDENT_1}" "$opt" >> "$KEEPALIVED_CONF" + config_section_open "$opt" "" "$INDENT_1" for r in $optval; do config_foreach print_route_indent route "$r" "$INDENT_2" done - printf '%b}\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + config_section_close "$INDENT_1" done # Handle track_script lists From 597e31ca669fc000655390d75c6dbcd85295e5ca Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 15:10:17 +0530 Subject: [PATCH 15/21] keepalived: updated parse logic for virtual_ipaddr updated open-close config logic for virtual_ipaddress in vrrp_instance --- net/keepalived/files/keepalived.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 7dbbc2f2d6ca31..f9cadee645e900 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -400,11 +400,11 @@ vrrp_instance() { config_get "$opt" "$1" "$opt" eval optval=\$$opt [ -z "$optval" ] && continue - printf '%b%s {\n' "${INDENT_1}" "$opt" >> "$KEEPALIVED_CONF" + config_section_open "$opt" "" "$INDENT_1" for a in $optval; do config_foreach print_ipaddress_indent ipaddress "$a" "$INDENT_2" done - printf '%b}\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + config_section_close "$INDENT_1" done # Handle virtual_routes From f6ea2064ec2581e01b0bff1e328af321db550454 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 15:16:28 +0530 Subject: [PATCH 16/21] keepalived: updated parse logic for track_interface updated open-close config logic for track_interface in vrrp_instance --- net/keepalived/files/keepalived.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index f9cadee645e900..7c485a28defff7 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -436,11 +436,11 @@ vrrp_instance() { config_get "$opt" "$1" "$opt" eval optval=\$$opt [ -z "$optval" ] && continue - printf '%b%s {\n' "${INDENT_1}" "$opt" >> "$KEEPALIVED_CONF" + config_section_open "$opt" "" "$INDENT_1" for t in $optval; do config_foreach print_track_elem_indent track_interface "$t" "$INDENT_2" done - printf '%b}\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + config_section_close "$INDENT_1" done # Handle track_bfd lists From 2294eaa71bcb21c7f5e4f48a81db79bfa5d8a417 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 15:38:52 +0530 Subject: [PATCH 17/21] keepalived: updated parse logic for track_bfd updated open-close config logic for track_bfd in vrrp_instance --- net/keepalived/files/keepalived.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 7c485a28defff7..b0318b424eb443 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -448,11 +448,11 @@ vrrp_instance() { config_get "$opt" "$1" "$opt" eval optval=\$$opt [ -z "$optval" ] && continue - printf '%b%s {\n' "${INDENT_1}" "$opt" >> "$KEEPALIVED_CONF" + config_section_open "$opt" "" "$INDENT_1" for t in $optval; do config_foreach print_track_bfd_indent bfd_instance "$t" "$INDENT_2" done - printf '%b}\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + config_section_close "$INDENT_1" done # Handle simple lists of strings (with no spaces in between) From dd30c721a7fd2ab1ca46b6913a1ad6cc5dea92ad Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 15:45:18 +0530 Subject: [PATCH 18/21] keepalived: added docs for bfd_instance section config for bfd_instance was implemented but never mention in the config file. I added documentation for this in keepalived.config --- net/keepalived/files/keepalived.config | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/net/keepalived/files/keepalived.config b/net/keepalived/files/keepalived.config index db0c3d26452571..178439fdcdfc54 100644 --- a/net/keepalived/files/keepalived.config +++ b/net/keepalived/files/keepalived.config @@ -104,6 +104,17 @@ config globals 'globals' # option value "" # option weight "2" +#config bfd_instance +# option name "bfd_instance1" +# option neighbor_ip '192.168.10.1' +# option source_ip '192.168.20.1' +# option min_rx '300' +# option min_tx '300' +# option idle_tx "1000" +# option hoplimit '30' +# option max_hops '30' +# option weight '50' + #config vrrp_instance # option name "VI_1" # option use_vmac "eth0" @@ -123,6 +134,7 @@ config globals 'globals' # list virtual_ipaddress_excluded "ipaddress5" # list virtual_routes "route1" # list virtual_routes "route2" +# list track_bfd "bfd_instance1" # option mcast_src_ip "224.0.0.1" # option unicast_src_ip "192.168.0.1" # option virtual_router_id "128" From 51940d039f90ee9bb020be7bb125fabb47ac89a1 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 16:05:49 +0530 Subject: [PATCH 19/21] keepalived: updated parse logic for unicast_peer updated open-close logic for unicast_peer in vrrp_instance --- net/keepalived/files/keepalived.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index b0318b424eb443..2e5df60d279685 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -460,11 +460,11 @@ vrrp_instance() { config_get "$opt" "$1" "$opt" eval optval=\$$opt [ -z "$optval" ] && continue - printf '%b%s {\n' "${INDENT_1}" "$opt" >> "$KEEPALIVED_CONF" + config_section_open "$opt" "" "$INDENT_1" for t in $optval; do config_foreach print_unicast_peer_indent peer "$t" "$INDENT_2" done - printf '%b}\n' "${INDENT_1}" >> "$KEEPALIVED_CONF" + config_section_close "$INDENT_1" done unset optval From 3c4f35b949c8d53237a352b52ea2606cc63a0425 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 16:27:20 +0530 Subject: [PATCH 20/21] keepalived: updated print_unicast_peer_indent func print_unicast_peer_indent was missing two options- min_ttl and max_ttl. these options are added in section peer. --- net/keepalived/files/keepalived.init | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 2e5df60d279685..91360e3b17809b 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -270,7 +270,7 @@ print_unicast_peer_indent() { local section="$1" local curr_track_elem="$2" local indent="$3" - local name address + local name address max_ttl min_ttl config_get name "$section" name [ "$name" != "$curr_track_elem" ] && return 0 @@ -278,7 +278,15 @@ print_unicast_peer_indent() { config_get address "$section" address [ -z "$address" ] && return 0 - printf '%b%s\n' "${indent}" "$address">> "$KEEPALIVED_CONF" + printf '%b%s' "${indent}" "$address" >> "$KEEPALIVED_CONF" + + config_get min_ttl "$section" min_ttl + config_get max_ttl "$section" max_ttl + + [ -n "$min_ttl" ] && printf ' min_ttl %s' "$min_ttl" >> "$KEEPALIVED_CONF" + [ -n "$max_ttl" ] && printf ' max_ttl %s' "$max_ttl" >> "$KEEPALIVED_CONF" + printf '\n' >> "$KEEPALIVED_CONF" + } static_routes() { From 5bee3a7ce10fe57a35f8e27a56a10185039faa0f Mon Sep 17 00:00:00 2001 From: Rishabh Date: Sat, 18 Apr 2026 16:36:57 +0530 Subject: [PATCH 21/21] keepalived: updated config for unicast_peer updated keepalived.config for peer section. unicast peer has to be declared in section peer and has to be used with "list unicast_peer" in vrrp_instance --- net/keepalived/files/keepalived.config | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/net/keepalived/files/keepalived.config b/net/keepalived/files/keepalived.config index 178439fdcdfc54..ca60547ddbf087 100644 --- a/net/keepalived/files/keepalived.config +++ b/net/keepalived/files/keepalived.config @@ -115,6 +115,18 @@ config globals 'globals' # option max_hops '30' # option weight '50' +#config peer +# option name 'peer1' +# option address '192.168.0.1' +# option min_ttl '1' +# option max_ttl '255 + +#config peer +# option name 'peer2' +# option address '192.168.1.1' +# option min_ttl '1' +# option max_ttl '255 + #config vrrp_instance # option name "VI_1" # option use_vmac "eth0" @@ -126,8 +138,8 @@ config globals 'globals' # list track_script "track_script1" # list track_script "track_script2" # option dont_track_primary "1" -# list unicast_peer "192.168.0.1" -# list unicast_peer "192.168.1.1" +# list unicast_peer "peer1" +# list unicast_peer "peer2" # list virtual_ipaddress "ipaddress2" # list virtual_ipaddress "ipaddress3" # list virtual_ipaddress_excluded "ipaddress4"