Fortinet white logo
Fortinet white logo

Admin Guide (Standalone)

Configure static routing


Configure static routing

The table below describes the commands for configuring static routing.

CLI command

Description

config router static

Enters static route configuration mode.

edit <name>

Specify the name of the static route.

set status {enable | disable}

Set the status of the static route:

  • enable—Enable the static route.
  • disable—Disable the static route.

set dst <dst>

Specify the destination IP address and netmask of the static route in the format: x.x.x.x/x

set gateway <gateway>

Specify the IP address of the gateway.

set distance <distance>

Specify the administrative distance. The range is 1–255. The default is 1.

set device <device>

Specify the name of the outgoing interface.

set comment [comment]

Enter a comment (optional).

Example static route configuration:

config router static

edit 1

set status enable

set dst 0.0.0.0/0

set gateway 192.168.2.1

set distance 5

set device lan

set comment

next

End

Configure static routing


Configure static routing

The table below describes the commands for configuring static routing.

CLI command

Description

config router static

Enters static route configuration mode.

edit <name>

Specify the name of the static route.

set status {enable | disable}

Set the status of the static route:

  • enable—Enable the static route.
  • disable—Disable the static route.

set dst <dst>

Specify the destination IP address and netmask of the static route in the format: x.x.x.x/x

set gateway <gateway>

Specify the IP address of the gateway.

set distance <distance>

Specify the administrative distance. The range is 1–255. The default is 1.

set device <device>

Specify the name of the outgoing interface.

set comment [comment]

Enter a comment (optional).

Example static route configuration:

config router static

edit 1

set status enable

set dst 0.0.0.0/0

set gateway 192.168.2.1

set distance 5

set device lan

set comment

next

End