⬆️ ⬇️

ZRouter - we shove FreeBSD into a DLINK router

A couple of weeks ago

I ran around the Habra like mad in search of a recipe (how to revive the dead DIR-620 router).

The main problem was that the native 620 firmware did not accept the Verizon U175 modem. And after several DDWRT firmwares, I finally found the very one that ditched it and turned it into a vegetable switch stupid.

But what happened next read under the cut



Trips to local specialists were not crowned with success, some tried to connect to the console but failed, they recommended to change the chip itself on the programmer, others said that Bobby had died completely. But still it was a pity to part with their blood 50dol. And I ordered a DCA-510 cable in one of the online stores (this is again the whole story) and re-soldered it to fit my needs.

Further, using the visual aid and the scheme:

and made myself access to the u-boot.

After that, I managed to install on it a DD-WRT from ASUS rt-n13u which I installed for the first time. But this time I already had a console and a desire to experiment with FreeBSD.



FreeBSD is a start.

At first, I was on the Internet on the wiki where the compilation of the BDD kernel was done for this chip. Skompilil tried, well, it starts up and looks for a bootp.

But further searches led me to the site zrouter.org. On which I was lucky to download the very firmware that will be discussed.

To begin, following the advice of the site do the points:





Next, I created the start.sh file:

#!/bin/sh

export FREEBSD_SRC_TREE=/usr/home/zrouter/head/head

export OBJ_DIR=/home/zrouter/obj

exec ./menu.sh



just for easy start via screen

Further, in the best traditions of FreeBSD, a text interface appears.



With the choice of parameters of the platform and build

')

for DIR-620, chose Device -> DIR-620, Target -> zImage respectively

So far, I do not recommend using Save \ Load items, as due to them, my build did not reach the end of falling out with an error:

==> building zrouter !!!

"Makefile.inc1", line 139: Unknown target mipsel:mips.

"Makefile", line 280: warning: "(MAKEOBJDIRPREFIX=/usr/obj//usr/home/andriyj/zrouter/zrouter/tmp/ make TARGET=mips TARGET_ARCH=mipsel TARGET_CPUARCH=mips ZROUTER_ROOT=/usr/home/andriyj/zrouter/zrouter WITHOUT_ASSERT_DEBUG=yes WITHOUT_ATM=yes WITHOUT_CLANG=yes WITHOUT_INFO=yes WITHOUT_INSTALLLIB=yes WITHOUT_IPX=yes WITHOUT_LOCALES=yes WITHOUT_MAN=yes WITHOUT_NLS=yes WITHOUT_PROFILE=yes WITHOUT_RESCUE=yes WITHOUT_SSP=yes -DNO_CLEAN WITHOUT_JAIL=yes WITHOUT_INET6=yes WITHOUT_INET6_SUPPORT=yes WITHOUT_MAN=yes WITHOUT_INFO=yes WITHOUT_NLS=yes WITHOUT_CDDL=yes WITHOUT_NIS=yes WITHOUT_BLUETOOTH=yes NOENABLE_WIDEC=yes -DNOENABLE_WIDEC WITHOUT_KERBEROS=yes WITHOUT_KERBEROS_SUPPORT=yes -C /usr/src buildenvvars)" returned non-zero status

"Makefile", line 288: Need an operator

"Makefile", line 288: Need an operator

"Makefile", line 288: Need an operator

"Makefile", line 288: Need an operator

"Makefile", line 288: Need an operator

"Makefile", line 288: Need an operator

"Makefile", line 288: Need an operator

make: fatal errors encountered -- cannot continue



Click on Build and look forward to creating an image.

Next, raise the tftp and try to boot.

Firmware



Since I already had DDWRT on my router and didn’t really want to demolish it, I first used point 4 U-boot followed by tftp test.bin and bootm, but I didn’t want to load the packed kernel (it gave an error when checking lzma). Then, following the advice found in the open spaces, www.dd-wrt.com tried to load according to item 1. And the load of the packed kernel went. But stubbornly not seen rootfs.

Gathering arrogance, I wrote directly to the developer: Oleksandra Rybalko . In conversation and samples with which we spent the next few hours (more precisely, about 3 days but worked in the evenings for a maximum of 1-2 hours).

As a result, it turned out that the ZRouter kernel is looking for rootfs at the address in flash memory and not RAM. After flashing the router on point 2 of the U-boot, I finally got the coveted FreeBSD.



Customization



The web interface is very simple, I would even say spartan.

In the settings were found as befits: DHCP, PPTP, PPPoE, 3G, Wifi (temporarily disabled).

Actually their configuration is the same for any such things, regardless of the firmware and manufacturer.

It is worth noting, however, that the Update button does not save data. This is done by the Save settings button in the main menu.

Further setting 3G modem-a (I had to change only the link to the device /dev/cuaU0.0), save the settings (required), reboot (required).

The modem went up with a bang.



Results, rake that does not necessarily occur



Results

1. The firmware works (actually through it now and the Internet on which I write here)

2. There are problems with Wifi (according to the developer’s claims, it’s working at about 60%, but it’s not yet configured in the browser)

3. 3G modems are determined with a bang (at least from the tried firmware Dlink original, DDWRT, ZRouter, only the latter normally identified my Verizon U175



Rake:

1. Be sure to use the fresh kernel from the ZRouter repositories.

2. Be sure to flash and do not try to run from RAM

3. Update does not record data, so it is necessary to forcibly record everything through the menu.



PS

I thank for the working router:

- www.facebook.com/arybalko

- Collective zrouter.org

- Interlocutors from #zrouter channel on IRC EFNet

UPD: For those who want to support the project

Wallets:

- Z105679867090

- U364832937482

- R959084523149

- E366383023429

Source: https://habr.com/ru/post/129451/



All Articles