Router from DAP-1160

Good afternoon, Habr.

I want to share a little practical experience on creating a router from the old DAP-1160 access point. The goal of this task was simple - not to buy a new router for the cottage and save money. Well and also, of course, interest.

Since I had never before encountered alternative firmware, I decided to fix this awkward moment for myself. So, here is the patient himself, an inside view, so to speak.


This unit has two LAN outputs and a regular 3 dbi wi-fi antenna, just what you need! We will make one port WAN, the second will remain for LAN. Next, in front of me was the choice of alternative firmware, because native does not work very stable. Therefore, the choice fell on DD-WRT or Open-WRT. But then difficulties arose. Either I didn’t search enough, or I missed something, but it’s a fact: under DAP-1160 I did not find any of the firmware, or rather I did not find the Realtek RTL8186 chip. But on one of the forum threads I was sent to the Wive-NG alternative firmware site. What was my happiness when I saw that one of the firmware supports a chip installed on my access point, and the point itself is listed in the list of supported devices.

So, the choice is made - put Wive-NG.

I must say right away: due to the fact that the access point has very modest characteristics (FLASH - 4 MiB, RAM - 16 MiB), there is no web interface in the firmware and there is only a command line.

For good, you should flash through tftp, but in my case it did not help. Therefore, I will tell you both options.

1. Via tftp.

We install any tftp server and download the archive and firmware. Unpack and find wive.bin, this is our firmware. We connect the LAN connector to the network card of the computer. Next, on the turned off device, hold down reset and turn it on. It should light up and turn off the power LED after a few seconds. Now we become with the device on the same network, for example, ip, mask You can use any ip except

Now fill the firmware:

For windows:
 tftp -i put c:\wive.bin 
(the path to the file should be yours).
For Linux:
$ tftp
tftp> connect
tftp> mode binary
tftp> put wive.bin

2. The above option did not work for me personally. Therefore, I did the usual firmware update through the native D-Link web interface, indicating the path to wive.bin to it. Oddly enough, everything went without a hitch.

And now the most interesting thing is the setting:

By default, the device has a network registered with the address on the router itself We change the IP on the network card to be on the network with the now router. I set IP with a mask of Now we can safely connect via SSH to the router.


By default, the router login is root, the password is rtl8186. As you can see from the picture, the firmware version 0.3.18, which is far from the newest, but what can you do, the piece of iron is also not a newcomer. In essence, wive-ng is ordinary Linux and nothing Linux is alien to it. But the developers greatly simplified the lives of users by making a console menu that is called by the menu command, where all the settings of the router are presented.


The first thing you were advised to do was change the password to root.

You can do this as:
passwd root
and through menu -> 9) Change Password

So, in front of us we see a lot of menus with numbers. By pressing the number, the corresponding configuration file will open in the vi editor. By editing these files, the router is configured.

Personally, I was confused by the non-standard internal network on the router. Agree, it’s somehow unusual to have the address of the router on, so we change it. Go to menu -> 2) Interfaces and find the BR0 interface, then change the line
to your network address, I put
Also check for the presence of “yes” in the line


Here we find the ETH0 interface below and derive it from BR0:
The ETH0 interface will correspond to LAN1 on the device, which by output from BR0 will become the WAN interface. Next, you should look into the settings of your provider, namely how it gives you an IP address. If by DHCP, then in yes we write to this line
and leave this line empty and make it commented out:
If you have a static IP, then write “no” for DHCP in the line:
And in the next line we write your IP, issued by your provider:
ETH0_IPADDR=ваш ip

If you have one LAN output, then the next line in the ETH1 interface must be changed to
I have 2 LAN outputs, so I leave it on.


Save the changes made and exit with the command

For now, let's finish the configuration of the interfaces. Let's configure DHCP.

Go to menu -> 8) Extended Menu -> 5) DHCPD .
Here we will write down the settings of our DHCP server.
We will bind the ip distribution to the br0 interface, this will make it possible to distribute ip on all ports connected to this interface (eth1 and wlan0).
Next, we set the range of distributed ip, from which ip distribution of addresses will begin:
and which will end

The following line can not be touched:
max_leases   30

We put the dns of the provider through a space or, as in my case, Google’s:
opt dns

We set the size of our network, it must match the size of the network, which you indicated in the line BR0_IPADDR = / 24, i.e.
option subnet

We write the gateway that our DHCP server will issue:
opt router

The following two lines can be commented out:
#opt wins и #option domain

The backup time ip for the user can be reduced, or left by default - 24 hours:
option lease   86400


Save and exit

We go to menu -> 1) Boot and check that our DHCP server is turned on, line


Save and exit vi editor
Now save the settings menu -> 11) Save and reboot the router menu -> 12) Reboot .
After the reboot, we will go into the router under the new ip and should get the address via DHCP. Also, do not forget that LAN1 is no longer in BR0 and you need to switch to LAN2 or connect via wi-fi with the open SSID "SF-WL".

After reconnecting to the router with a new address, we finally go to the settings for connecting to the Internet.

Again, go to menu -> 1) Boot and edit the following lines:
- turn on the router mode

- enable NAT in router mode

- turn on the firewall

- let the router be a DNS server for the internal network -

The following option is optional, but on the forums it is recommended to disable it due to the fact that the memory on the device is already so small and it’s a pity to spend it on logs:

Save the changes and go to menu -> 2) Interfaces .
Now we need to choose the type of connection to our provider - PPTP, L2TP, PPOE. If your provider just gives you a static or dynamic ip, then you can skip this item.

I will consider the example of PPOE.

- turn on this type of connection

- your username issued by the provider
and accordingly password
allows the router to automatically register the default route
and automatic reconnection


Save and exit.
Go to menu -> 8) Extended Menu -> 2) Iptables . And add a line here that includes forwarding packets to eth0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

For good, you still need to close the ssh port:
iptables -A INPUT -i eth0 -p tcp --destination-port 22 -j DROP

iptables -A INPUT -i eth0 -p udp --destination-port 22 -j DROP

Save and exit. Save in menu -> 11) Save and do 12) Reboot.

After the reboot, the router should raise the ppp0 interface, check it with the ifconfig command.


Trying to ping the world - should work.

5. All that remains for us is to configure wi-fi.
Go to menu -> 3) General and find the WPA line and change it to “yes” thereby turn on the WPA / WPA2 mode
Find the line and change the name of the network to your
ESSID=ваше название сети

Save and exit.
Now go to menu -> 4) WPA . And turn on the WPA2-mixed mode. Change the line
encryption = 4
on the
encryption = 6

We also find the line and duplicate the name of our wi-fi network there
ssid = "ваше название сети"

And of course the network key itself, change the value in quotation marks to your
psk = "1234567890"

Save and exit.
Now menu -> 11) Save, menu -> 12) Reboot.

After the reboot, it remains for us to find our SSID and connect to it with the password that we set and use the Internet.

Bottom line: in fact, the firmware works much more stable than the native D-Link, for two days now without failures and freezes (it hung once a day or two from the native). But compared to the TL-WR1043N it works much slower, heavy sites are reluctant to open, torrents above 1 MB / s do not even go up the cable. But for the 4 Mb / s tariff plan, for which this router was conceived, it’s completely fine.

Sources: Website ng-wive , Forum-ng wive .

Also popular now: