Skip to content

Commit 0f9efce

Browse files
committed
chore(agent): adv. all VTEPs on leaves
regardless of fabric or mesh links. this allows us to e.g. connect gateways to leaves in spine-leaf topologies, whereas right now the VTEP of the gateway would not be advertised by the leaf attached to it. The only downside of this is that we are advertising some routes which will be rejected by our peers, but the configuration is simpler, and the alternative (adding the gateway VTEP to the prefix list of advertised routes) is quite convoluted, since that VTEP is only present on the gateway object, not on the connection. Signed-off-by: Emanuele Di Pascale <[email protected]>
1 parent 56554cb commit 0f9efce

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

pkg/agent/dozer/bcm/plan.go

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,10 @@ const (
5555
RouteMapL2VPNNeighbors = "l2vpn-neighbors"
5656
RouteMapFilterAttachedHost = "filter-attached-hosts"
5757
RouteMapLoopbackAllVTEPs = "loopback-all-vteps"
58-
RouteMapLoopbackVTEP = "loopback-vtep"
5958
RouteMapProtocolLoopbackOnly = "protocol-loopback-only"
6059
PrefixListAny = "any-prefix"
6160
PrefixListVPCLoopback = "vpc-loopback-prefix"
6261
PrefixListAllVTEPPrefixes = "all-vtep-prefixes"
63-
PrefixListVTEPPrefix = "vtep-prefix"
6462
PrefixListProtocolLoopback = "protocol-loopback-prefix"
6563
PrefixListStaticExternals = "static-ext-subnets"
6664
NoCommunity = "no-community"
@@ -471,41 +469,6 @@ func planFabricConnections(agent *agentapi.Agent, spec *dozer.Spec) error {
471469
},
472470
}
473471

474-
if agent.Spec.Switch.Role.IsLeaf() {
475-
if agent.Spec.Switch.VTEPIP == "" {
476-
return errors.New("VTEP IP not set in leaf switch spec")
477-
}
478-
479-
spec.PrefixLists[PrefixListVTEPPrefix] = &dozer.SpecPrefixList{
480-
Prefixes: map[uint32]*dozer.SpecPrefixListEntry{
481-
10: {
482-
Prefix: dozer.SpecPrefixListPrefix{
483-
Prefix: agent.Spec.Switch.VTEPIP,
484-
Le: 32,
485-
},
486-
Action: dozer.SpecPrefixListActionPermit,
487-
},
488-
},
489-
}
490-
491-
spec.RouteMaps[RouteMapLoopbackVTEP] = &dozer.SpecRouteMap{
492-
Statements: map[string]*dozer.SpecRouteMapStatement{
493-
"10": {
494-
Conditions: dozer.SpecRouteMapConditions{
495-
MatchPrefixList: pointer.To(PrefixListVTEPPrefix),
496-
},
497-
Result: dozer.SpecRouteMapResultAccept,
498-
},
499-
"100": {
500-
Conditions: dozer.SpecRouteMapConditions{
501-
MatchPrefixList: pointer.To(PrefixListStaticExternals),
502-
},
503-
Result: dozer.SpecRouteMapResultAccept,
504-
},
505-
},
506-
}
507-
}
508-
509472
spec.PrefixLists[PrefixListProtocolLoopback] = &dozer.SpecPrefixList{
510473
Prefixes: map[uint32]*dozer.SpecPrefixListEntry{
511474
10: {
@@ -631,18 +594,12 @@ func planFabricConnections(agent *agentapi.Agent, spec *dozer.Spec) error {
631594
// Use allowas-in for all switches for now b/c of https://github.com/githedgehog/fabricator/issues/830#issuecomment-3138205167
632595
// TODO: remove allowas-in for spines when we fully deprecate remote peering
633596
allowasIn := true // agent.Spec.Switch.Redundancy.Type == meta.RedundancyTypeMCLAG || agent.Spec.Switch.Role.IsSpine()
634-
var routeMap string
635-
if agent.Spec.Switch.Role.IsLeaf() {
636-
routeMap = RouteMapLoopbackVTEP
637-
} else {
638-
routeMap = RouteMapLoopbackAllVTEPs
639-
}
640597
spec.VRFs[VRFDefault].BGP.Neighbors[ip.String()] = &dozer.SpecVRFBGPNeighbor{
641598
Enabled: pointer.To(true),
642599
Description: pointer.To(fmt.Sprintf("Fabric %s loopback (spine-link)", peer)),
643600
RemoteAS: pointer.To(peerSpec.ASN),
644601
IPv4Unicast: pointer.To(true),
645-
IPv4UnicastExportPolicies: []string{routeMap},
602+
IPv4UnicastExportPolicies: []string{RouteMapLoopbackAllVTEPs},
646603
L2VPNEVPN: pointer.To(true),
647604
L2VPNEVPNImportPolicies: []string{RouteMapL2VPNNeighbors},
648605
L2VPNEVPNAllowOwnAS: pointer.To(allowasIn),

0 commit comments

Comments
 (0)