FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
AlexC-FTNT
Staff
Staff
Article Id 310902
Description

 

This article describes how to change the order of the rules in the route-map setup. 

A route map may have multiple rules that are processed from the top down, so the order of the rules is important.

 

Scope

 

FortiOS.

 

Solution

 

New rules in a route map need to be placed in the correct order for desired results.

Unfortunately, once a sequence of rules has been set up, new rules will only be added to the end of the list, regardless of the number that is assigned.

 

For example: 

There is a need to add a new rule, placed in the 2nd position, to the existing rules: 10, 20, 30, 40.

The desired new rule sequence would be 10, 15, 20, 30, 40.

However, adding a new rule 15 in the CLI will place it at the bottom of the list, so the outcome will be 10, 20, 30, 40, 15 (which is not desired).

 

show

config router route-map

edit "MyRouteMap"

config rule

edit 10

set match-ip-address "Test1"
set set-local-preference 100

next

edit 20

set match-ip-address "Test2"
set set-local-preference 100

next
edit 30

set match-ip-address "Test3"
set set-local-preference 200

next
edit 40

set match-ip-address "Test4"

set set-local-preference 50

next

edit 15

set set-local-preference 100

next

end

 

To correct this and place rule 15 on the second position, the existing rules must first deleted and the config must be saved (end).

Deleting the existing rules and saving means that the traffic will be disrupted, so performing this during a maintenance window is required.

 

The option to 'move' one rule above another does not exist (in the way that it is possible to do this with the firewall policies).

The fastest way to achieve the desired result is to use a text editor to arrange the rules in the desired position prior to applying them in the FortiOS config.

 

Related articles:

Route maps - FortiGate administration guide.

Contributors