Dead gateway detection
A host can be configured to detect whether a gateway it is using is down, and can adjust its routing table accordingly.
If the network option -passive_dgd is 1
,
passive dead gateway detection is enabled for the entire system. If
no response is received for consecutive dgd_packets_lost ARP requests
to a gateway, that gateway is assumed to be down and the distance
metrics (also known as hopcount or cost) for all routes
that use that gateway are raised to the maximum possible value. After dgd_retry_time minutes have passed,
the route's costs are restored to their user-configured values. The
host also takes action based on failing TCP connections. If
consecutive dgd_packets_lost TCP packets are lost, the ARP entry
for the gateway in use is deleted and the TCP connection tries
the next-best route. The next time the gateway is used, the above actions take
place if the gateway is actually down. The passive_dgd, dgd_packets_lost,
and dgd_retry_time parameters can all be configured by using
the no command.
Hosts can also be configured to use active dead gateway detection on a per-route basis with the -active_dgd flag of the route command. Active dead gateway detection pings all gateways used by routes for which it is enabled every dgd_ping_time second. If no response is received from a gateway, it is pinged more rapidly up to dgd_packets_lost times. If still no response is received, the costs of all routes that use that gateway are raised. The gateway continues to be pinged, and if a response is eventually received, the costs on the routes are restored to their user-configured values. The dgd_ping_time parameter can be configured by using the no command.
Dead gateway detection is most useful for hosts that use static rather than dynamic routing. Passive dead gateway detection results in less performance issues and is recommended for use on any network that has redundant gateways. However, passive dead gateway detection is done on a best-effort basis only. Some protocols, such as UDP, do not provide any feedback to the host if a data transmission is failing, and in this case no action can be taken by passive dead gateway detection.