[solved] Easy solution for logging my daily changing WAN-address
-
@Gertjan said in Easy solution for logging my daily changing WAN-address:
It changes , => you get a mail.
Interesting. The problem with that, having many VPN-clients as gateways makes a lot of gateway-alerts and with that emails. So I would need to fight that first. And I recently changed my email server and now it is more cumbersome creating this types of rules. Maybe I should look into that anyways.
-
Keep in mind that Dyndns, triggered when a WAN type interface event happens, will only update the IP, and send a mail if the previous WAN IP was different as the current, new one.
So, you'll get a mail and if you do not want a mail, you know now how to disable the mail notif] ( see here - and 7 lines lower for the IPv6 equivalent). -
@Bob-Dig said in Easy solution for logging my daily changing WAN-address:
Maybe I should look into that anyways.
Hi, I propose you another solution (if you like and you are not to shy to edit a system file)
Edit this file:
/usr/local/sbin/ppp-linkup
(this file gets executed each time the pppoe triggers a new connection (implicit a new IP))
attach at the end of the file (before the "exit 0")
# IP-Logging cat /tmp/pppoe0_ip >> /root/iplog/iplog.log date >> /root/iplog/iplog.log
In this example the destination is a file in the root directory: /root/iplog/iplog.log (you can choose another destination as you wish)
Regards,
fireodo -
mkdir -p /root/iplog
touch /root/iplog/iplog.logIf for some reason, the sub folder didn't exit (because pfSense was re installed, or some &@$!!ยค deleted the "iplog" folder in /root/), its created.
Same thing for the file "iplog.log" : if it didn't exist, a zero byte "iplog.log" will be created.and from now on its happy appending :
cat /tmp/pppoe0_ip >> /root/iplog/iplog.log
date >> /root/iplog/iplog.log -
Thanks for the completion! Also after a pfsense-update the "ppp-linkup" file has to be edited again.
Regards
-
@fireodo said in Easy solution for logging my daily changing WAN-address:
Also after a update the "ppp-linkup" file has to be edited again.
I'm pretty sure bob.dig can make a patch out of it, so it can be re installed with a click ^^
-
@Gertjan said in Easy solution for logging my daily changing WAN-address:
I'm pretty sure bob.dig can make a patch out of it, so it can be re installed with a click ^^
Of course, but maybe someone else read and want that too ...
-
If you have a dyndns client running on the WAN it should only notify you when the WAN address changes.
-
@Gertjan said in Easy solution for logging my daily changing WAN-address:
I'm pretty sure bob.dig can make a patch out of it, so it can be re installed with a click ^^
Actually no, you must mistake me for someone else. But thank you and @fireodo for that solution. I think, I like it the most so far.
@stephenw10 said in Easy solution for logging my daily changing WAN-address:
If you have a dyndns client running on the WAN it should only notify you when the WAN address changes.
True, but any gateway event will also trigger emails, as far as I remember, and with 10+ flaky privacy-VPN-clients, that are WAN-type interfaces, this becomes very annoying, I can tell you.
-
@Bob-Dig said in Easy solution for logging my daily changing WAN-address:
True, but any gateway event will also trigger emails, as far as I remember and with 10 VPN clients this becomes very annoying, I can tell you.
I get it.
Still, the Dyndns setp will only send a mail IF the WAN IP actually did change.
If the "do something with the WAN interface" is called many time, it doesn't matter : only if the IP changed, you get a mail.
If it changes x times a day, you will get x mails a day, true. -
Marked solved, thanks guys.
@Gertjan said in Easy solution for logging my daily changing WAN-address:
can make a patch out of it, so it can be re installed with a click
If someone reputable wants to make a site "pfSense Helper Scripts", I wouldn't mind.