Last active
October 12, 2024 19:34
-
-
Save luckman212/124a81d5f295dfa5c6d1162aaef55842 to your computer and use it in GitHub Desktop.
script for pfSense to detect IPv6 router advertisements coming from a WAN interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# set the variable below to your FIOS interface | |
IF=igb0 | |
/usr/bin/timeout 5m /usr/sbin/tcpdump -ni ${IF} 'icmp6 && ip6[40] == 134' >/tmp/${IF}_RAs.out | |
FSIZE=$(/usr/bin/stat -f '%z' /tmp/${IF}_RAs.out) | |
if [ "$FSIZE" -gt 1 ]; then | |
echo '<?php include("notices.inc"); $msg = "IPv6 RAs detected on interface '$IF'"; notify_via_smtp($msg);?>' | /usr/local/bin/php -q | |
fi |
Great script! However, is there a way to tie the notification into Telegram?
@sectary-want-holly sure, just edit the notify_via_smtp()
line, change it to notify_via_telegram($msg);
@luckman212 well, I feel silly! Muchos gracious!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! For anyone like me didn't already have them setup, this assumes you've setup SMTP notifications in pfsense (System > Advanced > Notifications). I used my Gmail credentials as outlined in this blog post.