Linksys SRW224G4 WebGUI is Broken

Last week I bought a Linksys SRW224G4 switch for my rack. It seemed like a nice piece of kit, and I got it for a good price.

The first part of the setup went well enough, using the telnet interface. As I wanted to get my head around all the options the switch offered, I thought I would try WebView (aka the webgui). The image below shows what I got with Firefox, on Konqueror is worse.

screenshot of broken Linksys SRW224G4 WebGUI

The Linksys helpdesk wasn't very helpful. Most calls weren't returned when promised and the scripts didn't seem to deal with this issue. In the end I was told to use Internet Explorer. I knew it worked with IE6 running under WINE, but that isn't the point. This is a modern piece of network infrastructure - it should work on any browser, especially one which has almost 30% market share in Oceania.

For the last 5 years or so I have used a fair bit of Linksys kit, as I find they build high quality network equipment. Another big plus for Linksys in my book has been their support for FOSS and hacking - especially the WRT54GL and NSLU2. Now I am not so sure.

Instead of just waiting for the ticket to make its way through the internal bureaucracy of Linksys so that eventually a developer investigates the bug, I thought I would lay it all out here for them. So here we go.

The error in the error console is:

Error: tbl.firstChild.firstChild has no properties
Source File: http://192.168.XXX.YYY/js/tabs.js
Line: 24

