Random Stuff

MetaTrader History ToolKit
MetaTrader Data Export 
My ATC2012 EA
Heinz Engine
MetaResources
Custom BlueRetro Adapter 
Custom DIR-868L Router 
3DS Retro Game Gallery
Frypan-Lamp Biquad Antenna
HTPC 001
HTPC 002
HTPC 003 
Aerospace AL CPU Cooler
de-db 
ResMagik
NVIDIA CUDA  
Developer's Notes
Theme:

Page Uploaded: 22/03/2024

Custom DIR-868L Router

This is a self-made, heavily customized, router for personal and professional purposes (good or bad intentions matter not!).

It is based on a D-Link DIR-868L board and features a brand new chassis with a completely different shape, a custom firmware and a set of hardware-based QoL modifications.

I have a whole bunch of photos of the router already built, not from the building process. I'll throw them at the page and break some of them down when possible.

Lets start with some hardware talk: I was gifted this almost new D-Link DIR-868L Rev C dual band AC 1750 router. We are talking about a mid to high-end SOHO router from 2013.
Specswise, the router is quiet decent for its time. It sports a Broadcom BCM4708 based SoC design which gives us quiet the flexibility to mess with the flash, NVRAM and perform some worthy hardware mods. Other specs include a dual-core 800 Mhz CPU, 256 MiB RAM, 128 MiB flash, 64 KiB NVRAM, all gigabit LAN and WAN ports, 3 antennas, a single 900 mA USB 3.0 port and a power switch (yes, that's a feature nowadays).

But why customize it? After one year of usage in its stock state, I had a couple of cons with the router:

The most annoying one was that stupid trash can shape designed specially to stand vertically, but even if you forced it to lay horizontally then you could not put anything on top of it.

Next was the stock firmware: D-Link, in revision C dropped the classic white-gray-orange firmware and replaced it with something that was completely flat and generic. It was somewhat softer to the eyes and easier to use but all the advanced fine grain functionality was gone.

But the key issue is this vulnerability: I used the USB port on the router to connect an external HDD and have a mini-NAS. Not only you don't have control over the SMB server but the share's password is set to the router's admin password! And you can't change it. Optionally you can only use it as a public share with no password.


Custom firmware

The first thing I did was to flash a custom firmware. I used DD-WRT for that matter. This is a fine piece of software, Linux based, that gives you absolute control over the device.

You can access the full live demo of DD-WRT here.
The DD-WRT wiki page dedicated to the D-Link DIR-868L, with instructions and download links, can be found here.

As for the stock firmware, I could not dump my exact factory version because I had an issue with TTL serial communication, this will be discussed later. Fortunately there are official releases published by D-Link but they are getting a little tricky to find so I'll post links to a couple of firmwares in my own server.

D-Link DIR-868L Revision C1 official firmwares:


Hardware mods

UART connector mod

There's no better mod than enabling TTL serial communication on the device and I did a couple of things about it.
All DIR-868L revisions have the UART points on the board but they have no connectors so I soldered a DuPont male header. These points can be found, at label JP1, between the two leds in revision A and B, but in revision C they are located at the top right of the board (with the board oriented so that the ports are facing towards you).

A 5-pin header is required although only 4 pins are connected, the remaining one must be removed with a plier.
Next you'll see illustrated the UART header with it's pins identified, followed by a custom made cable with DuPont female connector plugged to the header.

The custom UART cable connects on the other side to a custom PCB that exposes a new UART header on the back of the router. This allows to establish an external serial connection without the need to open up the router. This will be shown later after I cover the next mod because in the end both mods converge at this back point.

JTAG connector mod

This next mod is very similar to the previous one, although the photos don't make it much justice (sorry for that). It is a JTAG connector on the board that is connected to the custom PCB on the back of the router and exposes the testing points for easy debugging. I don't use JTAG but it is convenient to have it right there just in case.
The JTAG points, at least in revision C, can be found at label JP2 located at the bottom left of the board.

This mod uses a 2-row x 5-pin (10 pins) DuPont male header. The matching 10-pin DuPont female connector is plugged to the header with each individual wire going back to the custom PCB, which will be covered next.

Custom PCB mod - Back headers

As it was spoiled previously, the UART and JTAG connector mods could be used internally/directly but they are connected to a custom PCB that is screwed on the back of the router. This PCB exposes the internal headers for easy access. But enough said, I bring you the photos now:

And this is how it looks from the outside:


Chassis

Building a new body was mandatory for this project. I went for a standard book design that can be placed in any orientation and other objects can be placed on top of it when placed horizontally (has rubber feet on both sides). If you've seen my other projects then you already knew I was going to use MDF for the chassis. The side vents are made out of metallic mesh.

Not really worth mentioning but anyway, I applied an atrocious glossy black finish to make it look like a router. The natural (or even barnished) MDF look was too ghetto for this project.


Current usage

I've been using the router primarily for two things:

  1. I'm taking advantage of the dual band to relay a wireless signal into my own personal WLAN. I use the 2.4 GHz band to bridge my router with the source signal because this band has more range but less bandwith, though I do not require much WAN bandwith in this case. Then I route the packets to the 5 GHz band and into my private LAN because this band has more bandwidth but less range, though enough stable-range for a close proximity network. Local bandwidth is more important for me in this case, with link speeds of up to a Gigabit for LAN clients and up to 1300 Mbps for WLAN clients if the right conditions are met (throughput is less). Internet is shared with all devices: Wired and wireless.
  2. I'm using the router as a NAS server. I attached an external USB 3.0 HDD which is being shared through SMB with my personal network. DD-WRT is able to provide a client for the mydlink dynamic DNS service so that I can access the shares from anywhere in the world.

Current issues

While this custom router has served me well, so far I've encountered the following issues:

  1. I have an issue with TTL serial communication that is preventing me from doing wild things or have a fallback in case I brick the device. Something is messed up because no matter what, all that I receive from serial com is garbage. I've tried EVERYTHING: Solder points are ok and not shorted, cables/connectors all ok (RX to TX; TX to RX; common ground is not needed, if connected then the router shorts and refuses to start), TTL is set to 3.3v, all parameters are as spected (115200|8|1|None|XON/XOFF) and even tried all combinations with all the common baud rates, I tried direct connection to the board instead of the I/O backpanel (exact same result). I tried Linux and Windows (exact same result). I use an original FTDI FT232RL USB-TTL adapter (tested with microcontrollers and it works).
    What/who is to blame? An obscure baud rate is required or something might have gone on the fritz.

  2. DD-WRT has an issue with the SMB1 implementation. Clients are able to connect to the server and access the shares but the files are nowhere to be seen. I have a bunch of embedded devices that work with SMB1 only, are sensitive to ACLs, have fixed permissions and are immutable. This leaves me with all these devices cut out of my network. I've played a lot with this, tried custom Samba config files with thousand of different options but that is not it. ACLs seem to be the culprit, everything points into that direction. Currently, ksmbd has partial ACL support. Reading further into Samba's documentation, it seems that ACL goes beyond Samba, it involves the filesystem and goes deeper after that. ACL worked fine with the stock firmware by the way. The only workaround for the time being is to use older DD-WRT releases from 2019, they work fine with SMB1 and ACL. Going to keep digging into this.

That'll be all. Signing out.