Linking Subnets with Static Routes

From DD-WRT Wiki

Revision as of 12:04, 7 September 2009 by Phuzi0n (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search


This guide aims to explain how to link different subnets together using static routes to forward traffic to the desired subnet of another router. I will avoid going into too much detail about subnetting in general, though I will say that there are benefits to using subnets such as reducing network traffic (less broadcast frames) and better access control between hosts. One important thing to note for those unfamiliar is that linking subnets is called routing, and the interfaces you use should be unbridged to do it correctly.

Creating the Subnets

There are many ways to create subnets within DD-WRT. By default only the WAN port is unbridged while the switch (which is a hardware bridge) and wireless interfaces are software bridged together.

Ways to create additional subnets include:

  • Set the wireless interface to 'Unbridged'
  • Configure VLAN's if your switch supports them
  • Add virtual interfaces to any existing interface which is poor design but can overcome hardware limitations such as switches without vlans.
ifconfig eth0:1 [NEW SUBNET ROUTER IP] netmask [NETMASK] broadcast [BROADCAST]

Baseline Reference

Now let's say you have three routers connected together. Router1's WAN port is connected to the internet which makes it the gateway of your entire LAN, and Router2 and Router3 have their WAN ports connected to Router1's LAN ports. Router2 and/or Router3 could also be using Client or Repeater mode (not bridged!).