The ability to use a router as a hub is probably common knowledge in some circles, but Google yielded surprisingly little useful information on the topic. So here’s my weekly contribution to the geek knowledge base…
Your average home computer user will eventually find themselves using a router to take better advantage of their broadband connection. These little black boxes add tremendous value compared to their measly -0 price tag. On of the key features is switching – i.e. the ability to support multiple computers on the same connection. Most of these boxes have 4 ports to plug stuff into, which often leads to a problem: What do you do once you’ve plugged in your PVR, desktop computer, network printer, and docking station for the laptop?
There are a couple obvious solutions – you can buy another router with more ports, or you can buy a dedicated switch. But such devices can be a bit pricey, and if you’re like me, you already have an extra router sitting around. So, why not use that and avoid the guilt-trip involved in chucking a perfectly good networking box in the landfill! Here’s how…
The First Router
One of the nice things about this approach is that you get to leave your existing router alone. It’s probably configured more or less as follows, which’ll work fine for what we want:
WAN IP: dynamically assigned
WAN Subnet Mask: 255.255.255.0
LAN IP: 192.168.1.1
The 2nd Router
Adding the 2nd router to the network is where things can get confusing. The most common mistake is to set up the 2nd router just like the first, and plug it into one of the LAN ports of the first router. If this works at all (and often it will to a degree) the results are less than desireable. What you’ve actually done here is create a 2nd sub-network, rather than extending the first. Devices on the 2nd network may have access to the internet, but they’ll be walled off from the first network. You’ll be able to browse the web on that new computer you just plugged in, but you won’t be able to share a printer with your first computer, or share files. This is inconvenient and unnecessary.
Instead, the better solution is to dumb down your 2nd router to just it’s essential switch capabilities.
Start by connecting the 2nd router’s “Uplink” port to one of the LAN ports on the first router. (The location of the uplink port varies by manufacturer, and may place restrictions on whether or not you can use the port next to it, so be sure to refer to the manual.) With that done, configure the 2nd router as follows:
WAN Settings (IP, Subnet Mask, DNS Servers, etc.): n/a
LAN IP: Statically assign to an IP on your first router’s LAN. E.g. if your first router’s LAN is 192.168.1.*, give the 2nd router an IP of 192.168.1.123 (making sure you use an address outside the range reserved for DHCP clients on the first router).
The most important thing here is to disable DHCP – having more than one DHCP server on a network is just never a good thing. Similarly, if both routers are wi-fi enabled, you’ll should disable the wi-fi feature on the second router to keep the two wireless networks from interferring.
Assigning a static LAN IP let’s you access the 2nd router if you need to administer it (not that there’s much left to administer). It also means that if it has print server support, you can access the printer connected to it.
Finally, all the WAN Settings are moot here since there shouldn’t be anything plugged into the WAN port.
That’s pretty much it. Good luck, and if this was useful, feel free to drop a comment.
7/27/07 update: While the above setup worked fine for me, I ran out of ports again. My long(ish) term solution is to install a 16-port switch from SMC. At ~$40 it’s easy on the pocket book, and this particular box is also compact and, more importantly, fanless, so it doesn’t add to the noise in the office – an important consideration since it’s installed about two feet from where I work. It’s only minor drawback is that it’s not a gigabit switch – it won’t maximize the throughput of newer computers with gigabit network cards. But this has little practical impact for me, and shaves ~$150 off the cost.
Oh… and my old hub? I’ll be donating that to a friend of mine who’s signing up for cable broadband.
8/20/07 update: Minor edits to reflect the fact that most of these devices are switches not hubs, as pointed out by Harry, below. (See Hubs, Switches, Routers – A Hands On How To for more info). I also removed the suggestion that the 2nd router might be usable as a wireless relay point. This just isn’t in the scope of this article, and in all likelihood isn’t possible with most routers.)