NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
SLK-Purdue
Mar 22, 2020Luminary
Attached Devices Sorted by IP Number
I have a good number of devices on my home network. I manage then with static DHCP reservations and I wanted to be able to get an Attached Device display in the web ui sorted by IP number. The at...
randomousity
Apr 02, 2020Luminary
Rather than running code to sort on the router, there's another way. Basically, find the entries you want to manipulate, copy/paste them into a text editor, manipulate them as desired (change device names, reserved IPs, reservation IDs, manufacturer details, display icons), convert the entries into commands, then paste back into the CLI, commit, and you're done. Save the text file for future use, either for backup/restore, or to add additional devices later. You're basically creating a batch file/shell script file, and then copy/pasting the contents instead of executing it. It may be possible to upload and execute the shell script file over telnet, but I don't know.
Telnet in, have it show you the DHCP reservations. I believe it's something like:
config show | grep reservation
You're get a few extraneous lines, but then you'll see all your reservations, in the form:
reservation[ID number]=[reserved IP] [MAC] [device name]
sorted by ID. Copy/paste the whole list of reservations into a text editor, preferably one with a find/replace or multi-line editing function. You'll need to edit it by adding "config set" to the beginning of each line, and putting everything after the equals sign within double quotes, so it ends up like:
config set reservation[ID number]="[reserved IP] [MAC] [device display name]"
One per line, for all the reserved devices. They will display in reservation ID number order in the GUI. Organize your list however you like. I'm unsure if the text list needs to be ordered by reservation ID number in order to display properly in the GUI, but it's certainly easier for you if you do it thay way, to make sure they're in the order you want, and there aren't any skipped or duplicate reservation IDs. Rearrange manually, or, if you're clever, run it through a script and have it sort however you like. Once it's done, save for future use. Then, telnet back to the CLI prompt, and just copy/paste the entire file contents into the CLI, and hit enter. Commit the changes, and you're done.
Relatedly, a similar process can be used for naming devices, including to use characters it rejects in the GUI, such as apostrophe for possessives (e.g., "Bob's laptop" instead of "Bob laptop" or "Bobs laptop"), and setting the device details (if you care to change from defaults) (all of which you'll see in the "attached devices" screen under the "device name" column).
Device names display in the CLI in the form:
orbi_dev_name[ID number]=[MAC] [device name]
And device details (manufacturer & icon) in the form:
orbi_dev_name_ntgr[ID number]=[MAC] [icon ID] [device manufacturer]
config show, grep as appropriate, copy/paste into a text editor, change device ID numbers, names, manufacturers, IPs, icon IDs (I don't know which icon ID corresponds to which icon), convert configuration output lines into commands (add "config set" before each line, and put everything after the equals sign within double quotes), paste back into CLI, enter, commit, done. Optional (though recommended) backup of the finished text file for future use to restore after a factory reset, if the included backup/restore breaks after a firmware update, or if you want to insert new devices into the middle of the list.
And really, instead of saving a binary backup, which isn't human readable, and which may not work across firmware versions, any configuration setting you can figure out how to set from the CLI can be saved in a text file and copy/pasted into the CLI. You could do router name, DNS settings, password, network and subnet info, saved routes, etc. You can even just save the entire output from "config show" if you really want, though you'd have to edit it all into a series of valid commands, and some of the settings may not be ones you'd actually want to carry forward anyway. There's probably some way to actually save the commands as a shell script file, and to upload and run it over telnet from the CLI, but I don't know how to do that. There may also be a way to get the output in a form where you can paste it back in directly, without having to change each line into a command (adding "config set" and putting values within double quotes), but I don't know how to do that, either.
NB: ID numbers for the DHCP reservations, device names, and device details don't necessarily match. They're each separate ordered lists, with consecutive IDs, so each list can be a different length, and the same device can have a different ID in each list it appears in, and devices can have entries in one list but not another. Entries for a given device are matched by MAC, not ID. I don't know what happens if you skip ID numbers to try to force them to match across lists, but since it doesn't matter, I wouldn't mess with it.
- CrimpOnApr 02, 2020Guru - Experienced User
This is an interesting procedure. I have done that in the past, carefully assigning reservations in IP order, but my experience was that "Attached Devices" did not appear in "reservation order", but in some random sequence. I think the whole point of this latest web page revision is that the user can choose on the spur of the moment, "Show me these in MAC order." This is what Nighthawk routers have done forever.
- randomousityApr 02, 2020Luminary
Yeah, but it's a PITA to do manually from the GUI. You have to delete everything, and then re-add them all in the proper order. If you skip one, or get a new device later, you have to repeat the process. It's much simpler to just extract the data, order it how you want, and then upload it again, and now it's in your preferred order. This makes it super easy to fix on the backend, and to reapply if it ever gets assorted. Plus, you're not running any code on the router, so there's little risk of cauing any problems this way. Plus, it's useful for more than just sorting by IP address. And it works across firmware updates.
- SLK-PurdueApr 02, 2020Luminary
Alternate ideas are always interesting to consider.
Just to clarify, the sort is not done on the router. Your browser makes a request for current device information table. That is a low priority request but still runs quickly. Once that info is returned to the browser, the sort and prep are done on your local machine.