Technical Tip: How to clear FortiGates route cache
| Description | This article describes how to clear the FortiGate route cache. For some reason, it may be required to clear the route cache on FortiGate. |
| Scope | FortiGate under Linux kernel v3.6. |
| Solution | Route cache is a Linux kernel component that is consulted before the actual route lookup. If the lookup into this cache does not produce a match, the packet is forwarded based on a FIB lookup. The cache is a hash table, and a lookup into this table is performed based on a key constructed from the tuples seen in the IP packet header, such as its source IP, destination IP, and related information.
To clear the route cache, from the CLI issue the following command:
diagnose ip rtcache flush
FortiGates that are running on Linux kernel 3.6 or above will not have a Router cache anymore. This command will not be available.
Note: Clearing the route cache does not remove entries from the routing table and does not affect the configured static routes, dynamic routing protocols, or policy routes. It only removes cached forwarding lookup information maintained by the kernel.
After the cache is cleared, new packets are forwarded based on a fresh route lookup from the routing table/FIB. This may cause a brief traffic interruption for active flows while forwarding entries are rebuilt. For this reason, it is recommended to perform this action during a maintenance window whenever possible.
Related article: Troubleshooting Tip: Route cache is removed from FortiGates running new kernel version |
