Lost route to remote subnet after random number of days



  • 2.3.1-release/i386 (physical) on server side.
    2.3.1-release/amd64 (virtual) on client side.

    100/100Mbit fibre connections both sides, same ISP, sites 600km apart.

    peer-to-peer shared key.  Works well, fast, stable.

    Once a month or so, the server side "looses" the route to the remote site, traffic stops, my phone melts.

    The single entry in routing table on server side that denotes the remote network is just gone.

    OpenVPN service on both sides stays up, no other errors. Client side retains it's route to server subnet.

    Restarting the openvpn service on server side restores route, as client quickly auto reconnects.

    6 other openvpn server side services on the same server, none of them ever loose a route.

    About 100+ users through the server, so logs are busy, and I can't fiddle with it too much.

    Any thoughts on how to best track down the issue?

    Anyone had similar problems?



  • Stop gap measure, check for missing route every hour, reinstate if missing. Ugly, but reduces stress until root cause found. Improvement suggestions welcome.

    
    #!/bin/sh
    #
    # check if 10.4.52.0 route has gone missing
    
    if [ "$(/usr/bin/netstat -r4 | grep 10.4.52)" ]
    then
      echo 'Found 52, no further action'
     else
      logger -p local3.warn 'Route 10.4.52.0 not found in route table'
      echo 'Route 10.4.52.0 not found in routing table, added'
      route add -net 10.4.52.0/24 10.4.9.2 
    fi