Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Mbrassesco
New Contributor

BGP, 2 neighbors advertised routes issue

Hi, I recived routes from both neighbors, the problem is that i dont want to advertised routes from one neighbor to the other. Wich is the command that i have to use? Tks! And excuse me for my bad english.
6 REPLIES 6
emnoc
Esteemed Contributor III

So basically you don' t want to be transient. You have a host of means but I would look at a simple route-filter and monitor the updates to your BGP peers e.g Here' s a simple prefix filter for my 192.0..2.0/24 prefix config router prefix-list edit " myfilter" set comments " myroutes_local_originated" config rule edit 1 set prefix 192.0.2.0 255.255.255.0 unset ge unset le next end next end and, then apply to neighbor outbound config neighbor edit " 1.1.1.1" set prefix-list-out " myfilter" next end only prefixes set within " myfilter" will be sent you can define prefixes on ge/le if you have multiple prefixes.

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
PaulM1114
New Contributor III

Configure access-lists The command is: config router access-list
emnoc
Esteemed Contributor III

Configure access-lists The command is: config router access-list
I would advise not to try access-list with BGP. The concept of BGP works arounds prefixes and uses prefixes. The prefix gives you more options and flexibility within matches & is simple and straight forward. Also if you use a access-list you have to reference it in a route-mp and then apply that route-map; config router route-map edit " myroutemap" config rule edit 1 set match-ip-address myacl next end next end So it' s little bit more involved than just a simple config router access-list fwiw; Unless you needs to enforce other BGP properties ( communities, metrics,etc....) than you can get by with a simple prefix-list and avoid the route-map imho

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
Mbrassesco
New Contributor

Thanks u very much! I use prefix-list and it works perfect.
mnantel_FTNT
Staff
Staff

By not being transient, I suspect we mean not being " transit" :) While the above works in the majority of cases, the true technique behind ensuring you are not originating routes from other ASes is to filter your advertisements to only include routes that originate from the local AS. This is accomplished using an AS path list rather than a prefix-list, coupled with a route-map as follow. My example assumes you are AS 65500 (which is a private ASN) - you would replace that value with your own ASN. There are common regex patterns used for filtering the AS path list - a short list can be found here: http://blog.ine.com/2008/01/06/understanding-bgp-regular-expressions/ In our case, " ^$" ensures we only match locally originated routes, which have an empty AS path list hence the start of chain character " ^" immediately followed by the end of chain character " $" - empty match list!
 config router aspath-list
     edit " SELF_PREFIX_ONLY" 
             config rule
                 edit 1
                     set action permit
                     set regexp " ^$" 
                 next
             end
     next
 end
 
 config router route-map
     edit " RTM-BGP-Outbound-ProviderA" 
         set comments " RTM for egress to Cogent" 
             config rule
                 edit 1
                     set match-as-path " SELF_PREFIX_ONLY" 
                 next
                 edit 2
                     set action deny
                 next
             end
     next
 
 config router bgp
     set as 65500
         config neighbor
             edit " 1.2.3.4" 
                 set soft-reconfiguration enable
                 set remote-as 150
                 set route-map-out " RTM-BGP-Outbound-ProviderA" 
             next
 end
 end
 
Hope this helps!

-- Mathieu Nantel Systems Engineer / Conseiller Technique - Fortinet Montreal, QC

Mbrassesco
New Contributor

Ill try it, tks!
Labels
Top Kudoed Authors