Sunday, August 19, 2007

Two router setups

If you have two routers there are several ways how to hook them up and configure them. You have basically three options. All three concern the configuration of the second "internal" router. They all require a wired connection between the two routers. (A wireless link between the two routers is not covered here as many routers do not support this.) The first router is the one which connects to the internet.
  1. Configure the second router in gateway/NAT mode and connect the internet/WAN port of the router to a LAN port of the first router. In this case it is important to use a different subnet on the second router then the first router. If the first router uses addresses 192.168.1.* with subnet mask 255.255.255.0 the second router must be outside of this subnet, e.g. it could be 192.168.2.1 with subnet mask 255.255.255.0. Make sure to enable the DHCP server on the second router unless you only want to use static IP addresses in your LAN. If you need port forwarding from the internet to the LAN of the second router, you have to configure the same forwardings on the first router as well. You forward first from the first router to the second and then from the second into the LAN.
  2. Connect a LAN port of the second router to a LAN port of the first router. In this case you have to turn off the DHCP server on the second router to prevent incorrect IP assignments. You may/should also change the LAN IP address of the second router to avoid conflicts. Choose an IP address inside the subnet of the first router but not conflicting with any static IP addresses used in your LAN nor overlapping the IP address pool which the DHCP server on the first router uses. If your first router has an IP address 192.168.1.1 with subnet mask 255.255.255.0 and the DHCP server uses the address pool 192.168.1.100-149 (the Linksys defaults) you can assign any address 192.168.1.2-99 and 150-254 to the second router, e.g. 192.168.1.2. This way the web configuration interface of the second router is easily accessible from your LAN.
  3. A "real" two router setup. Configure the second router in router/non-NAT mode and assign a LAN IP address in a separate subnet from the first router (i.e. like in the first option). In router mode you have to configure routes on the first router to make the second subnet accessible. If you use NAT on the first router you must also make sure that your first router does support NAT for addresses which are not in the first router's subnet. Some router are limited to do NAT only for its own LAN subnet and not for other addresses. If you have such a router the third option will not work for you.
For most home setups the best way to configure the second router is probably option 2. This creates a single LAN which makes file and printer sharing and other things easy to use. See here for some details how to set it up and a more extensive list of reasons why it is preferable.

If the second router is a wireless router and you use option 2 you basically set this router up as access point only.

If both routers are wireless routers option 2 is also preferable as it allows you to create a roaming wireless network in which wireless clients can move between access points without loosing the connection in between. If you would use option 1 clients would need a new IP address if they move between the two routers. To create a roaming wireless network both routers must have identical wireless and wireless security settings. They should only differ in the channel they use to avoid collisions.

1 comment:

Stephanie said...

Thanks! This was super helpful. The link for more info about "setup two" was disconnected. Would love more info.