forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolicies.conf.j2
76 lines (76 loc) · 2.68 KB
/
policies.conf.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
!
! template: bgpd/templates/voq_chassis/policies.conf.j2
!
bgp community-list standard LOCAL_ANCHOR_ROUTE_COMMUNITY permit {{ constants.bgp.local_anchor_route_community }}
bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit {{ constants.bgp.internal_community }}
bgp community-list standard DEVICE_INTERNAL_FALLBACK_COMMUNITY permit {{ constants.bgp.internal_fallback_community }}
bgp community-list standard NO_EXPORT permit no-export
!
route-map FROM_VOQ_CHASSIS_V4_PEER permit 1
match community DEVICE_INTERNAL_COMMUNITY
set comm-list DEVICE_INTERNAL_COMMUNITY delete
set tag {{ constants.bgp.internal_community_match_tag }}
!
route-map FROM_VOQ_CHASSIS_V4_PEER permit 2
match community NO_EXPORT
set local-preference 80
on-match next
!
{% if CONFIG_DB__DEVICE_METADATA['localhost']['subtype'] == 'UpstreamLC' %}
route-map FROM_VOQ_CHASSIS_V4_PEER deny 3
match community DEVICE_INTERNAL_FALLBACK_COMMUNITY
{% else %}
route-map FROM_VOQ_CHASSIS_V4_PEER permit 3
match community DEVICE_INTERNAL_FALLBACK_COMMUNITY
set comm-list DEVICE_INTERNAL_FALLBACK_COMMUNITY delete
set tag {{ constants.bgp.route_eligible_for_fallback_to_default_tag }}
{% endif %}
!
route-map FROM_VOQ_CHASSIS_V4_PEER permit 100
!
route-map TO_VOQ_CHASSIS_V4_PEER permit 1
match ip address prefix-list PL_LoopbackV4
set community {{ constants.bgp.internal_community }}
!
route-map TO_VOQ_CHASSIS_V4_PEER deny 15
match community LOCAL_ANCHOR_ROUTE_COMMUNITY
!
route-map TO_VOQ_CHASSIS_V4_PEER permit 100
!
route-map FROM_VOQ_CHASSIS_V6_PEER permit 1
set ipv6 next-hop prefer-global
on-match next
!
route-map FROM_VOQ_CHASSIS_V6_PEER permit 2
match community DEVICE_INTERNAL_COMMUNITY
set comm-list DEVICE_INTERNAL_COMMUNITY delete
set tag {{ constants.bgp.internal_community_match_tag }}
!
route-map FROM_VOQ_CHASSIS_V6_PEER permit 3
match community NO_EXPORT
set local-preference 80
on-match next
!
{% if CONFIG_DB__DEVICE_METADATA['localhost']['subtype'] == 'UpstreamLC' %}
route-map FROM_VOQ_CHASSIS_V6_PEER deny 4
match community DEVICE_INTERNAL_FALLBACK_COMMUNITY
{% else %}
route-map FROM_VOQ_CHASSIS_V6_PEER permit 4
match community DEVICE_INTERNAL_FALLBACK_COMMUNITY
set comm-list DEVICE_INTERNAL_FALLBACK_COMMUNITY delete
set tag {{ constants.bgp.route_eligible_for_fallback_to_default_tag }}
{% endif %}
!
route-map FROM_VOQ_CHASSIS_V6_PEER permit 100
!
route-map TO_VOQ_CHASSIS_V6_PEER permit 1
match ipv6 address prefix-list PL_LoopbackV6
set community {{ constants.bgp.internal_community }}
!
route-map TO_VOQ_CHASSIS_V6_PEER deny 15
match community LOCAL_ANCHOR_ROUTE_COMMUNITY
!
route-map TO_VOQ_CHASSIS_V6_PEER permit 100
!
! end of template: bgpd/templates/voq_chassis/policies.conf.j2
!