Answered

Setting static IP addresses


Userlevel 5
Badge +9

[To avoid any confusion: this is about static IP addresses, not reserved IP addresses!]

Is it possible to set/unset static IP addresses within Sonos devices?

The reason I ask is that I have just been checking in my router to see what internal IP addresses are currently in use, and I find that one of my Sonos devices out of a total of eleven has an IP address which is not within my DHCP range. It’s actually permanently on an IP address that I have (for many years) had statically assigned to another device.

What I would like to do is to stop it from using that IP address, and get it to request an IP address via DHCP - in my assigned DHCP range - like the other ten devices do.

Note that this device is one of four in my system that are connected via Ethernet to my network.

[As above, this is the distinction between static and reserved IP addresses: To set a reserved IP address, you configure your router’s DHCP server to recognise a device’s MAC address and always give it a specific IP address within the DHCP range. To set a static IP address you configure the device itself to always use the same IP address which is outside the DHCP range that the router allocates. It means that the device never uses DHCP to get an IP address.]

icon

Best answer by Ken_Griffiths 11 April 2024, 14:25

View original

43 replies

There isn’t a way for a user to set a static IP address within the Sonos hardware/software. Note some (not all) routers can set a reserved IP address, both within and outside the address range that a user has set for use by the DHCP server.. my suggestion is to check your routers configuration pages and change the assigned address accordingly - even consider a factory reset of the router if you think there maybe a fault (but that’s entirely at your own risk).

Userlevel 5
Badge +9

Thanks - it’s not possible to “unassign” a statically set IP address from within the router, because the router has no control over that address. It appears in the router’s Device table only because it sees traffic to and from the device, and not because it has any control over the address.

But, having said that, you jogged my memory that I had changed that device from being wi-fi connected to being Ethernet connected and had not rebooted the router since - so although everything was working OK, the router’s internal device table seemed to be corrupted.

Having rebooted the router, I now have 11 devices in my router’s DHCP table, which means I can finish the task of adding all of their addresses as “reserved” - by adding the last one of the eleven. Hopefully that will contribute to the network’s long-term stability (which to date has not been great).

Thanks again - a solution without needing to factory reset the router!

Userlevel 7
Badge +22

It is usually best to set the Sonos IPs outside the DHCP address window as if set inside it some other device could beat Sonos to the desired IP address and then the Sonos would get a random address.

Userlevel 5
Badge +9

That may be possible on some routers, but not mine! The only way you can “reserve” an IP address for a given Sonos MAC address is via an option in the DHCP table. Obviously it can only get into the DHCP table if it’s using DHCP, and then it must have an IP address within the DHCP range!

But once it’s in the DHCP table it (in effect) gets an infinitely long lease for its IP address, so nothing else can beat the device to its allocated address.

Userlevel 7
Badge +22

Typical of a poorly designed router.

You are wrong on the “nothing can beat it” statement. Maybe nothing will usually beat it as long as there are no IPs assigned (directly not DHCP) in other devices that conflict and that the Sonos device is always active often enough to keep the lease renewed.

The lease is not infinitely long, the router sets that, it can be 135 years if the router supports that so your point is close enough there.

From my router’s manual:

https://docs.netgate.com/pfsense/en/latest/services/dhcp/ipv4.html

This IP address is a preference, not a reservation. Assigning an IP address here will not prevent another host from using the same IP address. If the IP address is in use when this client requests a lease, the server will instead assign the client an address from the general pool. For this reason, the GUI does not allow assigning static IP mappings inside of the DHCP pool.

Userlevel 5
Badge +9

I suspect it’s typical of a router where they design the UI to reduce the chances of the owner doing something stupid. And, given that they are meant to be used by anyone in the general population, that’s probably a wise choice.  It would be nice if they had both an “advanced” settings page and a “properly advanced” settings page, but that would cost more, so they are not likely to do that.

As far as I can see, my router’s documentation does not describe in detail how “reserved” IP addresses are assigned, so it may keep a list of “reserved” IP addresses forever, or it might do something else!

And there is, I think, in a nutshell, the very problem. Each router handles this issue slightly differently, which makes it somewhat challenging to write a definitive ‘do it this way’ article.

I’ve recently been struggling with both a StarLink device, and a T-Mobile 5G device, neither of which even provide the opportunity for access to the DHCP table in order to allow reserved IP addresses. I suspect they think they know better than the average consumer. And they may, but it’s frustrating for those of us who are (slightly) non average. 

I have recently and finally moved from my Apple router of 2011 vintage to one supplied by the broadband service provider consequent to moving from copper wire to fibre for the last mile to the home. All my Sonos units are wired back to the core network so this change was glitch free as far as Sonos is concerned. As of now none of the Sonos units have a reserved IP address as they did in the Apple router and all seems to be fine for a couple of weeks now, so I will hold off dabbling with reservations till/if Sonos units run into trouble. 

I remember @Corry P recently questioning the need for such reservations for Sonos….

