Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #196029 > unrolled thread
| Started by | André Rodier <andre@rodier.me> |
|---|---|
| First post | 2018-05-24 08:40 +0200 |
| Last post | 2018-05-27 16:20 +0200 |
| Articles | 20 on this page of 42 — 21 participants |
Back to article view | Back to linux.debian.user
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
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | Dan Purgert <dan@djph.net> |
|---|---|
| Date | 2018-05-25 20:40 +0200 |
| Message-ID | <vTpN7-1pU-1@gated-at.bofh.it> |
| In reply to | #196061 |
Abdullah Ramazanoğlu wrote: > On Thu, 24 May 2018 11:04:51 -0000 (UTC) Dan Purgert said: > >> Ew, CGNAT. :( >> >> If you have a particularly poor ISP, they may even NAT you somewhere >> insane outside of RFC1918 (10.0.0.0 - 10.255.255.255 / 172.16.0.0 - >> 172.31.255.255 / 192.168.0.0 - 192.168.255.255) or RFC6598 (100.64.0.0 - >> 100.127.255.255) space. > > Since RFC1918 and RFC6598 reserved addresses you mentioned are free (as in > lunch) to use, an ISP violating them in their internal cloud must be > really poor of clues, rather than of finances. Yep, "poor as in bad", rather than "poor as in a pauper". -- |_|O|_| Registered Linux user #585947 |_|_|O| Github: https://github.com/dpurgert |O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
[toc] | [prev] | [next] | [standalone]
| From | Peter Ludikovsky <peter@ludikovsky.name> |
|---|---|
| Date | 2018-05-24 13:20 +0200 |
| Message-ID | <vSWrL-8ot-3@gated-at.bofh.it> |
| In reply to | #196029 |
curl https://icanhazip.com Regards, /peter On 2018-05-24 08:22, André Rodier wrote: > Hello, > > I am looking for a native package on Debian, that can give me the > external IP address of the machine. > > So far, I used internet sites, but I am sure there is a package that do > that properly, especially if one site is unreachable. > > Something I can run from the command line, and that would return the > external IP address. > > Thanks. >
[toc] | [prev] | [next] | [standalone]
| From | Greg Wooledge <wooledg@eeg.ccf.org> |
|---|---|
| Date | 2018-05-24 14:10 +0200 |
| Message-ID | <vSXe9-vG-5@gated-at.bofh.it> |
| In reply to | #196029 |
On Thu, May 24, 2018 at 07:22:56AM +0100, André Rodier wrote: > I am looking for a native package on Debian, that can give me the > external IP address of the machine. wget --quiet -O- http://wooledge.org/myip.cgi Or your favorite alternative "tell me what my IP address is" web service, if you don't like mine.
[toc] | [prev] | [next] | [standalone]
| From | Dan Purgert <dan@djph.net> |
|---|---|
| Date | 2018-05-24 15:00 +0200 |
| Message-ID | <vSY0x-Lu-3@gated-at.bofh.it> |
| In reply to | #196045 |
Greg Wooledge wrote: > On Thu, May 24, 2018 at 07:22:56AM +0100, André Rodier wrote: >> I am looking for a native package on Debian, that can give me the >> external IP address of the machine. > > wget --quiet -O- http://wooledge.org/myip.cgi > > Or your favorite alternative "tell me what my IP address is" web service, > if you don't like mine. Another one to add to the toolkit. Wonder what other tidbits that wooledge.org site is hiding, hmmm... -- |_|O|_| Registered Linux user #585947 |_|_|O| Github: https://github.com/dpurgert |O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
[toc] | [prev] | [next] | [standalone]
| From | Alan Greenberger <alanjg@ptd.net> |
|---|---|
| Date | 2018-05-25 03:10 +0200 |
| Message-ID | <vT9oZ-8oU-1@gated-at.bofh.it> |
| In reply to | #196029 |
On 2018-05-24, André Rodier <andre@rodier.me> wrote: > Hello, > > I am looking for a native package on Debian, that can give me the > external IP address of the machine. > Assuming you are looking for the public internet address of your router, you could try: /usr/sbin/arp -n and it may show up on a line with the HWadress of your router.
[toc] | [prev] | [next] | [standalone]
| From | Pascal Hambourg <pascal@plouf.fr.eu.org> |
|---|---|
| Date | 2018-05-26 13:20 +0200 |
| Message-ID | <vTFoR-2C8-3@gated-at.bofh.it> |
| In reply to | #196060 |
Le 25/05/2018 à 02:17, Alan Greenberger a écrit : > On 2018-05-24, André Rodier <andre@rodier.me> wrote: >> >> I am looking for a native package on Debian, that can give me the >> external IP address of the machine. > > Assuming you are looking for the public internet address of your router, > you could try: > /usr/sbin/arp -n > and it may show up on a line with the HWadress of your router. Nope. That would just show the internal address of the router.
[toc] | [prev] | [next] | [standalone]
| From | Alan Greenberger <alanjg@ptd.net> |
|---|---|
| Date | 2018-05-28 14:10 +0200 |
| Message-ID | <vUp8m-7mU-15@gated-at.bofh.it> |
| In reply to | #196088 |
On 2018-05-26, Pascal Hambourg <pascal@plouf.fr.eu.org> wrote: > Le 25/05/2018 à 02:17, Alan Greenberger a écrit : >> On 2018-05-24, André Rodier <andre@rodier.me> wrote: >>> >>> I am looking for a native package on Debian, that can give me the >>> external IP address of the machine. >> >> Assuming you are looking for the public internet address of your router, >> you could try: >> /usr/sbin/arp -n >> and it may show up on a line with the HWadress of your router. > > Nope. That would just show the internal address of the router. > > You are mostly correct. However, I have one machine on which the response to /usr/sbin/arp -n shows two lines with the HWaddress of the router, one with the internal address as you said and the other with the external address. I have no idea what made arp see the external address.
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2018-05-28 19:50 +0200 |
| Message-ID | <vUurn-1Qw-3@gated-at.bofh.it> |
| In reply to | #196147 |
On Mon 28 May 2018 at 07:54:49 (-0400), Alan Greenberger wrote: > On 2018-05-26, Pascal Hambourg <pascal@plouf.fr.eu.org> wrote: > > Le 25/05/2018 à 02:17, Alan Greenberger a écrit : > >> On 2018-05-24, André Rodier <andre@rodier.me> wrote: > >>> > >>> I am looking for a native package on Debian, that can give me the > >>> external IP address of the machine. > >> > >> Assuming you are looking for the public internet address of your router, > >> you could try: > >> /usr/sbin/arp -n > >> and it may show up on a line with the HWadress of your router. > > > > Nope. That would just show the internal address of the router. > > > > > You are mostly correct. However, I have one machine on which the > response to > /usr/sbin/arp -n > shows two lines with the HWaddress of the router, one with the internal > address as you said and the other with the external address. I have no > idea what made arp see the external address. Can we see what you're seeing (suitably mangled)? Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | Alan Greenberger <alanjg@ptd.net> |
|---|---|
| Date | 2018-05-29 14:10 +0200 |
| Message-ID | <vULBU-3Hj-9@gated-at.bofh.it> |
| In reply to | #196166 |
On 2018-05-28, David Wright <deblis@lionunicorn.co.uk> wrote: > On Mon 28 May 2018 at 07:54:49 (-0400), Alan Greenberger wrote: >> On 2018-05-26, Pascal Hambourg <pascal@plouf.fr.eu.org> wrote: >> > Le 25/05/2018 à 02:17, Alan Greenberger a écrit : >> >> On 2018-05-24, André Rodier <andre@rodier.me> wrote: >> >>> >> >>> I am looking for a native package on Debian, that can give me the >> >>> external IP address of the machine. >> >> >> >> Assuming you are looking for the public internet address of your router, >> >> you could try: >> >> /usr/sbin/arp -n >> >> and it may show up on a line with the HWadress of your router. >> > >> > Nope. That would just show the internal address of the router. >> > >> > >> You are mostly correct. However, I have one machine on which the >> response to >> /usr/sbin/arp -n >> shows two lines with the HWaddress of the router, one with the internal >> address as you said and the other with the external address. I have no >> idea what made arp see the external address. > > Can we see what you're seeing (suitably mangled)? > > Cheers, > David. > > 192.168.1.1 ether 6x:3x:ex:7x:4x:bx C eth0 2x.1xx.1xx.1xx ether 6x:3x:ex:7x:4x:bx C eth0
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2018-06-02 16:40 +0200 |
| Message-ID | <vWfRf-7bg-1@gated-at.bofh.it> |
| In reply to | #196191 |
On Tue 29 May 2018 at 08:04:06 (-0400), Alan Greenberger wrote: > On 2018-05-28, David Wright <deblis@lionunicorn.co.uk> wrote: > > On Mon 28 May 2018 at 07:54:49 (-0400), Alan Greenberger wrote: > >> On 2018-05-26, Pascal Hambourg <pascal@plouf.fr.eu.org> wrote: > >> > Le 25/05/2018 à 02:17, Alan Greenberger a écrit : > >> >> On 2018-05-24, André Rodier <andre@rodier.me> wrote: > >> >>> > >> >>> I am looking for a native package on Debian, that can give me the > >> >>> external IP address of the machine. > >> >> > >> >> Assuming you are looking for the public internet address of your router, > >> >> you could try: > >> >> /usr/sbin/arp -n > >> >> and it may show up on a line with the HWadress of your router. > >> > > >> > Nope. That would just show the internal address of the router. > >> > > >> > > >> You are mostly correct. However, I have one machine on which the > >> response to > >> /usr/sbin/arp -n > >> shows two lines with the HWaddress of the router, one with the internal > >> address as you said and the other with the external address. I have no > >> idea what made arp see the external address. > > > > Can we see what you're seeing (suitably mangled)? > > > > Cheers, > > David. > > > > > 192.168.1.1 ether 6x:3x:ex:7x:4x:bx C eth0 > 2x.1xx.1xx.1xx ether 6x:3x:ex:7x:4x:bx C eth0 The easiest way to achieve this might be to plug that host's cable into the modem rather than the router (for just a short period). I don't know how long it takes for arp entries to expire. A more worrying alternative is that something is misconfigured in the router, but I don't know what. Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | Pascal Hambourg <pascal@plouf.fr.eu.org> |
|---|---|
| Date | 2018-05-28 23:20 +0200 |
| Message-ID | <vUxID-3Tn-43@gated-at.bofh.it> |
| In reply to | #196147 |
Le 28/05/2018 à 13:54, Alan Greenberger a écrit : > On 2018-05-26, Pascal Hambourg <pascal@plouf.fr.eu.org> wrote: >> Le 25/05/2018 à 02:17, Alan Greenberger a écrit : >>> >>> Assuming you are looking for the public internet address of your router, >>> you could try: >>> /usr/sbin/arp -n >>> and it may show up on a line with the HWadress of your router. >> >> Nope. That would just show the internal address of the router. >> > You are mostly correct. However, I have one machine on which the > response to > /usr/sbin/arp -n > shows two lines with the HWaddress of the router, one with the internal > address as you said and the other with the external address. I have no > idea what made arp see the external address. Thinking of it, a router following the "weak host" model (like Linux does) can advertise any local address on any interface. It can be tested with arping. However I am failing to imagine any plausible scenario which could lead a host on the internal LAN to have the router's external IP address in its ARP cache. It means that either : - the host sends an ARP query for the router's external IP address - the router sends an ARP query to the host from its external IP address
[toc] | [prev] | [next] | [standalone]
| From | Pascal Hambourg <pascal@plouf.fr.eu.org> |
|---|---|
| Date | 2018-05-29 15:00 +0200 |
| Message-ID | <vUMoh-3X8-5@gated-at.bofh.it> |
| In reply to | #196174 |
Le 28/05/2018 à 23:14, Pascal Hambourg a écrit : > Le 28/05/2018 à 13:54, Alan Greenberger a écrit : >> >> You are mostly correct. However, I have one machine on which the >> response to >> /usr/sbin/arp -n >> shows two lines with the HWaddress of the router, one with the internal >> address as you said and the other with the external address. I have no >> idea what made arp see the external address. > > Thinking of it, a router following the "weak host" model (like Linux > does) can advertise any local address on any interface. It can be tested > with arping. However I am failing to imagine any plausible scenario > which could lead a host on the internal LAN to have the router's > external IP address in its ARP cache. It means that either : > - the host sends an ARP query for the router's external IP address I guess this could happen if the host has a direct default route (no gateway) and the router acts as an ARP proxy. Quite an unusual setup. > - the router sends an ARP query to the host from its external IP address I checked that the latter can happen when the router must send a packet to the host with its external address as source and must resolve the host's address. Then the ARP query source IP address is the external address, and the destination host stores it in its ARP cache. Any idea why the router would send packets to this host from its external address ?
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2018-06-02 16:50 +0200 |
| Message-ID | <vWg0W-7eo-5@gated-at.bofh.it> |
| In reply to | #196193 |
On Tue 29 May 2018 at 14:57:22 (+0200), Pascal Hambourg wrote: > Le 28/05/2018 à 23:14, Pascal Hambourg a écrit : > >Le 28/05/2018 à 13:54, Alan Greenberger a écrit : > >> > >>You are mostly correct. However, I have one machine on which the > >>response to > >>/usr/sbin/arp -n > >>shows two lines with the HWaddress of the router, one with the internal > >>address as you said and the other with the external address. I have no > >>idea what made arp see the external address. > > > >Thinking of it, a router following the "weak host" model (like > >Linux does) can advertise any local address on any interface. It > >can be tested with arping. However I am failing to imagine any > >plausible scenario which could lead a host on the internal LAN to > >have the router's external IP address in its ARP cache. It means > >that either : > >- the host sends an ARP query for the router's external IP address > > I guess this could happen if the host has a direct default route (no > gateway) and the router acts as an ARP proxy. Quite an unusual > setup. > > >- the router sends an ARP query to the host from its external IP address > > I checked that the latter can happen when the router must send a > packet to the host with its external address as source and must > resolve the host's address. Then the ARP query source IP address is > the external address, and the destination host stores it in its ARP > cache. > > Any idea why the router would send packets to this host from its > external address ? I think your analysis starts from an assumption that everything is, and always was, set up correctly from the start, and is working with a sane and correct configuration, which might not be completely true. Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | Michael Stone <mstone@debian.org> |
|---|---|
| Date | 2018-05-26 03:10 +0200 |
| Message-ID | <vTvSy-563-3@gated-at.bofh.it> |
| In reply to | #196029 |
On Fri, May 25, 2018 at 09:03:15PM -0400, Kenneth Parker wrote: >I haven't reviewed the Source Code for the "who" command, to see how it gets >that IP Address. Anybody? It gets it from your login program or pam writing to /var/run/utmp Mike Stone
[toc] | [prev] | [next] | [standalone]
| From | Kenneth Parker <sea7kenp@gmail.com> |
|---|---|
| Date | 2018-05-26 03:20 +0200 |
| Message-ID | <vTw2d-59f-1@gated-at.bofh.it> |
| In reply to | #196079 |
[Multipart message — attachments visible in raw view] — view raw
Thank you most kindly, Mike! Is there anything from this, that can help the original Poster? Sign onto yourself, from a VPN or some such? (Back in the "good old days" where being a "hacker" was Respectable, people would see if they could reconnect to their own Unix/Linux System, through as many Countries as possible. With UUCP [Anyone else remember THAT?], you could get, quite a "Telephone Circle" going. Oh well!!!) Kenneth Parker On Fri, May 25, 2018 at 9:05 PM, Michael Stone <mstone@debian.org> wrote: > On Fri, May 25, 2018 at 09:03:15PM -0400, Kenneth Parker wrote: > >> I haven't reviewed the Source Code for the "who" command, to see how it >> gets >> that IP Address. Anybody? >> > > It gets it from your login program or pam writing to /var/run/utmp > > Mike Stone >
[toc] | [prev] | [next] | [standalone]
| From | Greg Wooledge <wooledg@eeg.ccf.org> |
|---|---|
| Date | 2018-05-29 15:10 +0200 |
| Message-ID | <vUMxY-4fC-5@gated-at.bofh.it> |
| In reply to | #196081 |
On Fri, May 25, 2018 at 09:13:34PM -0400, Kenneth Parker wrote: > Thank you most kindly, Mike! Is there anything from this, that can help > the original Poster? Sign onto yourself, from a VPN or some such? It's conceptually the same as getting a web service to tell you what IP address it "saw" you coming from, and using a web service is much simpler than doing a whole ssh login. There are a LOT of web services that do this; a few were already mentioned earlier in this thread.
[toc] | [prev] | [next] | [standalone]
| From | Kenneth Parker <sea7kenp@gmail.com> |
|---|---|
| Date | 2018-05-26 03:10 +0200 |
| Message-ID | <vTvSy-563-5@gated-at.bofh.it> |
| In reply to | #196029 |
[Multipart message — attachments visible in raw view] — view raw
I have Shell Access (as Admin) to a "Cloud" System (Ubuntu 16.04 Server, but due to be Reinstalled as Debian 9.4. Go Debian!) When I ssh in, to my "Regular Account", I type "who", and get the External IP Address for my Spectrum Broadband access. What I got, just a few minutes ago, was the following response: >> chronos@localhost:~$ who >> chronos pts/0 2018-05-26 00:47 (173.95.180.12) >> chronos@localhost:~$ (This is a Dynamic IP, from Spectrum, formerly Time Warner Cable, formerly Roadrunner. You know the drill: Small fish, eaten by a medium-sized fish, who is, then gobbled up by a Big Fish). I haven't reviewed the Source Code for the "who" command, to see how it gets that IP Address. Anybody? Thank you and best regards, Kenneth Parker, Troubleshooter
[toc] | [prev] | [next] | [standalone]
| From | André Rodier <andre@rodier.me> |
|---|---|
| Date | 2018-05-26 13:00 +0200 |
| Message-ID | <vTF5w-2fC-11@gated-at.bofh.it> |
| In reply to | #196029 |
On Thu, 2018-05-24 at 07:22 +0100, André Rodier wrote: > Hello, > > I am looking for a native package on Debian, that can give me the > external IP address of the machine. > > So far, I used internet sites, but I am sure there is a package that > do > that properly, especially if one site is unreachable. > > Something I can run from the command line, and that would return the > external IP address. > > Thanks. > After a few tests, I wrote a script that perhaps some people can use. First, interestingly, the google DNS trick did return the first IP address assigned to me, where I had four, whatever the server I used. The code is on github, as part of my small homebox project. I am not sure it deserves a dedicated repository ;-). https://github.com/progmaticltd/homebox/blob/dev-arodier/install/playbo oks/roles/system-prepare/files/external-ip It is very simple, but it does what I wanted: - Query multiple servers. - Count the IP addresses returned, and order them by the most probable result. - Return the external IP address only if above a certain level of confidence (actually 100%). - The list of IP addresses is in a separate configuration file. Please, note: - It is quickly made - I am not a bash expert - Yes, it would be nicer in Python Kind regards, André
[toc] | [prev] | [next] | [standalone]
| From | Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> |
|---|---|
| Date | 2018-05-27 13:20 +0200 |
| Message-ID | <vU1Sp-5j-3@gated-at.bofh.it> |
| In reply to | #196087 |
[Multipart message — attachments visible in raw view] — view raw
Hi, On 26/05/18 20:53, André Rodier wrote: > The code is on github, as part of my small homebox project. I am not > sure it deserves a dedicated repository ;-). > > https://github.com/progmaticltd/homebox/blob/dev-arodier/install/playbo > oks/roles/system-prepare/files/external-ip My take from your script is at: http://ix.io/1bwE/ [lose the trailing / for the raw file] NB: I am deliberately using bash instead of dash for a number of reasons.... > It is very simple, but it does what I wanted: > > - Query multiple servers. My script also does the Google DNS lookup. > - Count the IP addresses returned, and order them by the most probable > result. > - Return the external IP address only if above a certain level of > confidence (actually 100%). > - The list of IP addresses is in a separate configuration file. I've kept the option to use external config file; otherwise it uses what is known already n the script. I've used the following for quite some time, but it usually takes too long (for my liking) to get an answer and it doesn't use https either: curl -s ifconfig.me -- Kind Regards AndrewM
[toc] | [prev] | [next] | [standalone]
| From | André Rodier <andre@rodier.me> |
|---|---|
| Date | 2018-05-27 14:20 +0200 |
| Message-ID | <vU2Ot-D0-1@gated-at.bofh.it> |
| In reply to | #196135 |
On Sun, 2018-05-27 at 21:10 +1000, Andrew McGlashan wrote: > Hi, > > On 26/05/18 20:53, André Rodier wrote: > > The code is on github, as part of my small homebox project. I am not > > sure it deserves a dedicated repository ;-). > > > > https://github.com/progmaticltd/homebox/blob/dev-arodier/install/playbo > > oks/roles/system-prepare/files/external-ip > > My take from your script is at: > > http://ix.io/1bwE/ [lose the trailing / for the raw file] > > NB: I am deliberately using bash instead of dash for a number of reasons.... I use dash because it is the default shell for the root account on a number of distributions, and has a better security history than bash. > > It is very simple, but it does what I wanted: > > > > - Query multiple servers. > > My script also does the Google DNS lookup. I have four IP addresses, and Goodle DNS returns the first one, although I query from the second one. > > - Count the IP addresses returned, and order them by the most probable > > result. > > - Return the external IP address only if above a certain level of > > confidence (actually 100%). > > - The list of IP addresses is in a separate configuration file. > > I've kept the option to use external config file; otherwise it > uses what is known already n the script. Fair enough. > I've used the following for quite some time, but it usually takes too > long (for my liking) to get an answer and it doesn't use https either: > > curl -s ifconfig.me Yes, I can see it's very slow. Thank you. -- André Rodier HomeBox: https://github.com/progmaticltd/homebox
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | linux.debian.user
csiph-web