Fortinet black logo

Admin Guide (Standalone)

Configure PBR routing

Configure PBR routing

The table below describes the commands for configuring Policy Based Routing (PBR).

CLI Command

Description

config router target

Enters target configuration mode.

edit <name>

Specify the name of the target.

set interface <interface>

Specify the outgoing interface or tunnel.

set next-hop <next_hop>

Specify the IP address of the next-hop gateway .

Example PBR configurations:

config router target

edit target.lan

set interface lan

set next-hop 192.168.10.99

next

edit target.vwan1

set interface vwan1

set next-hop

next

Example PBR policy configuration:

config router policy

edit vwan1-pbr

set input-device /* Incoming interface name.

size[35] - datasource(s): system.interface.name

set src 192.168.2.0/24 /* Source IP and mask for

this policy based route rule.

set srcaddr /* Source address

set dst /* Destination IP and mask

for this policy based route rule.

set dstaddr /* Destination address

set service /* Service and service

group names.

set target /* This PBR's out-going

interface and next-hop.

set status enable /* Enable/disable this

policy based route rule.

set comment /* Optional comments. size

[255]

next

end

Configure PBR routing

The table below describes the commands for configuring Policy Based Routing (PBR).

CLI Command

Description

config router target

Enters target configuration mode.

edit <name>

Specify the name of the target.

set interface <interface>

Specify the outgoing interface or tunnel.

set next-hop <next_hop>

Specify the IP address of the next-hop gateway .

Example PBR configurations:

config router target

edit target.lan

set interface lan

set next-hop 192.168.10.99

next

edit target.vwan1

set interface vwan1

set next-hop

next

Example PBR policy configuration:

config router policy

edit vwan1-pbr

set input-device /* Incoming interface name.

size[35] - datasource(s): system.interface.name

set src 192.168.2.0/24 /* Source IP and mask for

this policy based route rule.

set srcaddr /* Source address

set dst /* Destination IP and mask

for this policy based route rule.

set dstaddr /* Destination address

set service /* Service and service

group names.

set target /* This PBR's out-going

interface and next-hop.

set status enable /* Enable/disable this

policy based route rule.

set comment /* Optional comments. size

[255]

next

end