Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(eos_designs): Exclude l3_edge neighbors from peer_group #4491

Open
wants to merge 9 commits into
base: devel
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ interface Ethernet8
no shutdown
channel-group 7 mode active
!
interface ethernet9
description P2P_peer7_ethernet9
no shutdown
mtu 9214
no switchport
ip address 192.168.0.12/31
!
interface Loopback0
description ROUTER_ID
no shutdown
Expand Down Expand Up @@ -128,6 +135,8 @@ router bgp 65000
neighbor 192.168.0.11 peer group IPv4-UNDERLAY-PEERS
neighbor 192.168.0.11 remote-as 65006
neighbor 192.168.0.11 description peer6
neighbor 192.168.0.13 remote-as 65007
neighbor 192.168.0.13 description peer7
redistribute connected route-map RM-CONN-2-BGP
!
address-family ipv4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ router_bgp:
peer: peer6
description: peer6
peer_group: IPv4-UNDERLAY-PEERS
- ip_address: 192.168.0.13
remote_as: '65007'
peer: peer7
description: peer7
service_routing_protocols_model: multi-agent
ip_routing: true
vlan_internal_order:
Expand Down Expand Up @@ -178,6 +182,16 @@ ethernet_interfaces:
id: 7
mode: active
description: P2P_peer6_Ethernet8
- name: ethernet9
peer: peer7
peer_interface: ethernet9
peer_type: other
switchport:
enabled: false
shutdown: false
mtu: 9214
ip_address: 192.168.0.12/31
description: P2P_peer7_ethernet9
port_channel_interfaces:
- name: Port-Channel5
peer: peer5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,11 @@ l3_edge:
- node: peer6
interfaces: [ Ethernet7, Ethernet8 ]
include_in_underlay_protocol: true

# P2P link with ebgp and no underlay routing.
- nodes: [l3_edge_bgp, peer7]
interfaces: [ethernet9, ethernet9]
subnet: 192.168.0.12/31
as: [65000, 65007]
include_in_underlay_protocol: false
routing_protocol: ebgp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ $defs:
- ebgp
description: |-
Enables deviation of the routing protocol used on this link from the fabric underlay default.
If routing_protocol is 'ebgp' and include_in_underlay_protocol is 'false' then the bgp peering will not be included in the underlay peer group.
- ebgp: Enforce plain IPv4 BGP peering
structured_config:
type: dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def router_bgp(self: AvdStructuredConfigCoreInterfacesAndL3Edge) -> dict | None:
neighbors = []
neighbor_interfaces = []
for p2p_link in self._filtered_p2p_links:
if p2p_link.get("include_in_underlay_protocol", True) is not True:
if p2p_link.get("include_in_underlay_protocol", True) is not True and p2p_link.get("routing_protocol") != "ebgp":
continue

if p2p_link["data"]["bgp_as"] is None or p2p_link["data"]["peer_bgp_as"] is None:
Expand All @@ -42,9 +42,12 @@ def router_bgp(self: AvdStructuredConfigCoreInterfacesAndL3Edge) -> dict | None:
"remote_as": p2p_link["data"]["peer_bgp_as"],
"peer": p2p_link["data"]["peer"],
"description": p2p_link["data"]["peer"],
"peer_group": self.shared_utils.bgp_peer_groups["ipv4_underlay_peers"]["name"],
}

# Set peer group only if include_in_underlay_protocol is True
if p2p_link.get("include_in_underlay_protocol", True):
neighbor["peer_group"] = self.shared_utils.bgp_peer_groups["ipv4_underlay_peers"]["name"]

# RFC5549
if self.shared_utils.underlay_rfc5549 and p2p_link.get("routing_protocol") != "ebgp":
neighbor_interfaces.append({"name": p2p_link["data"]["interface"], **neighbor})
Expand Down
Loading