User Tools

Site Tools


monitoring_gateway_ping

This is an old revision of the document!


Loosing Gateway on freebsd 5.5

I have not seen any solution so far, so following custom scripts will help you.

add following line to rc.local.

| /etc/rc.local
/usr/local/bin/netmonitor

create script netmonitor

| /usr/local/bin/netmonitor
#!/bin/sh
 
. /etc/rc.conf
 
netmonitor(){
   while [ 1 ]; do
      ping -c 5 -t 1 $defaultrouter
 
      if [ $? -ne 0 ]; then
         sh /etc/netstart
         sh /etc/rc.virtual
      fi
      sleep 5
   done
}
 
netmonitor &
monitoring_gateway_ping.1253756246.txt.gz · Last modified: 2020/08/10 02:30 (external edit)