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

BGP Redistribute to OSPF!!

Hello everyone I have a requirement and I am not sure id this can be done or not, I have a script with what I think is the correct way of doing this.

 

Ok so lets start with the scenario, I have 2 Fortigates in 2 different Datacentres, lets call these Fortigate A and Fortigate B, the Datacentres are connected via a 1Gbps link.

 

Now Fortigate A and Fortigate B both have 2 IPSEC tunnels to Dest1 and Dest2 with BGP configured to run over these tunnels.

 

The priority of the traffic will be:

 

FortigateA - Dest1

FortigateB - Dest1

 

FortigateA - Dest2

FortigateB - Dest2

 

To do this I need the following:

 

Redistribute FortigateA BGP into OSPF from Dest1 with metric default.

Redistribute FortigateA BGP into OSPF from Dest2 with metric 40.

 

Redistribute FortigateB BGP into OSPF from Dest1 with metric 30.

Redistribute FortigateB BGP into OSPF from Dest2 with metric 50.

 

This way the underlying network switches and routers will use the order of preference specified above, when the traffic gets to the Firewall a Higher MED will be advertised for Dest2 so the Firewalls will always prefer Dest1.

 

So this is the way I see to do this:

 

 

**************** FIREWALL A *********************

##### Accepted Routes From BGP #####

config router prefix-list

edit "BGP_INCOMING"

config rule

edit 1

set prefix 10.1.0.0 255.255.0.0

set action permit

unset ge

unset le

next

edit 2

set prefix 10.2.0.0 255.255.0.0

set action permit

unset ge

unset le

next

end

 

##### Set Tags for Routes from Dest1 #####

config router route-map
edit "BGP_INCOMING_Dest1"
config rule
edit 10
set match-ip-address "BGP_INCOMING"
set set-tag 1000
next

 

##### Set Tags for Routes from Dest2 #####
config router route-map
edit "BGP_INCOMING_Dest2"
config rule
edit 10
set match-ip-address "BGP_INCOMING"
set set-tag 2000
next
end

 

##### Configure BGP #####

config router bgp

set as 65002

set log-neighbour-changes enable

set router-id 10.10.10.1

config redistribute ospf

set status enable

end

config neighbor

edit 10.0.0.129

  set remote-as 65001

  set route-map-in “BGP_INCOMING_Dest1”

  set route-map-out “OSPF_to_BGP”

next

config neighbor

edit 10.0.0.137

  set remote-as 65001

  set route-map-in “BGP_INCOMING_Dest2”

  set route-map-out “OSPF_to_BGP”

  end

 

##### Reditribute to OSPF Route-Map#####

config router route-map

edit "BGP_to_OSPF"

config rule

edit 10

set match-tag 1000

set metric 20

 next

edit 10

set match-tag 2000

set metric 40

 next

end

 

##### Configure OSPF #####

config router ospf

config redistribute "bgp" 
set status enable

set route-map "BGP_to_OSPF"

next

end


 

then on Firewall B I would do the same just with different metrics.

 

Can anyone check if this would work?

 

Many Thanks

0 REPLIES 0
Labels
Top Kudoed Authors