Querying WAN address
-
Is there a way to query a pfSense box for the WAN IP from the LAN side (ideally a separate machine)?
Obviously I can do this manually by logging in to the pfSense web GUI & and seeing the WAN IP on the homepage…but I'd like some method to do this automatically.
Thanks in advance!
-
Call http://checkip.dyndns.org:8245 and parse the incoming HTML for the IP-Address.
Same way as pfSense will query the IP for Dynamic DNS updates.
-
I always thought SNMP was designed to gather and monitor such information.
-
@wkn:
Call http://checkip.dyndns.org:8245 and parse the incoming HTML for the IP-Address.
Same way as pfSense will query the IP for Dynamic DNS updates.
wkn apologies for not making my intention clear but I am specifically trying not to rely on an external/3rd party services, just on the pfsense box itself which can already show me the information I require through the web GUI.
-
@kpa:
I always thought SNMP was designed to gather and monitor such information.
Could very well be, but I'm not all that familiar with SNMP. Any pointers to get started beyond RTFM or just keep digging around on SNMP in PFsense?
-
enable the snmp service on pfsense.
then use an snmp-client to check if the wan ip is among the listed variables
-
Have you tried?
ifconfig eth1 | grep 'inet'