Skip to main content
Explorer
June 11, 2026
Question

Prevent BGP loop

  • June 11, 2026
  • 4 replies
  • 70 views

Hi All,

I would like to ask your help about BGP with my scenario.

I have FG1 connect with some FG Spoke via MPLS and VPN tunnel. I configured BGP peer for each link with the neighbor is the ip of each link.

I want to prevent FG1 advertise route learned from MPLS back to FG2 via VPN tunnel and vice versa. 

I tried with route map out and comminity and it work for mpls because there are separate mpls for spoke but for vpn tunnel I cant because the VPN tunnel is peering with other Spoke.

Could someone advise me the solution for the scenario?
 

4 replies

funkylicious
SuperUser
SuperUser
June 11, 2026

when it comes to define particular advertised networks, i personally prefer to use prefix-lists to send/accept routes from peers, try creating and using those if in/out networks

you could also mark the routes from MLPS with a community and make sure to discard/reject it ( the community ) when received by a peer on VPN or the other way around.

"jack of all trades, master of none"
Dnk1Author
Explorer
June 11, 2026

Hi Funky,

Thanks so much for the reply, but I think you are misunderstand the situation.

FG run BGP with HUB on 2 peer. The route advertised on both of them to HUB. When the HUB learn routes on MPLS it advertise back to FG via VPN. The behavior the same when HUB learned route via VPN, it advertised back to FG via MPLS. That is situation I want to prevent.

I tested: on Hub I set community route map in for routes learned via VPN then deny it in route map out which applied on MPLS interface. But I cannot do the same for VPN because the Tunnel is peering with multi FG

Toshi_Esumi
SuperUser
SuperUser
June 11, 2026

So you’re saying you have only one phase1-interface for all remote FGTs connected to it? We almost never do that for simplicity. 
Anyway, regardless one phase1 or multiple, BGP works per neighbor. So as long as each remote FGT has a unique IP to peer with the HUB FGT, 
Then without a proper diagram, which shows your design/strategy with the communities, I can’t tell why or what’s not working.

Also, are you using eBGP or iBGP.

Toshi
 

Dnk1Author
Explorer
June 13, 2026

Hi Toshi,

The HUB and spokes has 2 links: Internet and mpls. On the Hub have saperate mpls interface to each spoke. For internet link I running Hub and spoke vpn tunnel. BGP peers are established using ip interface of mpls and vpn tunnnel between hub and spoke. I can resolve my situation by peering to each spoke vpn tunnel manually. But i am using neighbor group for vpn. This is my probpem and i would like to ask if have any solution for this?

Toshi_Esumi
SuperUser
SuperUser
June 13, 2026

Again, since you’re not providing a proper diagram, especially BGP topology, I still can’t anderstand what your problem is. If iBGP the routes came from an iBGP nighbor would never advertise to another iBGP peer. Even if eBGP, if the HUB FGT is directly peering with a spoke FGT, the ASN is the same so the HUB shouldn’t re-advertise the route from the same spoke back to it. Are you neighboring with MPLS provider with a different AS? At least provide some key AS numbers for HUB and spokes and MPLS provider.

Toshi

Toshi_Esumi
SuperUser
SuperUser
June 14, 2026

Besides, if eBGP, and even if the remote FGT received the routes from the HUB, which it originally advertised, it would simply drop them because the AS-path includes its own ASN. So no routing-loop to occur.

Toshi