exit: consolidate IPv4 and IPv6 address families

In BGP router configuration for default and inside VRFs.
This commit is contained in:
Timotej Lazar 2025-03-26 01:15:14 +01:00
parent 3b3e759cc1
commit d667a38553

View file

@ -37,18 +37,8 @@ router bgp {{ asn.asn }}
neighbor {{ iface }} bfd 3 150 150
{% endfor %}
address-family ipv4 unicast
redistribute connected route-map loopback
neighbor fabric soft-reconfiguration inbound
neighbor fabric route-map fabric->default in
neighbor fabric route-map default->fabric out
import vrf outside
import vrf route-map default-import
exit-address-family
address-family ipv6 unicast
{% for family in ['ipv4', 'ipv6'] %}
address-family {{ family }} unicast
redistribute connected route-map loopback
neighbor fabric activate
@ -60,6 +50,7 @@ router bgp {{ asn.asn }}
import vrf route-map default-import
exit-address-family
{% endfor %}
address-family l2vpn evpn
advertise-all-vni
advertise-default-gw
@ -144,27 +135,8 @@ router bgp {{ asn.asn }} vrf inside
neighbor {{ iface }}.2 bfd 3 150 150
{% endfor %}
address-family ipv4 unicast
neighbor peerlink.2 soft-reconfiguration inbound
neighbor peerlink.2 route-map peer.2->me in
neighbor peerlink.2 route-map me->peer.2 out
neighbor firewall allowas-in 1
neighbor firewall soft-reconfiguration inbound
neighbor firewall route-map inside->firewall out
{% for iface in ifaces_firewall %}
neighbor {{ iface }}.2 route-map firewall-{{ loop.index }}->inside in
{% endfor %}
redistribute connected route-map loopback-inside
{% for vrf in inside_vrfs %}
import vrf {{ vrf }}
{% endfor %}
import vrf default
import vrf route-map inside-import
exit-address-family
address-family ipv6 unicast
{% for family in ['ipv4', 'ipv6'] %}
address-family {{ family }} unicast
neighbor peerlink.2 activate
neighbor peerlink.2 soft-reconfiguration inbound
neighbor peerlink.2 route-map peer.2->me in
@ -186,25 +158,15 @@ router bgp {{ asn.asn }} vrf inside
import vrf route-map inside-import
exit-address-family
{% endfor %}
{% for vrf in vrfs.values() | selectattr('name', 'in', inside_vrfs) %}
router bgp {{ asn.asn }} vrf {{ vrf.name }}
bgp bestpath as-path multipath-relax
address-family ipv4 unicast
redistribute connected
import vrf inside
{% if vrf.custom_fields.imports %}
{% for import in vrf.custom_fields.imports %}
import vrf {{ import.name }}
{% endfor %}
import vrf route-map {{ vrf.name }}-import
{% else %}
import vrf route-map office-import
{% endif %}
exit-address-family
address-family ipv6 unicast
{% for family in ['ipv4', 'ipv6'] %}
address-family {{ family }} unicast
redistribute connected
import vrf inside
{% if vrf.custom_fields.imports %}
@ -218,6 +180,7 @@ router bgp {{ asn.asn }} vrf {{ vrf.name }}
exit-address-family
{% endfor %}
{% endfor %}
# Prefix lists.
ip prefix-list default permit 0.0.0.0/0