Logging my daily changing WAN-address
-
@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.
-
Hi,
in case of using if_pppoe (in pfsense 2.8.0) what file would have to be edited and attach these lines
cat /tmp/pppoe0_ip >> /root/iplog/iplog.log date >> /root/iplog/iplog.log
for having the WAN-IP get logged? (the /usr/local/sbin/ppp-linkup is not used anymore)
Thanks and nice sunday,
fireodo -
You could probably add something to pppoe-handler. But that's PHP not a shell script.
-
@stephenw10 said in [solved] Easy solution for logging my daily changing WAN-address:
You could probably add something to pppoe-handler. But that's PHP not a shell script.
Thanks - I'm not a PHP guru - do you have a "code" example?
-
Ha, I thought you might ask that and...nope not off hand. I'm no php guru either!
But if you're just logging the IP it's probably a one liner....
-
Maybe @Gertjan knows how to do it and can give detailed instructions how to do it for a noob like me.
-
@fireodo said in [solved] Easy solution for logging my daily changing WAN-address:
cat /tmp/pppoe0_ip >> /root/iplog/iplog.log
Doesn't exist anymore ?
I'm not using 2.7.2 or 2.8.0, - not using the pppoe or the new pppoe. -
@Gertjan said in [solved] Easy solution for logging my daily changing WAN-address:
Doesn't exist anymore ?
This (you mentioned) still exist but the executable /usr/local/sbin/ppp-linkup, is not used with the if_pppoe, so the lines that where attached at this file:
cat /tmp/pppoe0_ip >> /root/iplog/iplog.log date >> /root/iplog/iplog.log
doesn't function anymore. stephenw10 suggest to modify the /usr/local/sbin/pppoe-handler file but I'm not familiar with PHP ;-)
-
@Gertjan said in [solved] Easy solution for logging my daily changing WAN-address:
Doesn't exist anymore
Or how to do it with the DDNS-thingy.
-
@stephenw10 said in [solved] Easy solution for logging my daily changing WAN-address:
But if you're just logging the IP it's probably a one liner....
I will look, until I find a solution I stay with mpd as all the time before 2.8.0 ... :-)
-
Hi,
i found a solution everybody interested is invited to try :-)
I made a shell script file called "logip" with following content:
#!/bin/sh # IP-Logging cat /tmp/pppoe0_ip >> /root/iplog/iplog.log date >> /root/iplog/iplog.log
and placed in "/root/bin/" and made it executable.
After that I modified (attention - this is a original pfsense file!!!) the file "/etc/rc.newwanip" attaching at the end (before the "?>" this line of code:
shell_exec('/root/bin/logip');
The rc.newwanip is executed each time the system gets a new WAN IP so it should work. (I tested here and it works).
The "bad" thing is that the "rc.newwanip" has to be edited each time the system gets an upgrade/update ...
If someone gets a more "elegant" solution I'am open to it :-)Regards,
fireodo -
You could create a patch that adds that line to rc.newwanip and set it to auto-apply.
-
@stephenw10 said in [somewhat solved] Easy solution for logging my daily changing WAN-address:
You could create a patch that adds that line to rc.newwanip and set it to auto-apply.
Yes that would be an option!
But now I found a new "problem": Snort cannot handle the pppoe0 interface (with if_pppoe) and exits with this error:
"FATAL ERROR: Cannot decode data link type 51"
so there is more work to doI switched back to "mpd" because i need Snort working ...
-
Hmm, using in-line mode?
-
@stephenw10 said in [somewhat solved] Easy solution for logging my daily changing WAN-address:
Hmm, using in-line mode?
No, legacy mode ...
-
OK digging....
-
@stephenw10 said in [somewhat solved] Easy solution for logging my daily changing WAN-address:
OK digging....
I have post a question also in IDS/IPS adressed to Bill Meeks
-
Yup replicated it here. Digging deeper...