- Go to macvendors.com
- Sign up and generate your API token
- Paste the token into the
MACVENDORS_TOKEN
variable inside the script
- Open @BotFather on Telegram
- Create a new bot and get the
BOT_TOKEN
- Send a message to your bot and use a tool like IDBot or logs to find your
CHAT_ID
- Fill in both
BOT_TOKEN
andCHAT_ID
in the script
- Save the script to the following path :
/etc/hotplug.d/dhcp/99-notify_new_device
- Use
chmod
:chmod +x /etc/hotplug.d/dhcp/99-notify_new_device
- Create a file at:
/etc/known_macs
- List known MAC addresses one per line
- You can optionally add a name or description after the MAC address:
50:98:39:EE:1D:93 Ali's iPhone 3C:2E:F9:1A:44:55 Office Printer A4:7C:94:2F:18:01 Smart TV - Living Room
Now every time an unknown device connects to your network,
you'll get a detailed notification in Telegram π¬