Janmesh.net > Documentation - How to turn an old modem router into a Janmesh wifi repeater

Turn an old modem router into a Janmesh wifi repeater and cjdns connectivity hub

Maybe you've got one useless old modem/router that can be used to connect to internet. Here, will convert one of them, namely a DLink dsl 2740B, into a dumb wifi access point (AP) that will operate open ad-hoc wifi, olsrd, and cjdns, in order to extend the range of a Janmesh network, and will distribute the mesh connectivity to the whole home lan network, simply by being pluggued through ethernet in your home Internet Box.

Find the right firmware for flashing

First off we head on to https://openwrt.org/toh/d-link/dsl-2740b. The sticker at the rear of the router says "hw version : F1" which is supported by OpenWRT up to version 19.07.2. Then we can

Download the flash image.
Press and hold the reset button
Power on the device
Wait until the power LED turns solid (after about 30 seconds)
Browse to http://192.168.1.1/
Login as admin, password admin
Maintenance -> firmware update
Upload the image
Note : it is possible that the .1.1 address is already in use by your home NAT internet box. If so, disconnect from it, and process from then with the router directly plugged in the Ethernet adapter of your computer

Basic configuration

If you get into serious trouble, remember that you can always use the reset button and restart from here.
log in at http://192.168.1.1 , as root, with empty password, and set a new password. Edit the wireless (network) : select Add then
Mode: Ad-Hoc
SSID: http://janmesh.net
add "lan" to networks associated with this interface

Tip: You may want to prevent low ACK disconnect in the 'advanced' tab.
apply pending changes and enable wifi interface
We now want to integrate the DLink into the lan infrastructure in order to have it able to reach internet.
All we have to do is to set up the ethernet interface to act as a static address client (afaik DHCP will run into problems, so static address is preferable) :

Network->interfaces, edit lan, set Static Adress in "Protocol", choose an unused adress in the 192.168.168.X range (I chosed 192.168.1.99), also, provide a DNS adress which will be the one of our internet box (192.168.1.254 in my case), then apply pending changes

Since we changed the IP of the router, after a (long) while, it will complain that it has been unable to check/revert the change. Since you know what to do, click on the red "Apply anyway" button.
If you had previoulsy plugged your router directly on your computer to avoir 192.168.1.1 address collision, this is now no longer needed, and you can plug the router anywhere in your home LAN.
If everything went fine, your router now has internet access : log in from your browser, to 192.168.168.99, or whatever address you set. You should see the login screen, and Network->diagnostics should now ping.
System->software-Update list, then install olsrd and cjdns packages
In Network -> Interfaces -> CJDNS -> Edit -> Physical settings, tick "Bridge Interface" and in the list of interface bridged, make sure that aside Cdjns, there is also eth0.1 and Radio0.Network1 selected.
from another computer, use ssh to login to root@(the newly DHCP-assigned IP of the dlink), and use the vi text editor to edit /etc/config/cdjdns. Modify the according section as following :
config eth_interface
        option beacon '2'
        option bind 'lan'
This will enable autopeering on both wifi and lan
restart cjdns with /etc/init.d/cjdns restart
also with the vi text editor, edit /etc/config/olsrd and /etc/config/olsrd6, and replace "wlan0" in interface, by "lan". you can now logout from the modem-router.
Rebooting it now might be a good idea You now got a Janmesh range extender, ethernet autopeerer box, fully fonctionnal.