Step 1: Access the CLI

  1. Log in to the FortiGate web interface.
  2. Fortigate

Example for Monitoring WAN1

  1. Enter the following commands to configure a link monitor for WAN1: (remember to execute one command at a time)

config system link-monitor


    edit "WAN1_Monitor"
        set srcintf "wan1"
        set server "8.8.8.8"  # Replace with the IP of the server you want to monitor
        set gateway-ip <WAN1 Gateway IP>  # Replace with your actual WAN1 gateway IP
        set interval 5  # Health check interval in seconds
        set timeout 500  # Timeout for each check in milliseconds
        set failtime 5  # Number of failed attempts before considering the link down
        set recoverytime 5  # Number of successful attempts before considering the link up
    next
end

Example for Monitoring WAN2

  1. Enter the following commands to configure a link monitor for WAN2:

config system link-monitor
    edit "WAN2_Monitor"
        set srcintf "wan2"
        set server "8.8.4.4"  # Replace with the IP of the server you want to monitor
        set gateway-ip <WAN2 Gateway IP>  # Replace with your actual WAN2 gateway IP
        set interval 5  # Health check interval in seconds
        set timeout 500  # Timeout for each check in milliseconds
        set failtime 5  # Number of failed attempts before considering the link down
        set recoverytime 5  # Number of successful attempts before considering the link up
    next
end

 

Step 4: Verify the Configuration

  1. Use the following command to verify the status of the link monitors:

         diagnose sys link-monitor status