summaryrefslogtreecommitdiff
path: root/data/templates/protocols
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-06-13 15:40:11 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-12-14 18:19:22 +0000
commit932af7f098808009f626c788deb9e1d1c8bf3426 (patch)
tree3845e39f7ac9c92c4ad5011524aab1e17b063468 /data/templates/protocols
parent256ad3fc329a846f1a2b7378bbeb8777357b433a (diff)
downloadvyos-1x-932af7f098808009f626c788deb9e1d1c8bf3426.tar.gz
vyos-1x-932af7f098808009f626c788deb9e1d1c8bf3426.zip
routing: T1237: Add new feature failover route
Failover route allows to install static routes to the kernel routing table only if required target or gateway is alive When target or gateway doesn't respond for ICMP/ARP checks this route deleted from the routing table Routes are marked as protocol 'failover' (rt_protos) cat /etc/iproute2/rt_protos.d/failover.conf 111 failover ip route add 203.0.113.1 metric 2 via 192.0.2.1 dev eth0 proto failover $ sudo ip route show proto failover 203.0.113.1 via 192.0.2.1 dev eth0 metric 1 So we can safely flush such routes
Diffstat (limited to 'data/templates/protocols')
-rw-r--r--data/templates/protocols/systemd_vyos_failover_service.j211
1 files changed, 11 insertions, 0 deletions
diff --git a/data/templates/protocols/systemd_vyos_failover_service.j2 b/data/templates/protocols/systemd_vyos_failover_service.j2
new file mode 100644
index 000000000..e6501e0f5
--- /dev/null
+++ b/data/templates/protocols/systemd_vyos_failover_service.j2
@@ -0,0 +1,11 @@
+[Unit]
+Description=Failover route service
+After=vyos-router.service
+
+[Service]
+Type=simple
+Restart=always
+ExecStart=/usr/bin/python3 /usr/libexec/vyos/vyos-failover.py --config /run/vyos-failover.conf
+
+[Install]
+WantedBy=multi-user.target