Default internal device network

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:56, 20 March 2018 (edit)
S2s2 (Talk | contribs)

← Previous diff
Revision as of 02:57, 20 March 2018 (edit) (undo)
S2s2 (Talk | contribs)
m
Next diff →
Line 27: Line 27:
In the default scenario, however, the "enemy" is considered to live on the WAN port (and thus vlan2 ''(vLan1)''). So routing and filtering *does* come into play when moving traffic between br0 (vlan1 and eth1) and vlan2 ''(between br0 (vlan0 and eth1) and vlan1)''. In the default scenario, however, the "enemy" is considered to live on the WAN port (and thus vlan2 ''(vLan1)''). So routing and filtering *does* come into play when moving traffic between br0 (vlan1 and eth1) and vlan2 ''(between br0 (vlan0 and eth1) and vlan1)''.
-= Other network device interfaces =+== Other network device interfaces ==
There are a few other network device interfaces in addition to ethX, brX, and vlanX: There are a few other network device interfaces in addition to ethX, brX, and vlanX:
* teql0 - [http://www.sangoma.com/main/support/linux/teql load sharing device] I believe this is used for the "Link Aggregation on Ports 3 & 4" option on the Setup/Vlans page. * teql0 - [http://www.sangoma.com/main/support/linux/teql load sharing device] I believe this is used for the "Link Aggregation on Ports 3 & 4" option on the Setup/Vlans page.

Revision as of 02:57, 20 March 2018

Description

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.

The default internal device networks in a non-802.11n network device - specifically the default configuration of a DD-WRT V23-SP2 firmware on a Linksys WRT54G v2. In a network device containing a 802.11n wireless access point the internal numbering of ports, bridges and vlans are different.
The default internal device networks in a non-802.11n network device - specifically the default configuration of a DD-WRT V23-SP2 firmware on a Linksys WRT54G v2. In a network device containing a 802.11n wireless access point the internal numbering of ports, bridges and vlans are different.

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 electrically hardwired vlan trunk interface that connects the switch to the internal router. The mapping of port numbers to physically exposed external sockets varies according to model - see this page for details.

vLan assignments, and port numbering

Current routers, typically N or AC, K3.x, have a different VLAN and port numbering scheme. To show the difference between the older and current generation, the older version is enclosed in italic parenthesis after.

The internal port that connects to the router is always port number 8 (port 5).

Within the switch entity there are defined two VLANs - vlan1 and vlan2 (vlan0 and vlan1). Vlan1 (vLan0) is the one on which all of the numbered (1-4) RJ45 sockets on the back belong to. Vlan2 (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 8 (port 5) as one of its member ports, thus tying the vLan to the router via trunking (note that by extension you can completely isolate a network by not including port 8 (port 5)). Further, you can declare that one of the vLans be the "default": when a packet flows through the router that is otherwise missing vlan tag information, it will behave as if it were a packet on the default vlan. In DD-WRT's default case, this is vlan1 (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 8 (port 5). Vlan1 (vLan0) is the default one.

If we go no further, we have a programmable switch 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, port 8 (port 5) connection to the switch's vlans is the eth0. When port 8 (port 5) is associated with a vLan, an additional device named vLan# becomes available to the router by virtue of vLan tagging through the eth0 device. 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 vlan1 (vLan 0) and eth1; rather, it employs a bridge device - who's interface is called br0 - that logically combines vlan1 (vLan0) and eth1 into a single interface.

The effect of this, given that vLan1 (vLan0) is the default one and packets from eth1 do not carry vlan tagging, is that vLan1 (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 vlan1 (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 vlan2 (vLan1)). So routing and filtering *does* come into play when moving traffic between br0 (vlan1 and eth1) and vlan2 (between br0 (vlan0 and eth1) and vlan1).

Other network device interfaces

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

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

In this dd-wrt forum thread, the default configuration is explained simpler: