-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathbgpd.conf.db.addr_family.evpn.j2
78 lines (78 loc) · 2.69 KB
/
bgpd.conf.db.addr_family.evpn.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{% if 'advertise-all-vni' in af_val and af_val['advertise-all-vni'] == 'true' %}
advertise-all-vni
{% endif %}
{% if 'autort' in af_val %}
autort {{af_val['autort']}}
{% endif %}
{% if 'advertise-default-gw' in af_val and af_val['advertise-default-gw'] == 'true' %}
advertise-default-gw
{% endif %}
{% if 'dad-enabled' in af_val and 'dad-max-moves' in af_val and 'dad-time' in af_val %}
dup-addr-detection max-moves {{af_val['dad-max-moves']}} time {{af_val['dad-time']}}
{% endif %}
{% if 'dad-freeze' in af_val %}
dup-addr-detection freeze {{af_val['dad-freeze']}}
{% endif %}
{% if 'advertise-ipv4-unicast' in af_val and af_val['advertise-ipv4-unicast'] == 'true' %}
advertise ipv4 unicast
{% endif %}
{% if 'advertise-ipv6-unicast' in af_val and af_val['advertise-ipv6-unicast'] == 'true' %}
advertise ipv6 unicast
{% endif %}
{% if 'default-originate-ipv4' in af_val and af_val['default-originate-ipv4'] == 'true' %}
default-originate ipv4
{% endif %}
{% if 'default-originate-ipv6' in af_val and af_val['default-originate-ipv6'] == 'true' %}
default-originate ipv6
{% endif %}
{% if 'route-distinguisher' in af_val %}
rd {{af_val['route-distinguisher']}}
{% endif %}
{% if 'import-rts' in af_val %}
{% for irt in af_val['import-rts'] %}
route-target import {{irt}}
{% endfor %}
{% endif %}
{% if 'export-rts' in af_val %}
{% for irt in af_val['export-rts'] %}
route-target export {{irt}}
{% endfor %}
{% endif %}
{% if BGP_GLOBALS_EVPN_RT is defined and BGP_GLOBALS_EVPN_RT|length > 0 %}
{% for evpn_rt_key, evpn_rt_val in BGP_GLOBALS_EVPN_RT.items() %}
{% if vrf == evpn_rt_key[0] %}
route-target {{evpn_rt_val['route-target-type']}} {{evpn_rt_key[2]}}
{% endif %}
{% endfor %}
{% endif %}
{% if BGP_GLOBALS_EVPN_VNI is defined and BGP_GLOBALS_EVPN_VNI|length > 0 %}
{% for vni_key, vni_val in BGP_GLOBALS_EVPN_VNI.items() %}
{% if vrf == vni_key[0] %}
vni {{vni_key[2]}}
{% if 'route-distinguisher' in vni_val %}
rd {{vni_val['route-distinguisher']}}
{% endif %}
{% if 'import-rts' in vni_val %}
{% for irt in vni_val['import-rts'] %}
route-target import {{irt}}
{% endfor %}
{% endif %}
{% if 'export-rts' in vni_val %}
{% for irt in vni_val['export-rts'] %}
route-target export {{irt}}
{% endfor %}
{% endif %}
{% if BGP_GLOBALS_EVPN_VNI_RT is defined and BGP_GLOBALS_EVPN_VNI_RT|length > 0 %}
{% for vni_rt_key, vni_rt_val in BGP_GLOBALS_EVPN_VNI_RT.items() %}
{% if vrf == vni_rt_key[0] and vni_key[2] == vni_rt_key[2] %}
route-target {{vni_rt_val['route-target-type']}} {{vni_rt_key[3]}}
{% endif %}
{% endfor %}
{% endif %}
{% if 'advertise-default-gw' in vni_val and vni_val['advertise-default-gw'] == 'true' %}
advertise-default-gw
{% endif %}
exit-vni
{% endif %}
{% endfor %}
{% endif %}