Web lists-archives.com

Re: Get the external IP address from a Linux box




On Thu, 2018-05-24 at 09:07 +0200, Alberto Luaces wrote:
> Joe writes:
> 
> > On the assumption that you are using a router of some kind, your
> > public
> > IP address will be that of the router WAN port (cable, ADSL, etc.)
> > and
> > there will be a method of determining that by connecting to the
> > router
> > as an administrator. That method will depend entirely on the
> > router.
> 
> If the router supports upnp and it is activated, you can check the
> external IP in an device-independent way with
> 
> upnpc -l | grep ExternalIPAddress
> 

Thank you, finally an answer that make sense and is not pedantic.

I tried this, but it is not 100% reliable. For instance, with the
firewall / router I use, upnp id not activated. I suppose I will have
to write a custom python script.

Kind regards,
André