[solved] Easy solution for logging my daily changing WAN-address
-
Is there a package where I can log only my dynamic IP-address on WAN? It is changing almost daily and I get it via PPPoE. I installed arpwatch just for that but it refuses to start if I run it on WAN only and maybe is no fit in any case. Is there an easy, OOTB solution for pfSense where I can keep track only of my WAN-IP, preferably not saved in the system-log because I clear that often.
-
-
@Bob-Dig isn't PPP/PPPoE logged to /var/log/ppp.log, additionally to /var/log/system.log?
-
@elvisimprsntr said in Easy solution for logging my daily changing WAN-address:
Use DyDNS
Thanks but that is not my question.
@patient0 said in Easy solution for logging my daily changing WAN-address:
isn't PPP/PPPoE logged to /var/log/ppp.log, additionally to /var/log/system.log?
Could be but I don't run any logging solution other than the built-in and I don't export it anywhere and I do delete it all the time. So I have to work on that part I guess if there is no other solution. Before doing PPPoE on pfSense, I had my Fritzbox sending me emails about my changing WAN-IP-address, missing that. And I run many gateways (VPN-clients) on pfSense, so the gateway-monitoring-emails are to annoying.
-
@Bob-Dig said in Easy solution for logging my daily changing WAN-address:
Could be but I don't run any logging solution other than the built-in and I don't export it anywhere and I do delete it all the time
What is you want do be done, you write "... solution for logging ..."? Logging to where or what if not a file?
You like to have a file that contains only the changed IP, interface and time? Or you like to get an email?
-
@patient0 I want to have an easy overview of my WAN-IPs from the past. And I don't run any external server for logs of any kind, yet... Technically I could do so in the future but haven't learned, how to do it. Technically, because I have a Homeserver running 24/7.
-
@Bob-Dig I see, and Status / System Logs / PPP is too noisy.
Would be handy if in Status / System Logs / PPP one could save a filter (e.g for IPADDR).
-
@patient0 Also I am deleting all the logs very often. I just saw, that I can delete only the firewall log(?). So maybe changing my behavior would help in that regard.
-
@Bob-Dig said in Easy solution for logging my daily changing WAN-address:
and I do delete it all the time
What ?
You want your WAN IP being logged .... and it is in the system.log (or ppp log ? Not sure, it's years I haven't use pppoe).
And you delete the file where it is logged.@elvisimprsntr said in Easy solution for logging my daily changing WAN-address:
Use DyDNS.
That's what I would propose also. Gives you a permanent trace of the WAN IP. It changes , => you get a mail. Stop deleting the mails and you have a permanent trace of your WAN IP.
Normally, I use a host name to access my WAN IPv4 @home as it changes ones a week. If needed, I have the mails, and the one will tell me when it changed, and what it is.When you use DynDNS, you could add a line here where you 'append' the $this->_dnsIP variable (contains the updated WAN IP) and a time stamp to a file, for example here /root/.
From then on, you'll have a constantly growing (30 bytes a day ?) file that contains the current WAN IP on the last line. -
@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.