ansible-docker-frr/templates/frr.conf.j2

119 lines
4.1 KiB
Plaintext
Raw Normal View History

2020-07-30 08:06:21 +00:00
frr defaults datacenter
hostname {{ansible_hostname}}
!
service integrated-vtysh-config
!
log syslog informational
!
{% if autobgp_interfaces is defined and autobgp_interfaces != [] %}
{% for item in autobgp_interfaces %}
interface {{ item['name'] }}
ipv6 nd ra-interval 10
no ipv6 nd suppress-ra
!
{% endfor %}
{% endif %}
router bgp {{host_ASN}}
bgp router-id {% if host_loopback_IP is defined %}{{host_loopback_IP}}{% else %}{{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}{% endif %}
2020-07-30 08:06:21 +00:00
bgp bestpath as-path multipath-relax
bgp bestpath compare-routerid
{% if autobgp_interfaces is defined and autobgp_interfaces != [] %}
neighbor fabric peer-group
neighbor fabric remote-as external
neighbor fabric description Internal Fabric Network
neighbor fabric capability extended-nexthop
{% endif %}
{% if addressed_interfaces is defined and addressed_interfaces != [] %}
{% for item in addressed_interfaces %}
{% if item['bgpPeerIP'] is defined %}
neighbor {{ item['bgpPeerIP'] }} remote-as {{ item['bgpPeerASN'] }}
2020-07-30 08:06:21 +00:00
{% endif %}
{% endfor %}
{% endif %}
{% if autobgp_interfaces is defined and autobgp_interfaces != [] %}
{% for item in autobgp_interfaces %}
neighbor {{ item['name'] }} interface peer-group fabric
{% endfor %}
{% endif %}
{% if frr_other_peers is defined and frr_other_peers != [] %}
2020-07-30 08:06:21 +00:00
{% for item in frr_other_peers %}
neighbor {{ item['ip'] }} remote-as {{ item['remote_ASN'] }}
{% endfor %}
{% endif %}
{% if bond_interfaces is defined and bond_interfaces != [] %}
{% for item in bond_interfaces %}
neighbor {{ item['ip'] }} remote-as {{ item['remote_ASN'] }}
{% endfor %}
2020-07-30 08:06:21 +00:00
{% endif %}
!
address-family ipv4 unicast
{% if host_loopback_IP is defined %}
2020-07-30 08:06:21 +00:00
network {{host_loopback_IP}}/32
{% endif %}
2021-03-05 01:38:31 +00:00
{% if bgp_redistribute_connected is defined and bgp_redistribute_connected %}
2020-11-07 12:33:11 +00:00
redistribute connected
{% endif %}
2020-08-26 03:36:53 +00:00
{% if networks_to_announce_ipv4 is defined and networks_to_announce_ipv4 != [] %}
2020-08-26 04:40:12 +00:00
{% for item in networks_to_announce_ipv4 %}
2021-03-05 01:38:31 +00:00
network {{ item }}
2020-08-26 04:40:12 +00:00
{% endfor %}
2020-08-26 03:36:53 +00:00
{% endif %}
2020-07-30 08:06:21 +00:00
{% if autobgp_interfaces is defined and autobgp_interfaces != [] %}
neighbor fabric activate
neighbor fabric prefix-list AS{{host_ASN}}-OUT out
{% endif %}
{% if frr_other_peers is defined and frr_other_peers != [] %}
2020-07-30 08:06:21 +00:00
{% for item in frr_other_peers %}
2020-08-26 04:40:12 +00:00
neighbor {{ item['ip'] }} remote-as {{ item['remote_ASN'] }} prefix-list AS{{host_ASN}}-OUT out
2020-07-30 08:06:21 +00:00
{% endfor %}
{% endif %}
2020-07-30 08:06:21 +00:00
{% if addressed_interfaces is defined and addressed_interfaces != [] %}
{% for item in addressed_interfaces %}
{% if item['bgpPeerIP'] is defined %}
neighbor {{ item['bgpPeerIP'] }} prefix-list AS{{host_ASN}}-OUT out
{% endif %}
{% endfor %}
{% endif %}
2020-07-30 08:06:21 +00:00
exit-address-family
!
address-family ipv6 unicast
{% if host_loopback_IP_v6 is defined %}
2020-07-30 08:06:21 +00:00
network {{host_loopback_IP_v6}}/128
{% endif %}
{% if frr_other_peers is defined and frr_other_peers != [] %}
2020-07-30 08:06:21 +00:00
{% for item in frr_other_peers %}
neighbor {{ item['ip'] }} prefix-list AS{{host_ASN}}-OUT out
{% endfor %}
{% endif %}
2020-07-30 08:06:21 +00:00
{% if autobgp_interfaces is defined and autobgp_interfaces != [] %}
neighbor fabric activate
neighbor fabric prefix-list AS{{host_ASN}}-OUT out
{% endif %}
2020-07-30 08:06:21 +00:00
{% if addressed_interfaces is defined and addressed_interfaces != [] %}
{% for item in addressed_interfaces %}
{% if item['bgpPeerIP'] is defined %}
neighbor {{ item['bgpPeerIP'] }} prefix-list AS{{host_ASN}}-OUT out
{% endif %}
{% endfor %}
{% endif %}
exit-address-family
!
address-family l2vpn evpn
neighbor fabric activate
advertise-all-vni
advertise-default-gw
exit-address-family
!
2020-08-21 12:23:12 +00:00
{% if host_loopback_IP is defined %}ip prefix-list AS{{host_ASN}}-OUT seq 5 permit {{host_loopback_IP}}/32{% endif %}
2020-11-21 14:36:42 +00:00
{% if networks_to_announce_ipv4 is defined and networks_to_announce_ipv4 != [] %}
{% for item in networks_to_announce_ipv4 %}
2021-03-05 01:38:31 +00:00
ip prefix-list AS{{host_ASN}}-OUT seq {{loop.index+5}} permit {{ item }}
{% endfor %}
{% endif %}
2020-11-07 12:51:47 +00:00
2020-08-21 12:23:12 +00:00
{% if host_loopback_IP_v6 is defined %}ipv6 prefix-list AS{{host_ASN}}-OUT seq 5 permit {{host_loopback_IP_v6}}/128{% endif %}