Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #196275

Re: Get the external IP address from a Linux box

From Joel Rees <joel.rees@gmail.com>
Newsgroups linux.debian.user
Subject Re: Get the external IP address from a Linux box
Date 2018-05-31 02:10 +0200
Message-ID <vVjkd-6AH-1@gated-at.bofh.it> (permalink)
References <vSS4N-5l7-3@gated-at.bofh.it> <vSSxP-5Kp-3@gated-at.bofh.it> <vSSxP-5Kp-9@gated-at.bofh.it> <vSSHv-5NC-1@gated-at.bofh.it> <vSUJj-7i3-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


(Erk. Sorry, Joe.)

On Thu, May 24, 2018 at 6:29 PM, Joe <joe@jretrading.com> wrote:
> On Thu, 24 May 2018 08:13:54 +0100
> André Rodier <andre@rodier.me> wrote:
>
>> 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.

Two people have already tried to point out that UPNP is vulnerable by design.

If you have any interest in your local security, your router to the
outside should simply not respond to UPNP at all.

Block/ignore UPNP at every interface, internal and external, on your
external router, at bare minimum.

This is not pedantry, this is trying to save you from being attacked
from your inside.

> How is it possible to avoid being pedantic? You told us nothing about
> your Internet connection, or Debian version, so we had to guess at what
> information you actually wanted and which device to ask.
>
>> 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.
>
> So presumably it isn't your computer's external address that you want,
> but that of your router. I was a bit surprised to see upnp mentioned, I
> thought it was only game-players who were willing to run that, and
> Debian would not be their OS of choice.
>
> From (not recent) experience of talking to routers, you may have telnet
> or ssh available, otherwise it's an http admin login, followed by one or
> two router-specific commands. You might be lucky, and the default
> router status page without login may contain the WAN address.
>
> A couple of lines of bash should do it: use curl, and you'll probably
> have to provide the admin password, so the script should probably be
> stored in /root. My routers in years gone by used to need an occasional
> reboot, so I had a script running every ten minutes to check multiple
> websites for connectivity, and if none were found, to issue a reboot
> command.

What Joe says here.

I had ten or twenty lines of moderately careful code in a two
hundred-line perl script I used to update my dyndns.com domain name
back before dyn.com decided they had to kick all the freeloaders like
me off.

Resolution to *some* domain name really ought to be part of an ISP's
basic package, but the Internet got taken over by the poachers.


--
Joel Rees

