summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-04-10 10:57:34 +0200
committerChristian Breunig <christian@breunig.cc>2023-04-13 09:01:31 +0200
commitb454ddc8c2cc0edbdc832bd60ef03a1819a6d8d6 (patch)
tree530343f475c58af633766d13928d289d6edf0a2a /data
parentf9aa4c6312a773c216e65400db7e66849d5a02c7 (diff)
downloadvyos-1x-b454ddc8c2cc0edbdc832bd60ef03a1819a6d8d6.tar.gz
vyos-1x-b454ddc8c2cc0edbdc832bd60ef03a1819a6d8d6.zip
T5150: initial VRF support for Kernel/Zebra route-map filtering
Diffstat (limited to 'data')
-rw-r--r--data/configd-include.json1
-rw-r--r--data/templates/frr/vrf-vni.frr.j29
-rw-r--r--data/templates/frr/zebra.route-map.frr.j226
-rw-r--r--data/templates/frr/zebra.vrf.route-map.frr.j224
4 files changed, 31 insertions, 29 deletions
diff --git a/data/configd-include.json b/data/configd-include.json
index 456211caa..1c843e9fa 100644
--- a/data/configd-include.json
+++ b/data/configd-include.json
@@ -86,5 +86,4 @@
"vpn_pptp.py",
"vpn_sstp.py",
"vrf.py",
-"vrf_vni.py"
]
diff --git a/data/templates/frr/vrf-vni.frr.j2 b/data/templates/frr/vrf-vni.frr.j2
deleted file mode 100644
index e5f4810a1..000000000
--- a/data/templates/frr/vrf-vni.frr.j2
+++ /dev/null
@@ -1,9 +0,0 @@
-{% if name is vyos_defined %}
-{% for vrf, vrf_config in name.items() %}
-vrf {{ vrf }}
-{% if vrf_config.vni is vyos_defined %}
- vni {{ vrf_config.vni }}
-{% endif %}
- exit-vrf
-{% endfor %}
-{% endif %}
diff --git a/data/templates/frr/zebra.route-map.frr.j2 b/data/templates/frr/zebra.route-map.frr.j2
index bd461d904..8e18abbde 100644
--- a/data/templates/frr/zebra.route-map.frr.j2
+++ b/data/templates/frr/zebra.route-map.frr.j2
@@ -1,21 +1,9 @@
!
-{% 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 %}
+{% if protocol is vyos_defined %}
+{% for protocol_name, protocol_config in protocol.items() %}
+{% if protocol_name is vyos_defined('ospfv3') %}
+{% set protocol_name = 'ospf6' %}
+{% endif %}
+{{ afi }} protocol {{ protocol_name }} route-map {{ protocol_config.route_map }}
+{% endfor %}
{% endif %}
-!
diff --git a/data/templates/frr/zebra.vrf.route-map.frr.j2 b/data/templates/frr/zebra.vrf.route-map.frr.j2
new file mode 100644
index 000000000..eb6abd8e7
--- /dev/null
+++ b/data/templates/frr/zebra.vrf.route-map.frr.j2
@@ -0,0 +1,24 @@
+!
+{% if name is vyos_defined %}
+{% for vrf, vrf_config in name.items() %}
+vrf {{ vrf }}
+{% if vrf_config.ip.protocol is vyos_defined %}
+{% for protocol_name, protocol_config in vrf_config.ip.protocol.items() %}
+ ip protocol {{ protocol_name }} route-map {{ protocol_config.route_map }}
+{% endfor %}
+{% endif %}
+{% if vrf_config.ipv6.protocol is vyos_defined %}
+{% for protocol_name, protocol_config in vrf_config.ipv6.protocol.items() %}
+{% if protocol_name is vyos_defined('ospfv3') %}
+{% set protocol_name = 'ospf6' %}
+{% endif %}
+ ipv6 protocol {{ protocol_name }} route-map {{ protocol_config.route_map }}
+{% endfor %}
+{% endif %}
+{% if vrf_config.vni is vyos_defined %}
+ vni {{ vrf_config.vni }}
+{% endif %}
+{% endfor %}
+ exit-vrf
+!
+{% endif %}