How does setting a static IP on a mobile device prevent linux router from assigning that I...

Have a question or want to start a discussion? Post it! No Registration Necessary.  Now with pictures!

Threaded View
How does setting a static IP on a linux Android mobile device prevent the
linux router from assigning that IP address to another device?

On any mobile device (iOS, Android, whatever), you can set up an FTP server
(eg ES File Explorer on Android) with a static IP address so that Windows
"My Network Places" has a permanent "shortcut" to the entire mobile device
file system (eg ftp://192.158.1.15:3721 ).

This is very useful, and I've been using it for a couple of weeks ever
since it was discussed here - because it effectively mounts the mobile
device as a network drive on Windows without adding any new software on
either Android or Windows.

The Android linux mobile device seems to retain the static IP address even
after multiple boots of the linux Android phone or of the Linux SOHO router
which is set up to serve DHCP addresses.

How does that work?
Why doesn't the linux router give another linux device the IP address
"192.168.1.15"?

It seems as if it works by "magic" but there must be some logic here.

How does setting the IP address to be static on the Android phone cause the
linux router to *accept* that static address permanently?





 which can be set up in the mobile device connection settings
 Android: Settings > WiFi > AP > Modify network config > IP settings >
static (IP address = 192.158.1.15)

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
Tomos Davies says...
Quoted text here. Click to load it

The DHCP server should have a lease time; a day, a week.  What is the  
result of an ipconfig /all?  Can you post that here?  It would be useful  
if we could see that.

And what is the router/modem (the device with DHCP)?  You could assign a  
DHCP reservation in it, probably.  (Most newer router/modems support  
reservations.

(Microsoft do it beautifully in their server DHCP server software - you  
just right-click on any IP in it's list of assignments and 'reserve  
it' - job done, it's now in the Reservations list - no looking up fucken  
MAC numbers :) Don't do Linux DHCP servers, but I imagine it's a lovely  
command line thing :) )

--  
Duncan.

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
Dave Doe wrote:
Quoted text here. Click to load it

It's a lovely config file, thankyouverymuch :P


--  
|_|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

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
On 2017-04-14 00:35, Dave Doe wrote:

Quoted text here. Click to load it

Some routers have it point and clik, yes. And you know that most routers
run a Linux variant ;-)

--  
Cheers, Carlos.

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?

Quoted text here. Click to load it


The lease looks like it's a 24-hour lease from this output.
Do you concur?

Here is a snippet of the ipconfig /all on Windows:

Ethernet adapter Local Area Connection:
 Connection-specific DNS Suffix  . :
 Description . . . . . . . . . . . : Broadcom 440x 10/100 Integrated Controller
  Physical Address. . . . . . . . . : 00-14-22-F3-AA-D1
  Dhcp Enabled. . . . . . . . . . . : Yes
  Autoconfiguration Enabled . . . . : Yes
  IP Address. . . . . . . . . . . . : 192.168.1.235
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Default Gateway . . . . . . . . . : 192.168.1.1
  DHCP Server . . . . . . . . . . . : 192.168.1.1
  DNS Servers . . . . . . . . . . . : 192.168.1.1
  Lease Obtained. . . . . . . . . . : Thursday, April 13, 2017 2:12:54 AM
  Lease Expires . . . . . . . . . . : Friday, April 14, 2017 2:12:44 AM

Quoted text here. Click to load it

Based on the advice from this thread, I will probably set up the router
to hand out addresses outside the range of what the phones are set up as.

It has been working so well without that, that I haven't had the need
to do that yet.

Quoted text here. Click to load it

Linux is pretty good nowadays with setup. I just set up a printer, and  
it went surprisingly easily (much much much easier than it was to set
up that same printer on Windows 10 since Windows 10 doesn't seem to  
natively support my older HP Laserjet 2100 so I had to run a temporary
Windows 10 update (which gets blown away the moment you leave the  
setup screen!) so it took me a few tries to get it into my head that
Windows 10 makes it absolutely miserable if you don't know the exact
secret sequence to update an older printer driver).

By way of contrast, on Ubuntu, the printer was working before I  
even knew it (much like this Android static IP setup was).

Sometimes Android and Linux are just too easy!

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
On Tue, 11 Apr 2017 22:10:39 -0000 (UTC), Tomos Davies wrote:

Quoted text here. Click to load it

Each of the very few routers I've ever used has its 192.168.a.* address
range split into two halves: a lower range ( * running roughly 1-100) which
are treated as *fixed* addresses, *not* dynamically assignable; and an
upper range ( * roughly 101-253), dynamically assignable addresses. Here
the value "a" is either 0 or 1, depending on the router model/maker, and is
not variable.

It is *I* who can assign static addresses, from among the addresses in the
lower range; and it is the router who assigns the dynamic addresses, from
among the addresses in the upper range.

Addresses 192.168.a.254 and 192.168.a.255 are *not* assignable, not by me,
not by the router, as they play a fixed role already, as does 192.168.a.0 .

HTH, Stijn. Cheers, -- tlvp
--  
Avant de repondre, jeter la poubelle, SVP.

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?

Quoted text here. Click to load it

maybe by default it's that way, but you can change the dhcp range to
start/stop at whatever you want as well as the ip block.  

Quoted text here. Click to load it

