FGT1 # show router ospf
# config router ospf
set router-id 172.16.16.1
# config area
edit 0.0.0.0
next
end
# config ospf-interface
edit "1"
set interface "port2"
next
end
# config network
edit 1
set prefix 172.16.16.0 255.255.255.0
next
end
Hub # show router bgp
# config router bgp
set as 64512
set router-id 172.17.17.1
# config neighbor
edit "172.17.17.2"
set remote-as 64513
next
end
# config redistribute "ospf" <----- Redistributed OSPF into BGP.
set status enable
end
FGT1 # get router info bgp neighbors 172.17.17.2 received-routes | grep 10.0.0.0/24The route received from BGP is installed in the routing table and the OSPF route kept in the database table.
*> 10.0.0.0/24 172.17.17.2 0 0 64513 i <-/->
FGT1 # get router info routing-table details | grep 10.0.0.0/24
B 10.0.0.0/24 [20/0] via 172.17.17.2, port3, 00:00:22
FGT1 # get router info ospf route | grep 10.0.0.0/24
O 10.0.0.0/24 [101] via 172.16.16.2, port2, Area 0.0.0.0
FGT1# get router info routing-table database | grep 10.0.0.0/24
O 10.0.0.0/24 [110/101] via 172.16.16.2, port2, 00:01:05 <----- OSPF in the database.
B *> 10.0.0.0/24 [20/0] via 172.17.17.2, port3, 00:02:55
FGT1 # get router info routing-table details | grep 10.0.0.0/24The OSPF route in the database table installed into the routing table once the BGP link down.
O 10.0.0.0/24 [110/101] via 172.16.16.2, port2, 00:09:44
FGT1 # get router info bgp neighbors 172.17.17.2 received-routes | grep 10.0.0.0/24The issue is redistributing the OSPF route into BGP.
*> 10.0.0.0/24 172.17.17.2 0 0 64513 i <-/->
FGT1 # get router info routing-table details | grep 10.0.0.0/24
O 10.0.0.0/24 [110/101] via 172.16.16.2, port2, 00:17:38
Hub # get router info bgp networkThe network 10.0.0.0/24 leaned via its peer 172.17.17.2 is having default weight 0 but the redistributed network from OSPF (next hop 172.16.16.2) to BGP has 32768.
VRF 0 BGP table version is 2, local router ID is 172.17.17.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path
* 10.0.0.0/24 172.17.17.2 0 0 0 64513 i <-/->
*> 172.16.16.2 101 32768 0 ? <-/1>
Total number of prefixes 1
# config router prefix-listNow the weight has changed to 32769 which is higher than the redistributed network.
edit "Test-Network"
# config rule
edit 1
set prefix 10.0.0.0/24
end
end
# config router route-map
edit "test-map"
# config rule
edit 1
set match-ip-address "Test-Network"
set set-weight 32769
end
# config router bgp
# config neighbor
edit 172.17.17.2
set route-map-in "test-map"
next
end
Hub # get router info bgp network
VRF 0 BGP table version is 2, local router ID is 172.17.17.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path
*> 10.0.0.0/24 172.17.17.2 0 32769 0 64513 i <-/1>
* 172.16.16.2 101 32768 0 ? <-/->
Total number of prefixes 1
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.