Description
This article describes how to redistribute BGP routes learned through different BGP Communities into OSPF. This solution requires FortiOS 6.4.3 or above (Bug ID# 644461).
Scope
FortiGate.
Solution
Consider the following example case:
get router info bgp network <route learnt>
config router community-list
edit "6500:100"
config rule
edit 1
set action permit
set match "6500:100"
next
end
next
edit "6501:101"
config rule
edit 1
set action permit
set match "6501:101"
next
end
next
end
config router route-map
edit "inbound"
config rule
edit 1
set match-community "6500:100" <----- Created above.
set set-tag 200
next
edit 2
set match-community "6501:101" <----- Created above.
set set-tag 100
next
end
end
config router bgp
set as 101
set router-id 172.16.1.1
config neighbor
edit "172.16.1.102"
set interface "lan"
set remote-as 100
set route-map-in "inbound" <----- Inbound route-map.
next
end
end
config router route-map
edit "outbound-OSPF"
config rule
edit 1
set match-tag 200 <----- Use routes with tag 200 only.
next
end
next
end
config router ospf
set router-id 172.16.88.1
config area
edit 0.0.0.0
next
end
config ospf-interface
edit "ospf"
set interface "lan"
next
end
config network
edit 1
set prefix 0.0.0.0 0.0.0.0
next
end
config redistribute "connected"
end
config redistribute "static"
end
config redistribute "rip"
end
config redistribute "bgp"
set status enable <----- Set redistribution status enable.
set routemap "outbound-OSPF" <----- Set route-map.
end
config redistribute "isis"
end
end
Verification:
The routing table of ROUTER 2 should only see the 192.168.233.0/24 learned via OSPF from FortiGate.
The following commands may be useful:
get router info ospf neighbor
get router info routing-table all
get router info ospf network
Related documents:
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.