Userlevel 7
Badge +22

I’d question the need too but there are enough posts here to convince me it is a viable first step to network troubleshooting. Takes a few minutes to do on your own and no playing phone tag with support.

With my old all-in-one router I was not seeing issues, updated to a much better router and dedicated WiFi APs and was seeing issues until I set them.

It may certainly be that there are newer devices that are less susceptible to this. I’ve not seen any issue on either the StarLink nor the T-Mobile routers…but I have an objection to them thinking they need to keep this practice away from me. But I’ve certainly seen it as an issue in the past, on other devices, or at the least, issues seemed to be resolved when I did the effort. 

I once used a router that bragged it would not assign duplicate IP addresses. Ha! Evidently it had a short memory. Fortunately, it also supported reservations.

Userlevel 7
Badge +22

I wouldn’t deny the possibility that this is an issue from the ancient Sonos / Linux codebase that has been solved by newer Linux releases but somehow not noticed/backported by the Sonos Linux folks.

All I am sure of is that for some folks, something is going wrong, for others all is fine.

A many hour session of digging in my router’s very complete system logs showed no issues.

I’d think what is going to be needed is for someone that has the IP issue to commit to multiple power-cycles of their Sonos devices while running a network packet monitor and then decoding/examining every packet. I’m not interested in giving my Sonos that power-cycle stress or in dedicating the multiple hours of log reading that would be needed to find or rule out any issues.

Userlevel 7
Badge +18

Hi @Kumar 

I remember @Corry P recently questioning the need for such reservations for Sonos….

Recently? It was 3 years ago! And, to be fair, I have since updated my Troubleshooting Sonos on WiFi article to include address reservation.

Having said that, I haven’t bothered/needed to do it on my own network, probably because I am not using a ISP-supplied router - it certainly seems to help some users, though.

No it wasn’t, not that it matters, but it was in the last 12 months. The troubleshooting article is three years old. 

I am hesitating to do this because the interface to the ISP supplied router is a lot clunkier than the Apple utility was, but one of these days I think I will get down to this. 

Userlevel 7
Badge +18

Hi @Kumar

My article was updated almost exactly one year ago. And, for the record, I do not question the need for IP reservation with Sonos - it’s a good idea. In fact, it’s a better idea for Sonos than it is for most other devices.

I’m not saying everyone should rush to it - but, if you see certain issues on a regular basis (and I’m thinking of rooms going missing from the app, in particular) it is a good idea to do so - there certainly aren’t any downsides if it is done correctly (the DHCP pool should be altered so as not to include any reserved IPs in it’s range).

I hope this helps.

What helped is a refresh via your troubleshooting article. My present worry is if I break something in the ISP router while trying to reserve IP addresses, starting with altering the pool to allow reserved addresses to be outside it, getting things back on track will be a headache, given the not so hot customer support from the ISP. 

Userlevel 7
Badge +18

Hi @Kumar

Yeah, I hear you - just how easy it is to reserve IPs depends heavily on the router’s software. I’ve have had issues doing so in the past, but mostly just due to a bad UI. Good UIs make it easy, whereas bad ones may require you to start copy and pasting MAC addresses.

Say, for example, your DHCP pool is 192.168.0.2 - 192.168.0.254. You’d want to change that to 192.168.0.20 - 192.168.0.254, assuming you have less than around 20 devices to reserve for. Reboot everything. Go back into IP reservation settings, and start reserving addresses in the 192.168.0.2 - 192.168.0.19 range. Save changes, and reboot everything again. That should be all you need to do. Again, if you have doubts, don’t try unless you are seeing recurring issues.

Please feel free to post screenshots of your IP reservation setting page, assuming it’s in English - I’ll be happy to look and advise from there.

I hope this helps.

, if you have doubts, don’t try unless you are seeing recurring issues

Please feel free to post screenshots of your IP reservation setting page, assuming it’s in English - I’ll be happy to look and advise from there.

I hope this helps.

Although I may hold off dabbling taking the first advice in the quoted above, I will still take the opportunity of taking the offered help, referencing screen shots below, from the ISP router UI:

 

 

 

In the first shot, as far as I can see I should just change the last digit of the start of the pool  from 2 to 50 if I want to reserve about 45 addresses. What I don’t see is a save button once I do that, so perhaps that isn't even needed for the change to take effect.

The third shot is of what pops up when Add is clicked in the second shot. There is a save button here, but what I don’t see is a place to name the unit that has the MAC address for which the IP address being reserved has to be entered. Presently, in the DHCP list, the router seems to get names like Sonos ZP, or WDMyCloud on its own. 

There seem to be no way to populate the address box except via cut/paste of the MAC addresses.

Userlevel 7
Badge +18

Hi @Kumar

In the first shot, as far as I can see I should just change the last digit of the start of the pool  from 2 to 50 if I want to reserve about 45 addresses. What I don’t see is a save button once I do that, so perhaps that isn't even needed for the change to take effect.

