diagnose : network route
 
network route
Use this command to add or delete a route in the routing table, or to list the routing table.
Unlike get router all, this command displays all individual entries, including automatically configured routes for the loopback interface (127.0.0.1) and VLANs, and also displays each route’s priority. Unlike diagnose network rtcache, it displays all known routes, regardless of whether they have been recently used.
 
Do not delete routes unless you are sure. FortiWeb does not ask you to confirm the deletion, and there is no undelete mechanism. For example, if you accidentally delete a loopback interface route, you must recreate it manually.
To use this command, your administrator account’s access control profile must have rw or w permission to the sysgrp area. For more information, see “Permissions”.
Syntax
diagnose network route add {<source_ipv4mask> | <source_ipv6mask>} <interface_name> {<destination_ipv4mask> | <destination_ipv6mask>} <interface_name> {<gateway_ipv4> | <gateway_ipv6>}<priority_int>
diagnose network route delete {<source_ipv4mask> | <source_ipv6mask>} <interface_name> {<destination_ipv4mask> | <destination_ipv6mask>} <interface_name> {<gateway_ipv4> | <gateway_ipv6>} <priority_int>
Variable
Description
Default
{<source_ipv4mask> | <source_ipv6mask>}
Type the IP address and network mask of the source, separated by a space.
No default.
<interface_name>
Type the name of the interface to add or delete from the routing table.
No default.
{<destination_ipv4mask> | <destination_ipv6mask>}
Type the IP address and network mask of the source, separated by a space.
No default.
{<gateway_ipv4> | <gateway_ipv6>}
Enter the IP address of the next hop router (sometimes called a gateway) to which this route sends packets.
No default.
<priority_int>
Enter the priority of the route in the routing table. The lower the number the higher the priority. The value can be an integer from 1 to 255.
0
Example
This example displays the routing table.
tab=255 0.0.0.0/0.0.0.0/0->192.168.1.0/32/4 gwy=0.0.0.0 prio=0 prefsrc=192.168.1.27 type=3 scope=fd proto=2
tab=255 0.0.0.0/0.0.0.0/0->172.20.120.0/32/2 gwy=0.0.0.0 prio=0 prefsrc=172.20.120.47 type=3 scope=fd proto=2
tab=255 0.0.0.0/0.0.0.0/0->10.1.1.221/32/2 gwy=0.0.0.0 prio=0 prefsrc=10.1.1.221 type=2 scope=fe proto=2
tab=255 0.0.0.0/0.0.0.0/0->10.1.1.221/32/2 gwy=0.0.0.0 prio=0 prefsrc=10.1.1.221 type=3 scope=fd proto=2
tab=255 0.0.0.0/0.0.0.0/0->127.0.0.255/32/1 gwy=0.0.0.0 prio=0 prefsrc=127.0.0.1 type=3 scope=fd proto=2
tab=255 0.0.0.0/0.0.0.0/0->192.168.1.255/32/4 gwy=0.0.0.0 prio=0 prefsrc=192.168.1.27 type=3 scope=fd proto=2
tab=255 0.0.0.0/0.0.0.0/0->192.168.1.27/32/4 gwy=0.0.0.0 prio=0 prefsrc=192.168.1.27 type=2 scope=fe proto=2
tab=255 0.0.0.0/0.0.0.0/0->172.20.120.255/32/2 gwy=0.0.0.0 prio=0 prefsrc=172.20.120.47 type=3 scope=fd proto=2
tab=255 0.0.0.0/0.0.0.0/0->172.20.120.47/32/2 gwy=0.0.0.0 prio=0 prefsrc=172.20.120.47 type=2 scope=fe proto=2
tab=255 0.0.0.0/0.0.0.0/0->127.0.0.0/32/1 gwy=0.0.0.0 prio=0 prefsrc=127.0.0.1 type=3 scope=fd proto=2
tab=255 0.0.0.0/0.0.0.0/0->127.0.0.1/32/1 gwy=0.0.0.0 prio=0 prefsrc=127.0.0.1 type=2 scope=fe proto=2
tab=255 0.0.0.0/0.0.0.0/0->127.0.0.0/24/1 gwy=0.0.0.0 prio=0 prefsrc=127.0.0.1 type=2 scope=fe proto=2
tab=254 0.0.0.0/0.0.0.0/0->192.168.1.0/24/4 gwy=0.0.0.0 prio=0 prefsrc=192.168.1.27 type=1 scope=fd proto=2
tab=254 0.0.0.0/0.0.0.0/0->172.20.120.0/24/2 gwy=0.0.0.0 prio=0 prefsrc=172.20.120.47 type=1 scope=fd proto=2
tab=254 0.0.0.0/0.0.0.0/0->0.0.0.0/0/2 gwy=172.20.120.2 prio=2 prefsrc=0.0.0.0 type=1 scope=00 proto=14
Example
This example adds a route to the routing table.
diagnose network route add 10::/64 port1 10:200::1/64 port1 10::1 0
Related topics
get router all
execute ping
execute ping6
execute traceroute
diagnose network rtcache
config router static