What's new

Question - e-Mail/Notification Unkown Device Connects to LAN

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

sentinelvdx

Very Senior Member
Hi,

I'm looking a way to get notified when a new device/non-listed on static IP table connects to my router.
I've not seen such on the AMTM available scripts, and I don't want to expose my router and let IFTTT access it.

Any idea how can achieve that?

Thanks,
 
Hi,

Probably not the answer you're looking for but I've managed to do something similar using traffic monitoring via ntopng and the APIs that it comes with. Took a bit of manual scripting but I get notified when an IP not in the host list is seen on the network.

Regards
 
Hello sentinelvdx. I'm also looking for a way to find out who connected to me. I switched from xiomi 3G to Padawan to this router. On the Padawan, I had a script that sent a message to the mail about a newly connected not from the list. Here's the script:
Code:
[CODE]
#!/bin/sh
# script to detect new DHCP lease
# this will be called by dnsmasq every time a new device is connected
# with the following arguments
# $1 = add | old
# $2 = MAC address
# $3 = IP address
# $4 = device name

notification_email="####@gmail.com"
known_mac_addr="/etc/storage/known_mac_addr.txt"

# check if the MAC is in known devices list
grep -q "$2" "$known_mac_addr"
unknown_mac_addr=$?

if [ "$1" == "add" ] && [ "$unknown_mac_addr" -ne 0 ]; then
msg="New device on `nvram get system.@system[0].hostname`.`nvram get dhcp.@dnsmasq[0].domain` $*"
echo `date` $msg >> /tmp/dhcpmasq.log
# encode colon (:) and form e-mail
echo "To:"$notification_email > /tmp/email.txt
echo "From:"$notification_email >> /tmp/email.txt
echo "Subject:A new device appears in the home network" >> /tmp/email.txt
echo $msg | sed s/:/-/g >> /tmp/email.txt
sendmail "###@gmail.com" -H 'exec openssl s_client -quiet -tls1_2 -connect smtp.gmail.com:465' < /tmp/email.txt -au"####@gmail.com" -ap"pass###" -f "####@gmail.com"
fi [/ CODE]
 
On a merlin, I can't run it. I copied it to / jffs / scripts, assigned permission 755 and no reaction when restarting the router or starting it manually.

To: mongodb

Could you tell us more about where you installed ntopng and more about the scripts used.

Thank you
 
@thelonelycoder wrote a diversion interface for iDevice users through shortcuts - something tells me someone equally clever could do the same in this case
 
Hello sentinelvdx. I'm also looking for a way to find out who connected to me. I switched from xiomi 3G to Padawan to this router. On the Padawan, I had a script that sent a message to the mail about a newly connected not from the list. Here's the script:
Code:
[CODE]
#!/bin/sh
# script to detect new DHCP lease
# this will be called by dnsmasq every time a new device is connected
# with the following arguments
# $1 = add | old
# $2 = MAC address
# $3 = IP address
# $4 = device name

notification_email="####@gmail.com"
known_mac_addr="/etc/storage/known_mac_addr.txt"

# check if the MAC is in known devices list
grep -q "$2" "$known_mac_addr"
unknown_mac_addr=$?

if [ "$1" == "add" ] && [ "$unknown_mac_addr" -ne 0 ]; then
msg="New device on `nvram get system.@system[0].hostname`.`nvram get dhcp.@dnsmasq[0].domain` $*"
echo `date` $msg >> /tmp/dhcpmasq.log
# encode colon (:) and form e-mail
echo "To:"$notification_email > /tmp/email.txt
echo "From:"$notification_email >> /tmp/email.txt
echo "Subject:A new device appears in the home network" >> /tmp/email.txt
echo $msg | sed s/:/-/g >> /tmp/email.txt
sendmail "###@gmail.com" -H 'exec openssl s_client -quiet -tls1_2 -connect smtp.gmail.com:465' < /tmp/email.txt -au"####@gmail.com" -ap"pass###" -f "####@gmail.com"
fi [/ CODE]
Thank you, I'll give a look at it!
 
[USER = 25480] @thelonelycoder [/ USER] написал интерфейс переадресации для пользователей iDevice с помощью ярлыков - что-то подсказывает мне, что в этом случае кто-то не менее умный мог бы сделать то же самое
What is this shortcut theme?

Could you please provide a link to study
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top