Re: Get the external IP address from a Linux box
- To: debian-user@lists.debian.org
- Subject: Re: Get the external IP address from a Linux box
- From: David Wright <deblis@lionunicorn.co.uk>
- Date: Sat, 2 Jun 2018 09:38:27 -0500
- Message-id: <[🔎] 20180602143827.GA6186@alum>
- Reply-to: debian-user@lists.debian.org
- In-reply-to: <slrnpgqgdm.urg.alanjg@archduke.router>
- References: <1527142976.23018.1.camel@rodier.me> <slrnpgelg4.8pj.alanjg@archduke.router> <c29ad420-7bdc-1110-98ba-167db1a8d6be@plouf.fr.eu.org> <slrnpgnrg9.6fm.alanjg@archduke.router> <20180528174903.GA11197@alum> <slrnpgqgdm.urg.alanjg@archduke.router>
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.
Reply to: