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

107 lines
3.7 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 %}
!
address-family ipv4 unicast
{% if host_loopback_IP is defined %}
2020-07-30 08:06:21 +00:00
network {{host_loopback_IP}}/32
{% endif %}
2020-11-07 12:33:11 +00:00
{% if bgp_redistribute_connected is defined and bgp_redistribute_connected == True %}
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 %}
network {{item}}
{% 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-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 %}