|
4 | 4 | !
|
5 | 5 | {% from "common/functions.conf.j2" import get_ipv4_loopback_address %}
|
6 | 6 | !
|
7 |
| -route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 |
| 7 | +{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} |
| 8 | +route-map FROM_BGP_INTERNAL_PEER_V4 permit 1 |
| 9 | + set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} |
8 | 10 | !
|
9 |
| -route-map TO_BGP_INTERNAL_PEER_V4 permit 100 |
| 11 | +route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 |
| 12 | + set ipv6 next-hop prefer-global |
| 13 | + on-match next |
10 | 14 | !
|
| 15 | +route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 |
| 16 | + set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} |
| 17 | +{% elif CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %} |
| 18 | +bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit {{ constants.bgp.internal_community }} |
| 19 | +! |
| 20 | +route-map FROM_BGP_INTERNAL_PEER_V4 permit 1 |
| 21 | + match community DEVICE_INTERNAL_COMMUNITY |
| 22 | + set comm-list DEVICE_INTERNAL_COMMUNITY delete |
| 23 | + set tag {{ constants.bgp.internal_community_match_tag }} |
11 | 24 | !
|
12 | 25 | route-map FROM_BGP_INTERNAL_PEER_V6 permit 1
|
13 | 26 | set ipv6 next-hop prefer-global
|
14 | 27 | on-match next
|
15 | 28 | !
|
16 |
| -route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 |
| 29 | +route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 |
| 30 | + match community DEVICE_INTERNAL_COMMUNITY |
| 31 | + set comm-list DEVICE_INTERNAL_COMMUNITY delete |
| 32 | + set tag {{ constants.bgp.internal_community_match_tag }} |
17 | 33 | !
|
18 |
| -route-map TO_BGP_INTERNAL_PEER_V6 permit 100 |
| 34 | +route-map TO_BGP_INTERNAL_PEER_V4 permit 1 |
| 35 | + match ip address prefix-list PL_LoopbackV4 |
| 36 | + set community {{ constants.bgp.internal_community }} |
19 | 37 | !
|
20 |
| -{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} |
21 |
| -route-map FROM_BGP_INTERNAL_PEER_V4 permit 2 |
22 |
| - set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} |
| 38 | +route-map TO_BGP_INTERNAL_PEER_V6 permit 2 |
| 39 | + match ipv6 address prefix-list PL_LoopbackV6 |
| 40 | + set community {{ constants.bgp.internal_community }} |
| 41 | +! |
| 42 | +{% else %} |
| 43 | +route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 |
| 44 | + set ipv6 next-hop prefer-global |
| 45 | + on-match next |
23 | 46 | !
|
24 |
| -route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 |
25 |
| - set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} |
26 | 47 | {% endif %}
|
27 | 48 | !
|
| 49 | +route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 |
| 50 | +! |
| 51 | +route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 |
| 52 | +! |
| 53 | +route-map TO_BGP_INTERNAL_PEER_V4 permit 100 |
| 54 | +! |
| 55 | +route-map TO_BGP_INTERNAL_PEER_V6 permit 100 |
| 56 | +! |
| 57 | +! |
28 | 58 | ! end of template: bgpd/templates/internal/policies.conf.j2
|
29 | 59 | !
|
0 commit comments