Advanced Home Networking - Routers

The most basic function of a router is to keep internet traffic isolated between two networks. Only traffic authorized to enter your home network is allowed in and only internet devices (clients) authorized by your router are allowed to communicate on your network. Wide Area Network (WAN) ports are the outside or incoming ports. Local Area Network (LAN) ports are inside your network. A modem with a built-in router will not have a port called WAN. A Cable Company modem will have a coax connection. Although not called WAN it is effectively a WAN connection. A Phone Company DSL modem will have a telephone jack connection which is also effectively a WAN connection.  

The Input to a modem or router is a WAN port the others are LAN ports
Routers with a built in switch have 1 WAN port and usually 3 to 4 LAN ports

The router assigns IP address (unique numbers) to each device. The router routes data traffic between clients in your home network and provides simple firewall functions between the Internet and your home network.

There are two types of IP addresses, Dynamic and Static. Dynamic IPs are those assigned by the router when a network client (PC, Phone, camera, ect..)  is connected to the network and does not have an established IP address set in its internal network settings. When a client has an IP address pre-configured it is said to have a "Static IP".  As long as the static IP is same format (more on that later)  as the routers LAN, everything should work. When a client does not have a static IP configured, then it uses Dynamic Host Configuration Protocol or DHCP. The image below is a simplified example of DHCP.

When a cable modem is connected to the cable network, it also receives an IP address from the cables companies servers using DHCP  or a similar protocol. Unless, you pay extra for a static IP. 

Routers issue IP addresses to network devices
If needed, IP addresses are provided by the router. All clients must have a unique address.

In some cases you may be forced to use two routers. Your Internet Service Provider (ISP) which can be the cable company, Phone Company or even Satellite Internet will almost always install a modem with a built in router.  The image below shows this configuration. Any devices connected directly to the first router will be on one network (LAN A). Any devices connected to the second router, by wire or wireless, will be on a separate network (LAN B) and therefore nested inside the first.  This is often called cascading routers or subnet, short for subnetwork.  One router cascaded behind another router is technically not a subnet it the most technically terms, but the term is commonly used as such.  A subnetwork or subnetting is way out the scope of this web site.  For simplicity I will only use the term cascade.

One router connected to another router in a Lan to Wan configuration
Cascading routers isolates internet clients from communicating with each other.

When you cascade a router behind another router you create two LANs. The clients on LAN A cannot see or communicate to those on LAN B and vis-versa. While this setup may seem to be undesirable it can often be exactly what you want. If you share an internet service with a room mate this will prevent their computers from seeing your computers on the same network. For security purposes you may wish to isolate cameras from your primary network. The image above only shows one router with WiFi but you could have each router with a WiFi AP creating isolated WiFi networks.

There are almost endless variations you can create using multiple routers, access points and switches.  The most important part of wiring multiple routers is to always connect them in WAN to LAN. Connecting routers in a LAN to LAN method may cause complete network failure. You will have two routers trying to each control your network. It is possible to dumb down one of the routers so it plays along, but that is beyond the scope of this article. Some manufacturers have WiFi routers with the ability to self configure to allow multiple routers in almost any wiring configuration, but they still need your initial setup abilities. .