By Manny Fernandez

May 20, 2019

Route-Map on Fortigate

Route-Map on Fortigate

Often times you need to create a route map on a device to control what routes the device is advertising.  Here is my scenario.

Branch location has a ‘Data‘ VLAN (ID100  172.22.100.0/24) and a ‘Voice‘ VLAN (ID101 172.22.101.0/24).  I am using OSPF to route across to the main location and all other branches.

Creating an ‘access-list’

The access list will be used to match something.  In my example below, it is the two network 172.22.100.0/24 and 172.22.101.0/24

config router access-list
edit "allowed-connected-routes"
config rule
edit 1
set prefix 172.22.100.0 255.255.255.0
set exact-match enable
next
edit 2
set prefix 172.22.101.0 255.255.255.0
set exact-match enable
next
end

As you can see above, we create a ‘rule‘.  By issuing an ‘edit 3‘, ‘edit 4‘ etc, you can add additional networks.

Then once you have the access list, we will create the route-map

Creating the Route Map

config router route-map
edit "connected-to-ospf"
config rule
edit 1
set match-ip-address "allowed-connected-routes"
next
end

Then, we will configure the OSPF

Configuring OSPF

config router ospf
set router-id 172.30.255.1
config area
edit 0.0.0.0
next
end
config ospf-interface
edit "LAN1"
set interface "lan1"
set dead-interval 40
set hello-interval 10
next
end
config network
edit 2
set prefix 172.30.255.1 255.255.255.0
next
end
set passive-interface "ssl.root" "wan" "colo-vpn" "lan2" "lan3" "lan4"
config redistribute "connected"
set status enable
set routemap "connected-to-ospf"
end
config redistribute "static"
end
config redistribute "rip"
end
config redistribute "bgp"
end
config redistribute "isis"
end
end

As you can see, the focus should be on the ‘redistribute connected‘ section.  This method can be used for any of the dynamic routing protocols.

Hope this helps.

 

VRF Explained: Virtual Routing and Forwarding on FortiGate, Cisco and Juniper

VRF Explained: Virtual Routing and Forwarding on FortiGate, Cisco and Juniper

Learn virtual routing and forwarding (VRF), then build VRFs and route leaking on FortiGate, Cisco IOS XE and Juniper Junos with tested CLI.

Read More
FortiGate IPAM vs DHCP: Differences, Overlap, and What to Check Before You Turn IPAM On

FortiGate IPAM vs DHCP: Differences, Overlap, and What to Check Before You Turn IPAM On

FortiGate IPAM vs DHCP explained: what each one assigns, where they overlap, and what to check before enabling IPAM so it does not renumber...

Read More
Outlook CVE-2026-124194: Patch the Zero-Day That Leaks NTLM Hashes

Outlook CVE-2026-124194: Patch the Zero-Day That Leaks NTLM Hashes

Outlook CVE-2026-124194 leaks NTLMv2 hashes from one opened .msg file. Check fixed builds, force the Office update, and block SMB egress on FortiGate.

Read More