you can assign static addresses to whatever you want, inside or outside
of any range in the router.  

Quoted text here. Click to load it

254 is.

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
Quoted text here. Click to load it

254 is often the default router IP, they're usually either 192.168.1.1
or (less often) 192.168.1.254 if using the 192.168.1 block.

--  
Chris Green


Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
wrote:

Quoted text here. Click to load it

depends on the router. it's easily changed to anything you want and it
doesn't need to be 192.168/16 either.

<http://www.downloads.netgear.com/files/answer_media/images/1524_image00
5.png>
<http://foxnetlab.com/images/images/2016/asus_rt-ac51u/web/asus_rt-ac51u
_web_eng_25.png>

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
On 04/12/2017 06:22 AM, nospam wrote:

[snip]

Quoted text here. Click to load it

The usual subnet for home routers is 192.168.y.0/24 , where 'y' is  
different for different routers, but has to be the same for all  
networked devices.

[snip]

--  
Mark Lloyd
http://notstupid.us/

"Is man one of God's blunders, or is God one of man's blunders?"
[Nietzsche]

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
wrote:

Quoted text here. Click to load it

there is no usual.  

0 and 1 are very common, but it's not unusual to see 2, 16 or even
10.*.*.* for defaults. i have all of those here.

Quoted text here. Click to load it

depends on the host mask and network configuration.

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
Quoted text here. Click to load it
I didn't say it wasn't easy to change, just that it is sometimes the
default router address.  It can make things (a bit) difficult
sometimes if you change the router's address because if/when you have
to do a reset everything goes awry.

--  
Chris Green


Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
On 04/12/2017 07:30 AM, Chris Green wrote:

[snip]

Quoted text here. Click to load it

There's usually no benefit to changing it, although I have when using 2  
or more routers in series (where each needs to be using a different  
network). Also, you might if you need to replace a router on an existing  
network, and the new router uses a different 3rd octet (the 'y' in  
192.168.y.x/24).

--  
Mark Lloyd
http://notstupid.us/

"Is man one of God's blunders, or is God one of man's blunders?"
[Nietzsche]

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
On 04/11/2017 10:45 PM, tlvp wrote:

[snip]

Quoted text here. Click to load it

'a' can be any number 0-255. The only one >1 I'm sure I've seen is 15.

On my router, 'a' is 1, the router's address is 192.168.1.1 and the DHCP  
pool is 100-149. Addresses 2-99 and 150-254 are available. This is  
changeable, although I haven't had a need to.

Quoted text here. Click to load it

IIRC, I've used 192.168.a.254 and it worked fine. Maybe your router  
itself is set to that.

Quoted text here. Click to load it


--  
Mark Lloyd
http://notstupid.us/

"If the Bible is telling the truth, then God is either untruthful or
incompetent. If God is truthful, then the Bible is either untruthful or
erroneous." [Rev. Donald Morgan, Atheologian]

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
On 2017-04-12 06:43, Mark Lloyd wrote:
Quoted text here. Click to load it



It is 192.168.a.255 which is not usable, as it is the broadcast address.

--  
Cheers, Carlos.

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
On 2017-04-12 00:10, Tomos Davies wrote:
Quoted text here. Click to load it

It doesn't.

There are three possibilities, though.

 a)  You accidentally assigned your phone an IP outside of the range
your router uses for DHCP addresses. Ie, the range dedicated to manually
given fixed addresses.

 b)  You accidentally assigned your phone the same IP as the router had
given it by DHCP.

 c)  You happen to have a router that before assigning an IP, first
pings that IP to see if it responds, then automatically removes that IP
from the pool of addresses it can give.



You should make sure that 'a' is true.


--  
Cheers, Carlos.

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
On Wed, 12 Apr 2017 02:54:24 +0200, "Carlos E.R."

Quoted text here. Click to load it
D) you dont have enough devices for the router to get around to trying
to hand out the one you have used.....

FWIW most home routers seem pretty brain dead for the optional
subtleties in the DHCP server standards - several types i have used
will merrily hand out the same IP address that is in use by a device
after a reboot.

Quoted text here. Click to load it
Stephen Hope stephen_hope@xyzworld.com
Replace xyz with ntl to reply

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
Stephen wrote:
Quoted text here. Click to load it

Do you mean it'll hand out a previously-assigned address to a different
computer, or that it hands out the same IP address to a the same device
after the router is rebooted?

If the former, yeah, that's a problem due to the leases file being wiped
out.  More an artifact of non-persistent storage than anything -
typically, I've only seen this kind of behavior in cheap SOHO routers
though.

If the latter, that's how DHCP is supposed to work.  Both sides keep a
record of how long the lease lasts for.  The DHCP server's record
includes the client's MAC address; and as long as the client requests
the IP be refreshed before the expiration date/time, the client will
receive the same IP address.

Typically the client refreshes the IP at the lease half-life (for
example, every 12 hours on a 24-hour DHCP Lease).

--  
|_|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

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?
On 2017-04-12 22:21, Stephen wrote:
Quoted text here. Click to load it





Yes, indeed. I have not seen any home router doing that check. They may
exist, though.

--  
Cheers, Carlos.

Re: How does setting a static IP on a mobile device prevent linux router from assigning that IP address?

Quoted text here. Click to load it

they do exist and it's not that rare.

Site Timeline