http://reiisi.blogspot.jp/p/novels-i-am-writing.html

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Get the external IP address from a Linux box André Rodier <andre@rodier.me> - 2018-05-24 08:40 +0200
  Re: Get the external IP address from a Linux box conover@rahul.net (John Conover) - 2018-05-24 08:50 +0200
    Re: Get the external IP address from a Linux box likcoras <likcoras@riseup.net> - 2018-05-24 09:00 +0200
      Re: Get the external IP address from a Linux box conover@rahul.net (John Conover) - 2018-05-24 09:30 +0200
        Re: Get the external IP address from a Linux box André Rodier <andre@rodier.me> - 2018-05-24 10:00 +0200
  Re: Get the external IP address from a Linux box <tomas@tuxteam.de> - 2018-05-24 09:00 +0200
  Re: Get the external IP address from a Linux box Joe <joe@jretrading.com> - 2018-05-24 09:10 +0200
    Re: Get the external IP address from a Linux box Alberto Luaces <aluaces@udc.es> - 2018-05-24 09:10 +0200
      Re: Get the external IP address from a Linux box André Rodier <andre@rodier.me> - 2018-05-24 09:20 +0200
        Re: Get the external IP address from a Linux box <tomas@tuxteam.de> - 2018-05-24 09:40 +0200
        Re: Get the external IP address from a Linux box Joe <joe@jretrading.com> - 2018-05-24 11:30 +0200
          Re: Get the external IP address from a Linux box Joel Rees <joel.rees@gmail.com> - 2018-05-31 02:10 +0200
      Re: Get the external IP address from a Linux box Stefan Monnier <monnier@iro.umontreal.ca> - 2018-05-24 22:20 +0200
        Get the external IP address from a Linux box Erwan David <erwan@rail.eu.org> - 2018-05-24 22:40 +0200
          Re: Get the external IP address from a Linux box Miles Fidelman <mfidelman@meetinghouse.net> - 2018-05-24 23:30 +0200
    Re: Get the external IP address from a Linux box Richard Hector <richard@walnut.gen.nz> - 2018-05-26 08:20 +0200
  Re: Get the external IP address from a Linux box Abdullah Ramazanoğlu <ar018@yahoo.com> - 2018-05-24 09:40 +0200
    Re: Get the external IP address from a Linux box <tomas@tuxteam.de> - 2018-05-24 09:50 +0200
    Re: Get the external IP address from a Linux box Dan Purgert <dan@djph.net> - 2018-05-24 13:20 +0200
      Re: Get the external IP address from a Linux box Abdullah Ramazanoğlu <ar018@yahoo.com> - 2018-05-25 03:30 +0200
        Re: Get the external IP address from a Linux box Dan Purgert <dan@djph.net> - 2018-05-25 20:40 +0200
  Re: Get the external IP address from a Linux box Peter Ludikovsky <peter@ludikovsky.name> - 2018-05-24 13:20 +0200
  Re: Get the external IP address from a Linux box Greg Wooledge <wooledg@eeg.ccf.org> - 2018-05-24 14:10 +0200
    Re: Get the external IP address from a Linux box Dan Purgert <dan@djph.net> - 2018-05-24 15:00 +0200
  Re: Get the external IP address from a Linux box Alan Greenberger <alanjg@ptd.net> - 2018-05-25 03:10 +0200
    Re: Get the external IP address from a Linux box Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-26 13:20 +0200
      Re: Get the external IP address from a Linux box Alan Greenberger <alanjg@ptd.net> - 2018-05-28 14:10 +0200
        Re: Get the external IP address from a Linux box David Wright <deblis@lionunicorn.co.uk> - 2018-05-28 19:50 +0200
          Re: Get the external IP address from a Linux box Alan Greenberger <alanjg@ptd.net> - 2018-05-29 14:10 +0200
            Re: Get the external IP address from a Linux box David Wright <deblis@lionunicorn.co.uk> - 2018-06-02 16:40 +0200
        Re: Get the external IP address from a Linux box Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-28 23:20 +0200
          Re: Get the external IP address from a Linux box Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-29 15:00 +0200
            Re: Get the external IP address from a Linux box David Wright <deblis@lionunicorn.co.uk> - 2018-06-02 16:50 +0200
  Re: Get the external IP address from a Linux box Michael Stone <mstone@debian.org> - 2018-05-26 03:10 +0200
    Re: Get the external IP address from a Linux box Kenneth Parker <sea7kenp@gmail.com> - 2018-05-26 03:20 +0200
      Re: Get the external IP address from a Linux box Greg Wooledge <wooledg@eeg.ccf.org> - 2018-05-29 15:10 +0200
  Re: Get the external IP address from a Linux box Kenneth Parker <sea7kenp@gmail.com> - 2018-05-26 03:10 +0200
  Re: Get the external IP address from a Linux box André Rodier <andre@rodier.me> - 2018-05-26 13:00 +0200
    Get the external IP address from a Linux box Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> - 2018-05-27 13:20 +0200
      Re: Get the external IP address from a Linux box André Rodier <andre@rodier.me> - 2018-05-27 14:20 +0200
        Re: Get the external IP address from a Linux box Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> - 2018-05-27 15:50 +0200
          Re: Get the external IP address from a Linux box André Rodier <andre@rodier.me> - 2018-05-27 16:20 +0200

csiph-web