2026-09-03 14:14:04 +03:00
|
|
|
frr version 8.5
|
|
|
|
|
frr defaults traditional
|
|
|
|
|
hostname {{ inventory_hostname }}
|
|
|
|
|
log stdout informational
|
|
|
|
|
no ipv6 forwarding
|
|
|
|
|
!
|
2026-09-10 17:57:51 +03:00
|
|
|
ip prefix-list PL-ANYCAST-OUT seq 5 permit {{ anycast_prefix }}
|
|
|
|
|
!
|
|
|
|
|
route-map RM-OUT permit 10
|
|
|
|
|
match ip address prefix-list PL-ANYCAST-OUT
|
|
|
|
|
!
|
|
|
|
|
route-map RM-OUT deny 20
|
|
|
|
|
!
|
2026-09-09 20:59:40 +03:00
|
|
|
{% if bgp_neighbors | selectattr('prepend') | list | length > 0 %}
|
2026-09-10 17:57:51 +03:00
|
|
|
route-map RM-OUT-PREPEND permit 10
|
|
|
|
|
match ip address prefix-list PL-ANYCAST-OUT
|
2026-09-09 20:59:40 +03:00
|
|
|
set as-path prepend {{ ((local_asn ~ ' ') * (as_path_prepend_count | default(0) | int)) | trim }}
|
|
|
|
|
!
|
2026-09-10 17:57:51 +03:00
|
|
|
route-map RM-OUT-PREPEND deny 20
|
|
|
|
|
!
|
2026-09-09 20:59:40 +03:00
|
|
|
{% endif %}
|
|
|
|
|
router bgp {{ local_asn }}
|
2026-09-03 14:14:04 +03:00
|
|
|
bgp router-id {{ router_id }}
|
|
|
|
|
no bgp ebgp-requires-policy
|
2026-09-09 20:59:40 +03:00
|
|
|
{% for n in bgp_neighbors %}
|
|
|
|
|
neighbor {{ n.ip }} remote-as {{ n.asn }}
|
|
|
|
|
{% endfor %}
|
2026-09-03 14:14:04 +03:00
|
|
|
!
|
|
|
|
|
address-family ipv4 unicast
|
|
|
|
|
network {{ anycast_prefix }}
|
2026-09-09 20:59:40 +03:00
|
|
|
{% for n in bgp_neighbors %}
|
|
|
|
|
neighbor {{ n.ip }} activate
|
|
|
|
|
{% endfor %}
|
2026-09-10 17:57:51 +03:00
|
|
|
{% for n in bgp_neighbors %}
|
|
|
|
|
neighbor {{ n.ip }} route-map {{ 'RM-OUT-PREPEND' if n.prepend else 'RM-OUT' }} out
|
2026-09-09 20:59:40 +03:00
|
|
|
{% endfor %}
|
2026-09-03 14:14:04 +03:00
|
|
|
exit-address-family
|
|
|
|
|
!
|
|
|
|
|
line vty
|
|
|
|
|
!
|