DtD Linking on Linksys PDF Print E-mail
Written by Bob WB5AOH   

How to enable Device-To-Device (DtD) Linking on a Linksys Router, rev 1.

DtD linking is when you want to connect 2 or more nodes back to back at the same site, with CAT5/6 cabling directly. It
makes traffic flow more efficient between the nodes, as the cable provides higher speeds and more stable connections
compared to the RF links.

In the 1.1.x release, we found out that some Realtek network cards/devices (Realtek makes chips on some network cards)
would have problems maintaining an ethernet connection to the on-board switch when ports are being used in both a tagged
and untagged mode. In 3.0.0 we disable DtD by default in order to avoid these issues, as most Linksys nodes probably wont
be part of a DtD network.

Enabling DtD on all interfaces means that Realtek-based devices may not be able to connect directly to your node. If your
PC network card is Realtek based, you may not be able to access your node again without the help of additional hardware or
actually attaching to another node on the mesh.

You will need an SSH Client such as putty and have to edit files in the shell. If you do not feel comfortable doing this,
find a local Elmer.

Remember, Broadband-Hamnet doesn't officially support this method, but some hams are cheap and managed switches may cost more than linksys mesh nodes you might already have and want to put to use.  These schemes have been partially tested and believed to work in many cases, but your mileage may vary, and if you make a major editing mistake, you might not be able to get back into your node via the LAN (you might still be able to get to it remotely over the RF mesh, or if all else fails, via the serial port console if you can set up to do that).  In cases of doubt as to external compatibility, don't tag all 4 of the vlan2 ports, leave at least one untagged and then test for functionality of the various port(s), then decide if you want to make additional port modifications or do something else instead.

How to do it.  (see below for variant linksys hardware which changes the port numbers of the vlan lines in the example)

  1. SSH into localnode on port 2222
  2. Use vi to edit /etc/vlan: vi /etc/vlan
  3. In the file you will see the line  option vlan0 "1 2 3 4 5*"  --note of the numbers on that line
  4. add a new line under option vlan1 that is option vlan2 "1t 2t 3t 4t 5t" with the same numbers in the vlan0 line but add a 't' after each number (means the port is tagged). Your numbers in VLAN0 may be different, depending on model, so make sure you use the numbers in the vlan0 line. If you want, you can set the 't' to only the ports you want to enable DtD on, that way if you do happen to have Realtek stuff, you can plug that into one of the untagged ports and it would work.
  5. Save the vlan file (<esc> :wq <enter>)
  6. edit /etc/config.mesh/network with vi: vi /etc/config.mesh/network
  7. put a # at the start of the line "option auto no" under dtdlink to enable the interface.
  8. Save the file
  9. Go to the node at http://localnode:8080
  10. Go to the System page
  11. Save the configuration
  12. Reboot your node


DtD will now work on that node.

To shut off DtD, disable the DTDLINK interface and remove the option vlan2 line, OR,  just re-flash your node.

More information about various Linksys hardware, with examples:

For the rest of this document, we will refer to the rear panel hardware items as "jacks" and the internal software configuration as "ports", to eliminate any misunderstandings as we cross reference them.  In all cases the rear panel jack number matches the front panel LED number.  These cross references below were established by actual testing on vers 3.0.x firmware by selectively turning LAN ports OFF one at a time in /etc/config/network and rebooting and connecting a PC to each jack one at a time to see which jack failed to supply a DHCP address, then proceeding to the next one in turn until all 4 LAN ports/jacks were tested, for several available models of routers.  Not all possible routers were available for this test session.  The WAN port/jack wasn't specifically tested, but it is the one that is left over on the switch, noting that port 5 is the CPU interface.

A model labeled WRT54GS is interpreted to mean WRT54GS v1.  Likewise a WRT54GL is interpreted to mean WRT54GL v1.

Looking at the rear panel of any of them, the jacks are physically stamped, left to right:
internet  1   2   3   4     <--- physical jack labelling
   []             []  []  []  []    <--- the jack itself, below the labels. Logical mappings below.

0        1   2   3   4     <--- old hartware port number mapping (as tested on a WRT54GS)
0        1   2   3   4     <--- old hartware port number mapping (as tested on a WRT54G v2)
0        1   2   3   4     <--- old hartware port number mapping (as tested on a WRT54G v2.2)
0        1   2   3   4     <--- old hartware port number mapping (as tested on a WRT54G v3)
4        3   2   1   0     <--- new hardware port number mapping (as tested on a WRT54G v4)
4        3   2   1   0     <--- new hardware port number mapping (as tested on a WRT54GL)


The examples explain in greater visual detail what to edit and how, in steps 2-5 of the general process above.

For the following examples,
   vlan0 refers to the LAN config (untagged) and
   vlan1 refers to the internet/WAN (untagged)
   vlan2 (tagged) has not yet been defined on an unmodified Broadband-Hamnet node, it is reserved for the DTD linking between hard-connected meshnodes that OLSR can route network traffic over the ethernet cables.