The code is question is as follows (line 24 is in highlighted:

[...] function setTabset(ths) { [...] var tbl = ths.parentNode.parentNode.parentNode.parentNode; subLinks = document.getElementsByName("lnk"); for (var i = 0; i < subLinks.length; i++) { if (subLinks[i] == ths) { if (subLinks[i].innerHTML == "LogOut") { var msg = "Are you sure you want to Log Off?"; if (!confirm(msg)) { return; } } curTd = tbl.firstChild.firstChild.childNodes[tab].style; [...]

The argument passed to the function above is a HTML element with an id attribute of 'tab_0'. This element exists, it is the "Setup" tab in the screenshot above. Lets walk through the relevant bits of the code.

var tbl = ths.parentNode.parentNode.parentNode.parentNode;

This steps 4 levels up the DOM tree, from the tab_0 element (the whole webgui is rendered using tables). This works fine. Now tbl references a table element with an id of 'Table2'.

Now we skip down to the line which has the error.

curTd = tbl.firstChild.firstChild.childNodes[tab].style;

This attempts to step down 3 levels from the top of the table to one of the tabs and retrieve the style object for that element. Here are the steps

  • tbl - the table itself
  • tbl.firstChild - the first child node of the table - a text node
  • tbl.firstChild.firstChild - a non existent node as the parent is a text node with no children

Why does this work on IE, but not Firefox/Konqueror and other FOSS browsers? I haven't checked for konq, but I know that the gecko engine (used by Firefox, SeaMonkey, IceWeasel etc etc), the DOM parses is whitespace sensitive. Every bit of text (whitespace or otherwise) is considered to be a text node. This is W3C compliant, there is even a bug report for it - see bug #26179 on mozilla's bugzilla.

This is pretty easy to fix, I haven't tested the code below for this case, but something like it usually works.

/* * Find the first child which is a html element */ function findFirstChild(elm) { if ( !elm.childNodes.length ) { return; } var children = elm.childNodes.length; for ( var i = 0; i <= children; ++i ) { if ( elm.childNodes[i].nodeType == 1 ) { return elm.childNodes[i]; } } return; } [...] function setTabset(ths) { [...] curTd = findFirstChild(findFirstChild(tbl)).childNodes[tab].style; [...]

I hope that Linksys sets their QA team on the SRW224G4 firmware with firefox to find the other bugs like this one. Unless Linksys fixes there gecko based browser support rather promptly, I won't be recommending (or using) their products in future.

Special thanks to the Firebug and DOM Inspector extensions which made this so much easier to trace.

Linksys will be emailed a link to this post and my ticket number. I will keep people posted on how things progress.

There's IOS under the hood (well, something IOS-ish, at least)!

Marc wrote:

I was grumbling over Linksys non-support of non-IE browsers as well, and casually surfing Google's search result for various search terms from this context, an then I stumbled over this thread in Linksys' own user forums:

In case that post should ever be removed, here's the essentials of that post: - Telnet to the switch & login - Once you get to the menu, hit ctrl+z, you should now see a ">" (type ? to all available commands from this point on) - Type lcli, hit enter, and put the user name in again (admin usually) - now you should see "console#"

Now what! I telnetted to both of my SRW2008 (FW 1.04) instantly, logged in, and "conf", -completion of command words, show commands - it all seems to be there, or at least close enough to find your way around. I'm still exploring "how deep the rabbit-hole goes".



Added Sun, 2008-03-02 10:09

Marc, you da man

Seth wrote:

Marc, *thank you* for posting this. I purchased a SRW2008P a few months back with the understanding that it would be fully administerable from the command line.

Lo and behold I quickly discovered that the console interface allowed only limited administrative access, and to get full functionality, I would have to use the web interface.

I was only further infuriated when I determined through tedious trial and error that IE was the only supported browser...ack!

I hope to try this hack out tonight and report back.

Added Tue, 2008-03-04 04:22

Can you try and make a

QpoX wrote:

Can you try and make a greasemonkey script, so all can have a fix for Linksys's hell problem.

Mark: THANKS!!! for the hack!

Added Fri, 2008-03-28 12:44

SRW2016; same issues

Vijay wrote:

I just received an SRW2016 and couldn't login to the web interface (firefox). How dumb can these product managers get? I really can't understand how someone can claim to target business users while they supply a switch with consumer characteristics.

I speak to Linksys people every year at Cebit. They're keen on targetting business users, but just how stupid can one get to coerce the application of choice at layer 7 for a layer 2 piece of equipment?

Managing about active 16000 ports, I thought I'd try a couple of Linksys switching products, but it'll take a couple of years before I even start to consider purchasing them again.

But what a pleasent surprise this cli interface is. Now if Linksys would have pointed this out, I may not have been so mad. Instead, Linksys states: "Please wait for a firmware update to allow firefox access".

Targetting business users, selling them a product and then asking the users to wait for an update to effectively use the product (VLAN & Trunking) is asking for civil lawsuits.

Linksys is grossly misrepresnting their products capabilities while misleading their prospective customers. Nice to have the CLI (bust out the 'expect' shell) but I'm back to 3COM.

BTW: I also purchased SLM2008, SLM2005, SD2008 and SD2005. The SD's are obviously unmanaged while the SLM's are managed. However, the SLM's have no command line type of interface (only http) and it doesn't seem you can drop to a shell. On the other hand, the SLM's web interface work fine with Firefox. Moreover, the SLM's Port section allows for Jumbo frames while the SRW2016 (firmware 1.2.2) doesn't include the Jumbo frame option (at least not in the Port section of the HTTP interface). Funnily enough, the Jumbo frame option does become available in the SRW2016's CLI interface !?

I've got a couple of issues to discuss with these people during the next Cebit.

Added Mon, 2008-05-19 03:25

SLM junk

Vijay wrote:

Well, following my gripes with the SRW switches, I now have a broken SLM2008. All part of the same shipment. It seems to have lasted less than 2 weeks.

The power LED is burning, but none of the switch LEDs are burning. Power cycle or reset does nothing. The connected computers have no link, thus no network, thus this is junk.

That leaves me with another SLM2008, an SLM2005 and a couple of SD2005's and SD2008's. I wonder how long these will last?

BTW: Linksys support replied to my issues with the SRW2016. "Just use Internet Explorer" was their bright solution. "Where can I download that for Linux?", I replied. "Just use Opera for Linux", they replied.

This coercion of browser choice doesn't do me any good. I would have to ensure that all clients connecting with the SRW have Opera installed. There's nothing stopping Linksys from generating cross-browser HTML, Javascript and what not.

Strange that they screw themselves for not mentioning the CLI.

In the end, for a company that heavily uses Linux (opensource) on a whole bunch of their products, the fact that Firefox doesn't work with their switch interface is indicative of a disjointed organization. Either they did it intentionally in which case I would avoid Linksys (switching equipment) at all cost, or they just didn't test their interfaces with Firefox in which case I would avoid Linksys (switching equipment) at all cost.

Guess what? From now on, I'm avoiding Linksys switching equipment at all cost.

Added Fri, 2008-05-30 03:27

SOLUTION: Web View with Firefox and Possibly Other Browsers

jffc wrote:

Inspired by your comment, I took a stab at the problem, and posted a solution below:

You may want to try it out if you can't live without browsers/platform other than those of M$' :-)

Added Tue, 2008-06-03 04:43

RE: SOLUTION: Web View with Firefox and Possibly Other Browsers

Dave wrote:

The real solution is to get Linksys to fix their broken kit. When I contacted them last month there is still no ETA on a fixed version of the firmware. This is very disappointing. Combine this with the changes made to the WRT600N to prevent the use of 3rd party firmware, it seems that Linksys is becoming less FOSS friendly.

Added Tue, 2008-06-03 09:14

Procedure for IE6 and IE7

Aday wrote:

Procedure for IE6 and IE7 1. Start Registry Editor. 2. Locate the following key in the registry: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings 3. On the Edit menu, point to New, click DWORD Value, and then add the following registry values: Value name: MaxConnectionsPer1_0Server Value data: 1 Base: Decimal Value Name: MaxConnectionsPerServer Value data: 1 Base: Decimal 4. Exit Registry Editor.

Procedure for Internet Explorer 8 The maximum number of connection per server should be limited to 1 The only problem is that MSIE 8 stores that setting on a different location compared to MSIE 7 and older versions. According to this MS article: You have to follow procedure with version 8: ============================================================= 1. Start Registry Editor. 2. Locate the following key in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InternetExplorer\MAIN\FeatureControl\FEATURE_MAXCONNECTIONSPERSERVER 3. On the Edit menu, point to New, click DWORD Value, and then add the following registry values: Value name: iexplore.exe Value data: 1 Base: Decimal 4. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InternetExplorer\MAIN\FeatureControl\FEATURE_MAXCONNECTIONSPER1_0SERVER 5. On the Edit menu, point to New, click DWORD Value, and then add the following registry values: Value name: iexplore.exe Value data: 1 Base: Decimal

Added Tue, 2010-02-09 05:45

Solved (workaround)

peter wrote:


I agree with others, but for a long time i had the same problem until I decided the easiest way to solve it. Each of us uses a browser other than IE and as you know, the FF, Opera are also not working.

The solution is to download the Maxthon browser based on IE and I'm sure the web management will work.


Added Sun, 2010-09-12 12:42

RE: Solved (workaround)

Dave wrote:

Using IE on Windows or under WINE on Linux has the same result, without needing a download.

The point is that Linksys shouldn't be shipping such broken firmware. Despite their promised to the contrary, Linksys never shipped a fix for this issue.

Added Sat, 2010-09-25 10:19

Using firmware you'll

MiGus wrote:

Using firmware you'll got the same result as shown at the top of the article, in all browsers, IE also. I have no idea, how guys from Cisco could configure switches with this latest firmware.

Added Mon, 2010-10-04 22:14

Firmware Issues

Michael10 wrote:

I've got the same issue as MiGus, the 1.2.1b firmware works but the console menu is horrid but the update breaks the web interface. Has anyone confirmed if the IE reg hacks above resolve the issues?

Added Mon, 2010-11-22 17:35

status: working on IE-8, Win 7 x64 without MS XML

pedro wrote:

Update 2011.01.10 - Internet Explorer 8 for Windows 7?

After the last games with the MS XML package in Windows 7 x64, quite by chance I ran the browser from "Redmond" on Windows 7 x64, and to my surprise, everything works as didn't expected. Can anyone confirm this yet?


Added Thu, 2011-01-13 07:21

RE: status: working on IE-8, Win 7 x64 without MS XML

Dave wrote:

The problem is that the SRW2xx switches only work with IE because the Javascript was written to only with with Microsoft's proprietary implementation, rather than the standards. My SRW224G4 is currently gathering dust. After over 3 years Linksys hasn't released a fix for this problem, despite their promises to do so.

Added Mon, 2011-01-17 13:36


Anonymous wrote:

Well, this comment is not for a Linksys rack, so in that sense my comment is off topic.

Nevertheless, the web GUI for my BEFSR81 quit working all of a sudden and now I cannot even log in to the router to boot or upgrade the firmware or reset my DSL password to get the modem going again -- that stopped working all of a suddent, too. So in that case, there is a semblance of being on topic with my comment after all here.

Just wanted to thank Linkys since my BEFSR81 is now destined for the electronic scrap heap and the most important management screen is AWOL. And my BEFSR81 is not that old of a product, either. Less than 2 years.

As for my other Linksys router that preceded this one, that pile of scrap began steaming with failure long ago. I think I am beginning to see a pattern here with Linksys products. Garbage.

At least from my reference vantage based on a storied experience of managing my own network.

Added Wed, 2011-02-09 14:43

MaxConnections - this is the least of the problems

Jimbo wrote:

The LinkSys SRW switches are quite simply junk. Yes the management interface needs max-connections limited, but the spanning tree implementation is also broken.

Set on up with a couple of VLANs and a single RSTP instance, and trunk to another switch with two GbE uplinks. The LinkSys has a good chance to be root because of the vendor ID. After 14 days and 8 hours the BPDUs will cease, the blocked port will open and... you get the picture.

Better yet, if Avaya 1608 handsets are connected with firmware 1.3, this condition will permanently corrupt those handsets after a period of time.

As an aside, the STP path cost values are also different on the SRW compared to everything else.

Trunk parts also won't ever tag VLAN 1.

The 48-port derivative (SRW248G4P) has all the same problems.

Cheap but cheap for a reason. The new version, Cisco's SF 300-24P, doesn't seem to have any of these problems thankfully.

Added Fri, 2011-10-14 20:25