Yes - change the 2 to a 50. I would expect to see a save button, however - are you sure it’s not all the way down at the bottom? One way to find out would be to change it, then leave that page, then return to it - if it shows the updated value, all is good.

The third shot is of what pops up when Add is clicked in the second shot. There is a save button here, but what I don’t see is a place to name the unit that has the MAC address for which the IP address being reserved has to be entered. Presently, in the DHCP list, the router seems to get names like Sonos ZP, or WDMyCloud on its own. 

There seem to be no way to populate the address box except via cut/paste of the MAC addresses.

Yup - this is exactly what I was expecting to see from an ISP router. You will need to find the MAC address for each Sonos device and paste it into the form there. The router is not interested in what each device is called - it just goes by the MAC address and IP address. Better routers give you a list of devices and you just select one and enter the desired address, job done.

It’s strange, but it looks like you have to enter both the current IP and the new, desired IP, as well as the MAC. You’ll probably need to go to the Connected Devices/Clients list to get those. Note that the MAC address is the same as the serial number with the last character removed - this may help you identify devices, but you may also just want to use the data in the About My Sonos System page in the Sonos app instead.

Subnet mask should be left as prompted - 255.255.255.0/24

I recommend testing with one device first - if it goes well, do the rest (or some more and check again).

I hope this helps.

Edit: you may need to experiment with MAC formatting - sometimes hyphens are required between each pair of characters. I would like to think it would show you the expected format in the connected devices list.

 

It’s strange, but it looks like you have to enter both the current IP and the new, desired IP, as well as the MAC.

Thanks, that was very helpful. However why do you say the quoted? The first IP address in the box is 192.168.1.1 and is greyed out, so nothing to be done there, I presume.

What I see I have to do is enter the Mac address and the IP address I want to reserve for it in the box and then hit save. Before I disconnected the Apple router, I copy/pasted all the MAC addresses reserved there to an XL sheet, so doing a copy/paste again from XL should not be a big chore.

And yes, there is indeed the save button you refer to at the bottom of the page. Also, MAC address formatting uses all caps and colons as separators as was done in Apple. So just copy/paste should work, one IP reservation at a time.

Userlevel 7
Badge +18

Hi @Kumar 

It’s strange, but it looks like you have to enter both the current IP and the new, desired IP, as well as the MAC.

Thanks, that was very helpful. However why do you say the quoted? The first IP address in the box is 192.168.1.1 and is greyed out, so nothing to be done there, I presume.

192.168.0.1 is most likely the IP address of your router. I believe it’s in there just to show you the expected format. You don’t want to use 192.168.0.1.

Having said that, I see now that neither of the top two entries have a * next to them, which would suggest you don’t need to fill either in. Leaving as is (which is technically blank as the text there now is grey rather than black) is probably the thing to do.

Colons! I should have though of that!

I hope this helps.

So, a glitch after doing all this for all MAC addresses. Things are working but the IP reservations are being ignored, and for kit with reserved addresses outside the pool, the router is still handing out addresses starting with the beginning of the pool.

Is this then a router that needs reservations to be done from within the pool? If so, expanding the pool back to its original size may be all that is needed to be done?

 

Further to the above, I turned on Sonos units, all with IP addresses now assigned from outside the pool, after first seeing how things are minus Sonos.

Some Sonos units have been correctly given the assigned addresses from outside the pool, others have been given those from within the pool, although their MAC is shown in the list of reservations outside the pool, in the router UI.

As far as I can see, what is happening for Sonos kit is randomly different divided into the two cases above.

In the little testing done, all Sonos kit is working fine.

Userlevel 7
Badge +18

Hi @Kumar

So, a glitch after doing all this for all MAC addresses. Things are working but the IP reservations are being ignored, and for kit with reserved addresses outside the pool, the router is still handing out addresses starting with the beginning of the pool.

Is this then a router that needs reservations to be done from within the pool? If so, expanding the pool back to its original size may be all that is needed to be done?

I suppose that could be possible, but I wouldn’t have thought so - it’s not the way my router works, if that helps?

Did you reboot every device after changing the pool? You may want to turn the router and all client devices off, then turn the router on, wait for it to boot, then start turning on all the other devices.

Further to the above, I turned on Sonos units, all with IP addresses now assigned from outside the pool, after first seeing how things are minus Sonos.

Some Sonos units have been correctly given the assigned addresses from outside the pool, others have been given those from within the pool, although their MAC is shown in the list of reservations outside the pool, in the router UI.

As far as I can see, what is happening for Sonos kit is randomly different divided into the two cases above.

In the little testing done, all Sonos kit is working fine.

At this point I would either a) contact the provider of the router to find out how it should work, or b) just buy a third-party router that does what it’s told to do and replace the current one. Though, depending on your connection type, you may need to turn your current router towards modem duties only instead.

Hopefully rebooting everything will help (though given that some Sonos devices are taking the reserved addresses and some are not, it seems questionable).

I’m glad to hear it’s all still working!

 

Reply