Take careful note of the asterisk (*) that follows the number 5 only on the vlan0 line, it MUST be there, don't edit it out.

The earlier linksys routers, starting at WRT54G v1 - v3 for instance, had a rectangular full size PC board in them.  This also applies to the WRT54GS models that we use, not all useful GS models were tested.  On these PC boards, the ethernet board wiring routes the jacks in a certain manner.

file /etc/vlan (unmodified) on earlier hardware looks like this:
#### VLAN configuration
config switch eth0
option vlan0    "1 2 3 4 5*"
option vlan1    "0 5"

To set up the tagged vlan on earlier hardware, modify it to look like this:
#### VLAN configuration
config switch eth0
option vlan0    "1 2 3 4 5*"
option vlan1    "0 5"
option vlan2    "1t 2t 3t 4t 5t"

Beginning with WRT54G v4, and continuing with the WRT54GL models, the PC board was revised and shrunk down to a irregularly shaped "L" form factor, and when they did this, they also totally rearranged the ethernet wiring from the jacks to the bridge, so the port numbers are completely different.  On newer models, the ethernet switch is physically inside the cpu IC, on others it is external and is a separate IC.

file /etc/vlan (unmodified) on later hardware looks like this:
#### VLAN configuration
config switch eth0
option vlan0    "0 1 2 3 5*"
option vlan1    "4 5"

To set up the tagged vlan on later hardware, modify it to look like this:
#### VLAN configuration
config switch eth0
option vlan0    "0 1 2 3 5*"
option vlan1    "4 5"
option vlan2    "0t 1t 2t 3t 5t"

If your intended LAN device is part of the RealTek bug, you will need to remove or untag one or more ports from the vlan2 line, and remember to plug it into that jack (only).

Background information:
The ethernet switch inside has a total of 6 ports, and they are logically numbered 0 1 2 3 4 and 5 and these logical port numbers are what is referred to in all configuration files.  In all cases we know of, port 5 is reserved for the backhaul into the CPU, it doesn't appear on any external jacks.  However the jack assignments for the logical port numbers are arranged into (at least) two different hardware schemes dependent on model, and amount to being arranged backwards to each other.  For the most part, the main concern is which one is the WAN or internet jack, unless you are concerned with which specific LAN jack is which (in case you want to specifically assign some jacks to specific functions).

It is also possible to reconfig the internet jack to behave as if it is another LAN jack if you don't need the WAN and need one more LAN jack, more about this below.  Or if you have a damaged WAN jack, you can reassign it to a working available LAN jack.  Some of us hams really ARE cheap.

Remember that you could set yourself up for failures in the field if you mistakenly take nonstandard hardware to the field and it doesn't behave like standard stuff when you are under pressure to make things work.  Leave the experiments in the ham shack if possible, and plainly mark them as such.

This is an example of a meshnode which has been reconfigured to define all 5 external jacks as LAN, removing the WAN function, and tagging all 5 ports so that they will operate dtd links.  This application could be used as the wired hub of a site that utilizes up to 5 meshnodes aimed several directons, and possibly on separate bands.  It is also a case where DHCP would ideally be turned off at all but one node, but care has to be taken as to how someone connects via ethernet to an individual node for any required config or maintenance.  That gets tricky.  Also note that this scheme doesn't by itself provide for any hardwired internet connectivity, which may or might not be of concern depending on the application.

File /etc/vlan (modified) looks like this:  (Happens to be  WRT54G v2, but in this case you can't tell by looking, a V4 or WRT54GL would also look like this.)
#### VLAN configuration
config switch eth0
option vlan0    "0 1 2 3 4 5*"
option vlan1    ""
option vlan2    "0t 1t 2t 3t 4t 5t"

For more advanced uses, it is possible (has been done) to add other vlans and matching interfaces and move the available jacks around to the other interfaces to support things like dmz schemes, for example.  Maybe you want to route some things to a separate LAN for some reason, maybe a maintenance access jack.  If you have a need or want to experiment, these things can be done, just be careful to leave the system defined in a state that you can still connect and back out of a bad config after you reboot.

Remember also to finish up to perform steps 6-8 to actually turn ON the DTD interface for vlan2.

Always remember that edits made to /etc/vlan and those made to any of the /etc/config-mesh/ files are NOT automatically incorporated into the active config files in /etc/config/  You have to do a resave on the GUI menu to rewrite the files in /etc/config/ and reboot the node to make changes happen (steps 9-12 above).  The config resave script combines /etc/vlan and /etc/config-mesh/network into one file /etc/config/network which is the one that is actually read upon a reboot.  (If you edit THAT file, any gui menu change/resave will overwrite any manual changes to that file.)

(previous)   Last Updated on Monday, 16 March 2015 08:31
(rev 1)      Updated 3/22/2015 by WB5AOH

Last Updated on Monday, 23 March 2015 07:40
 
SPONSORED AD: