Default internal device network

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:27, 26 January 2008 (edit)
Daveparker01 (Talk | contribs)
m (updated link to teql0 explanation, fixed typo)
← Previous diff
Revision as of 21:22, 12 February 2008 (edit) (undo)
Daveparker01 (Talk | contribs)
(endowed intro paragraph w/ more "confidence", added link to vlan trunk article)
Next diff →
Line 1: Line 1:
-I'd been struggling with understanding just what I could do with my shiny new DD-WRT flashed system. While DD-WRT's interface greatly simplifies configuration, its documentation seems lacking in the "explaining what's under the hood" department. There doesn't seem to exist a concise description of the functional components, their capabilities, and how they're all woven together. There are many very helpful pages here in the wiki which, if studied and assimilated properly, give you enough to concoct some "truth". But I feel that with all the power that DD-WRT puts in your hands, some kind of fundamental understanding of what's going on inside is necessary. What follows is an attempt to synthesize something concise along those lines.+The DD-WRT user interface is an awesome piece of work, as it front-ends what amounts to a really quite sophisticated combination of switching and routing. This document is a concise and hopefully mostly accurate description of what the UI is actually configuring for you from the perspective of internal network devices and the data flows between them.
[[Image:Ddwrtlogicview.png]] [[Image:Ddwrtlogicview.png]]
-The image shows what I understand to be the [[Factory_Defaults|default]] configuration of a V23-SP2 installation on a WRT54G v2. I do not know how (or if) this differs on other devices.+The image shows the [[Factory_Defaults|default]] configuration of a V23-SP2 installation on a WRT54G v2. I do not know how (or if) this differs on other devices.
By way of a narrative, the **default** configuration works like this: By way of a narrative, the **default** configuration works like this:
Line 17: Line 17:
If we go no further, we have a device that can describe as many as 5 vlans, between which we can do sophisticated routing and filtering. But that ignores the [[Wl_command|wireless part of it]], which adds some extra complexity. If we go no further, we have a device that can describe as many as 5 vlans, between which we can do sophisticated routing and filtering. But that ignores the [[Wl_command|wireless part of it]], which adds some extra complexity.
-From the router's perspective, that special port 5 connection to the switch's vlans is a single virtal ethernet interface known as eth0. When port 5 is associated with a vlan, an additional device named vlan# becomes available to the router. All movement (or non-movement) of packets between the virtual lans is determined by routing logic behind those devices (which is normal linux [http://linux-net.osdl.org/index.php/Iproute2 routing], [http://en.wikipedia.org/wiki/Netfilter filtering], [http://linux-net.osdl.org/index.php/Main_Page etc]). The wireless device is on a separate interface called eth1. This interface, which is not part of the switch, is available to routing logic just as eth0 and the vlans are. However, DD-WRT by default does not use routing logic per se to move traffic between vlan0 and eth1; rather, it employs a [http://linux-net.osdl.org/index.php/Bridge bridge device] - who's interface is called br0 - that logically *combines* vlan0 and eth1 into a single interface.+From the router's perspective, that special port 5 connection to the switch's vlans is a single virtal ethernet interface known as eth0. When port 5 is associated with a vlan, an additional device named vlan# becomes available to the router by virtue of vlan tagging (eth0's connection to the switch is a [http://en.wikipedia.org/wiki/IEEE_802.1Q vlan trunk]). All movement (or non-movement) of packets between the virtual lans is determined by routing logic behind those devices (which is normal linux [http://linux-net.osdl.org/index.php/Iproute2 routing], [http://en.wikipedia.org/wiki/Netfilter filtering], [http://linux-net.osdl.org/index.php/Main_Page etc]). The wireless device is on a separate interface called eth1. This interface, which is not part of the switch, is available to routing logic just as eth0 and the vlans are. However, DD-WRT by default does not use routing logic per se to move traffic between vlan0 and eth1; rather, it employs a [http://linux-net.osdl.org/index.php/Bridge bridge device] - who's interface is called br0 - that logically *combines* vlan0 and eth1 into a single interface.
The effect of this, given that vlan0 is the default one and packets from eth1 do not carry vlan tagging, is that vlan0 and the wireless network (however that might be arranged) logically behave as a single vlan. No routing is required to get traffic from the wireless domain to vlan0; the router will act as though the wireless packets are on the wired segment. The effect of this, given that vlan0 is the default one and packets from eth1 do not carry vlan tagging, is that vlan0 and the wireless network (however that might be arranged) logically behave as a single vlan. No routing is required to get traffic from the wireless domain to vlan0; the router will act as though the wireless packets are on the wired segment.

Revision as of 21:22, 12 February 2008

The DD-WRT user interface is an awesome piece of work, as it front-ends what amounts to a really quite sophisticated combination of switching and routing. This document is a concise and hopefully mostly accurate description of what the UI is actually configuring for you from the perspective of internal network devices and the data flows between them.

Image:Ddwrtlogicview.png

The image shows the default configuration of a V23-SP2 installation on a WRT54G v2. I do not know how (or if) this differs on other devices.

By way of a narrative, the **default** configuration works like this:

The internal network switch device has 6 ports. one is the WAN RJ45 socket, four are the RJ45 sockets numbered 1-4, and one is an internal port that connects the switch to the internal router via a virtual interface. The mapping of port numbers to physically exposed external sockets varies according to model - see this page for details. The internal port that connects to the router is always port number 5.

Within the switch entity there are defined two VLANs - vlan0 and vlan1. Vlan0 is the one on which all of the numbered (1-4) RJ45 sockets on the back belong to. Vlan1 is the one on which the WAN socket resides.

In order for it to be possible to move traffic outside the domain of any vlan, it is necessary for traffic to be manipulated by routing and filtering logic. In a DD-WRT device, you make this possible by assuring that any vlan that you've defined has port 5 as one of its member ports, thus tying the vlan to the router. Further, you can declare that one of the vlans be the "default": when a packet flows through the switch that is otherwise missing vlan tag information, it will flow to the default vlan. In DD-WRT's default case, this is vlan0.

So at this point in the narrative, we have five physical ports mapped to two vlans, both of which connect to the internal router on port 5. Vlan0 is the default one.

If we go no further, we have a device that can describe as many as 5 vlans, between which we can do sophisticated routing and filtering. But that ignores the wireless part of it, which adds some extra complexity.

From the router's perspective, that special port 5 connection to the switch's vlans is a single virtal ethernet interface known as eth0. When port 5 is associated with a vlan, an additional device named vlan# becomes available to the router by virtue of vlan tagging (eth0's connection to the switch is a vlan trunk). All movement (or non-movement) of packets between the virtual lans is determined by routing logic behind those devices (which is normal linux routing, filtering, etc). The wireless device is on a separate interface called eth1. This interface, which is not part of the switch, is available to routing logic just as eth0 and the vlans are. However, DD-WRT by default does not use routing logic per se to move traffic between vlan0 and eth1; rather, it employs a bridge device - who's interface is called br0 - that logically *combines* vlan0 and eth1 into a single interface.

The effect of this, given that vlan0 is the default one and packets from eth1 do not carry vlan tagging, is that vlan0 and the wireless network (however that might be arranged) logically behave as a single vlan. No routing is required to get traffic from the wireless domain to vlan0; the router will act as though the wireless packets are on the wired segment.

In the default scenario, however, the "enemy" is considered to live on the WAN port (and thus vlan1). So routing and filtering *does* come into play when moving traffic between br0 (vlan0 + eth1) and vlan1.


There are a few other network device interfaces in addition to ethX, brX, and vlanX:

  • teql0 - load sharing device I believe this is used for the "Link Aggregation on Ports 3 & 4" option on the Setup/Vlans page.


DD-WRT's distribution includes command line utilities to manipulate all of these devices and mechanisms.



I did the diagram in kivio and I'd like to make that file available - I'm just not certain of the best way to do that; the wiki does not like the file type.