Date: Tue, 9 Jun 2020 03:21:31 +0200 From: Polytropon <freebsd@edvax.de> To: Ernie Luzar <luzar722@gmail.com> Cc: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: determining if host has a dynamic or static ip address Message-ID: <20200609032131.486b48a6.freebsd@edvax.de> In-Reply-To: <5EDECAF9.3080406@gmail.com> References: <5EDECAF9.3080406@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 08 Jun 2020 19:34:17 -0400, Ernie Luzar wrote: > I am asking if anyone knows of a way to determine what type of public ip > address the host has been ISP assigned [...] That's not exactly easy to tell. You can examine the hostname associated to the IP, and maybe it contains something like "pool" or "dynamic" - in that case, it's usually a dynamic IP from a specific range. There are ranges allocated by the ISPs that they use as a pool for customers' addresses assigned via DHCP (or a different means), for example. You can check if the IP is in such a range. Again, it's up to the ISP how they use such a range, as they could use a subset for addresses that they actually use as static IPs. The "rinse & repeat" method is also not reliable: You could disconnect and reconnect to your ISP, and if you get a different IP each time, it's probably dynamic. If not, it can still be assigned dynamically, so no way to be sure. Some ISPs sometimes "bind" the dynamic IP to the MAC address of the endpoint (and some even use the MAC address as the authentication factor for the customer). More information here: https://whatismyipaddress.com/dynamic-static > [...] by coding a csh script? Why should anyone do this in _C_ shell?! Tom Christiansen: "sh Programming Considered Harmful", 1996 http://harmful.cat-v.org/software/csh https://www-uxsup.csx.cam.ac.uk/misc/csh.html I know what I'm talking about, I exactly wrote (and still use) one, in numbers: 1, C shell script. ;-) > Is it even possible? Depends. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200609032131.486b48a6.freebsd>