summaryrefslogtreecommitdiff
path: root/data/templates/frr/bgp.frr.tmpl
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-04-08 20:21:28 +0200
committerChristian Poessinger <christian@poessinger.com>2021-04-08 20:21:28 +0200
commit6f6f45c57eef40ffe309f66865373d520e50b25d (patch)
tree0085436f86000597ddd32e126240583f61bddf87 /data/templates/frr/bgp.frr.tmpl
parentce361fe12c430c792361479e5b5b3228141fd36f (diff)
downloadvyos-1x-6f6f45c57eef40ffe309f66865373d520e50b25d.tar.gz
vyos-1x-6f6f45c57eef40ffe309f66865373d520e50b25d.zip
bgp: T3463: change no-ipv4-unicast order when applying configuration
The "no bgp default ipv4-unicast" option must be applied to FRR before adding any neighbor to the system. If this is not the case, neighbors will start exchanging v4 routes over v6 peers.
Diffstat (limited to 'data/templates/frr/bgp.frr.tmpl')
-rw-r--r--data/templates/frr/bgp.frr.tmpl13
1 files changed, 8 insertions, 5 deletions
diff --git a/data/templates/frr/bgp.frr.tmpl b/data/templates/frr/bgp.frr.tmpl
index 53e62928b..1cc876f20 100644
--- a/data/templates/frr/bgp.frr.tmpl
+++ b/data/templates/frr/bgp.frr.tmpl
@@ -186,10 +186,16 @@
{% endmacro %}
!
router bgp {{ local_as }} {{ 'vrf ' + vrf if vrf is defined and vrf is not none }}
-{% if parameters is defined and parameters.ebgp_requires_policy is defined %}
+{% if parameters is defined %}
+{% if parameters.ebgp_requires_policy is defined %}
bgp ebgp-requires-policy
-{% else %}
+{% else %}
no bgp ebgp-requires-policy
+{% endif %}
+{% if parameters.default is defined and parameters.default.no_ipv4_unicast is defined %}
+{# Option must be set before any neighbor - see https://phabricator.vyos.net/T3463 #}
+ no bgp default ipv4-unicast
+{% endif %}
{% endif %}
{# Workaround for T2100 until we have decided about a migration script #}
no bgp network import-check
@@ -359,9 +365,6 @@ router bgp {{ local_as }} {{ 'vrf ' + vrf if vrf is defined and vrf is not none
{% if parameters.default.local_pref is defined and parameters.default.local_pref is not none %}
bgp default local-preference {{ parameters.default.local_pref }}
{% endif %}
-{% if parameters.default.no_ipv4_unicast is defined %}
- no bgp default ipv4-unicast
-{% endif %}
{% endif %}
{% if parameters.deterministic_med is defined %}
bgp deterministic-med