summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-04-08 22:09:04 +0200
committerChristian Breunig <christian@breunig.cc>2023-04-13 09:01:31 +0200
commit3f4de1390d6459cdd17dd1b6f22b1a3aec002671 (patch)
tree5091149b640ff7b064b87f2e1391f931ba5a7677 /data/templates
parent8993298bc2c9d3e796d658dc71ba6ae6afedc4c3 (diff)
downloadvyos-1x-3f4de1390d6459cdd17dd1b6f22b1a3aec002671.tar.gz
vyos-1x-3f4de1390d6459cdd17dd1b6f22b1a3aec002671.zip
T5150: initial implementation of new Kernel/Zebra route-map support
It is possible to install a route-map which filters the routes between routing daemons and the OS kernel (zebra) As of now this can be done by e.g. * set protocols ospf route-map foo * set protocols ospfv3 route-map foo * set protocols bgp route-map foo Which in turn will install the following lines into FRR * ip protocol ospf route-map foo * ipv6 protocol ospf6 route-map foo * ip protocol bgp route-map foo The current state of the VyOS CLI is incomplete as there is no way to: * Install a filter for BGP IPv6 routes * Install a filter for static routes * Install a filter for connected routes Thus the CLI should be redesigned to close match what FRR does for both the default and any other VRF * set system ip protocol ospf route-map foo * set system ipv6 protocol ospfv3 route-map foo * set system ip protocol bgp route-map foo * set system ipv6 protocol bgp route-map foo The configuration can be migrated accordingly. This commit does not come with the migrator, it will be comitted later.
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/frr/zebra.route-map.frr.j221
1 files changed, 21 insertions, 0 deletions
diff --git a/data/templates/frr/zebra.route-map.frr.j2 b/data/templates/frr/zebra.route-map.frr.j2
new file mode 100644
index 000000000..bd461d904
--- /dev/null
+++ b/data/templates/frr/zebra.route-map.frr.j2
@@ -0,0 +1,21 @@
+!
+{% if vrf is vyos_defined %}
+vrf {{ vrf }}
+{% if protocol is vyos_defined %}
+{% for prot, prot_config in protocol.items() %}
+ {{ afi }} protocol {{ protocol }} route-map {{ prot_config.route_map }}
+{% endfor %}
+{% endif %}
+ exit-vrf
+!
+{% else %}
+{% if protocol is vyos_defined %}
+{% for prot, prot_config in protocol.items() %}
+{% if prot is vyos_defined('ospfv3') %}
+{% set prot = 'ospf6' %}
+{% endif %}
+{{ afi }} protocol {{ prot }} route-map {{ prot_config.route_map }}
+{% endfor %}
+{% endif %}
+{% endif %}
+!