Page 1 of 1

Sounding the beeper when a LAN device pings the router

Posted: Tue Mar 19, 2019 9:00 pm
by fbuster
Could anyone help me with a script that sounds the beeper when a Lan device pings the router ?

Re: Sounding the beeper when a LAN device pings the router

Posted: Wed Mar 20, 2019 2:58 pm
by 2frogs
/ip firewall filter
add action=accept chain=input comment=pingcatch in-interface-list=LAN log=yes \
    log-prefix=Ping protocol=icmp

/system scheduler
add interval=1s name=pingbeep on-event=":global pingcont;\r\
    \n:if ([:len \$pingcont]=>0) do={:set \$pingcont [/ip firewal filter ge
    nd comment=\"pingcatch\"] packets]};\r\
    \n/ip firewall filter\r\
    \n:if ([get [find comment=\"pingcatch\"] packets]>\$pingcont) do={\r\
    \n:beep frequency=3000 length=100ms; :delay 100ms;\r\
    \n:beep frequency=250 length=100ms; :delay 100ms;\r\
    \n:beep frequency=2000 length=100ms; :delay 100ms;\r\
    \n:set \$pingcont (\$pingcont+1)}" policy=read,write,policy,test \
    start-time=startup

Re: Sounding the beeper when a LAN device pings the router

Posted: Sun Mar 24, 2019 5:52 pm
by fbuster
Thank you for sharing :D