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

BGP Multihome - Use Secondary Line For Specific Subnet

Hello all! Kind of a crazy issue ere that I' ve never had to deal with. Hoping someone can point me in the right direction... We are configuring BGP for one of our clients and are running into some issues. Basically the BGP config is setup as so: The firewall has two BGP peers to the same ISP using the same ASN. The BGP is setup as port 1 being weighted as 250 and port 2 as being weighted as 200. This is working. However we would like to configure certain traffic to use port 2. This in return creates an asymetric routing loop (which is kind of expected). The ISP is accepting BGP communities which I have a test one configured. We can' t seem to get this working and we are experiencing some over utilization of our port 1 circuit. I set up a specific 192.168.1.11(example) prefix and made a policy route forcing it out port2. I also have a route map out configured for this with the community. I just know I' m missing something and doing it wrong. Any insight or advice you guys could give me would be greatly appreciated. Let me know if I need to elaborate or go in more depth. Thanks In Advance! :)
5 REPLIES 5
emnoc
Esteemed Contributor III

If you' r using PBR you overridden the natural function of the RIB. Have you tried the following; Using meds to stir traffic of the prefix that you want used over link A or B A map of your topology and prefixes would be helpful.

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
Lawngnome6868
New Contributor

Sorry for not providing enough detail! Here is a basic picture of what this looks like. This would be an example of the prefixes: edit 19 set prefix 10.0.4.0 255.255.255.0 next edit 20 set prefix 10.0.6.0 255.255.255.0 next edit 21 set prefix 10.0.2.0 255.255.255.0 next edit 22 set prefix 10.0.3.0 255.255.255.0 next edit 23 set prefix 10.0.5.0 255.255.255.0 next edit 25 set prefix 10.0.9.98 255.255.255.255 next edit 24 set prefix 10.0.9.0 255.255.255.0 next end I' m trying to only use 10.0.9.98 right now for testing purposes. This is the backup neighbor config: config neighbor edit " 2.2.2.2" set description " BGP Peer 2" set interface " port2" set remote-as 200 set route-map-out " SET-LESS-PREFERRED" set weight 200 next end Here is my route map: edit " SET-LESS-PREFERRED" config rule edit 1 set match-ip-address " Test" set set-community " 209:90" next end next end The Test for match-ip-address is the access list i have used to define 10.0.9.98 I' m most likely going about this the wrong way, but I' m just not sure what exactly to use to make this work correctly. Thanks for helping!
emnoc
Esteemed Contributor III

Interesting situation you have and nice drawing btw What you need is MEDs ( multi-exit-discriminator ) I took the liberty and craft a sample that you could following using your map. Trick here is to set the Metrics on all paths and then lower the one in the route-map for the usptream peer that you want. Try this on for size.; 1st set 2 prefix-list config router prefix-list edit " metric-high" set comments " install routes that you want metrics for" config rule edit 1 set prefix 10.0.9.98 255.255.255.255 unset ge unset le next edit 2 set prefix 10.0.5.0 255.255.255.0 unset ge unset le next edit 3 set prefix 10.0.9.0 255.255.255.0 unset ge unset le next end next edit " metric-low" set comments " install routes that you want metrics for_low " config rule edit 1 set prefix 10.0.4.0 255.255.255.0 unset ge unset le next edit 2 set prefix 10.0.6.0 255.255.255.0 unset ge unset le next edit 3 set prefix 10.0.2.0 255.255.255.0 unset ge unset le next end next en note: I installed all of your prefixes to show you how you could load balance traffic 2nd you need to make a route-maps that we will apply to our neighbors config router route-map edit " BGPpref" config rule edit 1 set match-ip-address " metric-high" set set-metric 1000 next end next edit " BGPpref2" config rule edit 1 set match-ip-address " metric-low" set set-metric 900 next end next end The items in the BGPpref2 will be preferred due to the lower metrics in the BGP path selection by your upstream peers. Lower Vrs Higher Metrics in the path selection by your AS2011 neighbors. Next we apply these to your neighbors. config router bgp set as 1.1.1.1 <----- your asn # config neighbor edit " 1.1.1.1" <-- your peer 1 set interface " port1" set remote-as 2011 set route-map-out " BGPpref" set weight 250 next edit " 2.2.2.1" set interface " port2" set remote-as 2011 set route-map-out " BGPpref2" set weight 200 next end So adjust the prefix-list and the metrics to influence traffic IN_BOUND to your AS. For outbound your higher weight will always select that upstream peer, unless you deploy some ECMP. I hope that works, and update us as to what you ultimately do. Whatever you do, conduct some trace routes inbound to ensure the correct next-hop is selected entering your router.

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
Lawngnome6868
New Contributor

Man, let me start out by saying thank you so much for the amount of detail provided. This has been such a huge help in helping me wrap my head around this. Now, my only question is, when I was toying with this config with MED it seemed like only the routes/prefixes listed in each prefix list were the ONLY ones being advertised. Do I specifically need to to add every prefix that is going to needed to be routed to that prefix list? Or was I just seeing something odd and jumped to a conclusion? Thanks so much for this help. It really is truly appreciated.
emnoc
Esteemed Contributor III

Yes, that ' s what the edit rule does. i think you coud try adding a 2nd rule with a permit any prefix-list; edit any set comments " permit-any" config rule edit 1 set prefix 0.0.0.0/0 le 32 next config router route-map edit " BGPpref" config rule edit 100 set match-ip-address " any" next and the same for the 2nd bgp pref list and that would catch any thing not in the metric-low or high grouping. Just play around with it and make your adjustments, so you get the right WAN link preferences for inbound traffic.

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors