OpenWrt Forum Archive

Topic: Using OpenWrt through a D-Link DSL-321B

The content of this topic has been archived on 2 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi guys,

I have some trouble using OpenWrt running on my ASUS WL-500GV2 router through a D-Link DSL-321B modem.

I have to realize that this modem is not just a standard modem that any ISP gives you.  Normally I would just configure OpenWrt with PPPoE with a standard modem to use ADSL, but this modem establishes a PPPoE connection itself and provides DHCP to access the established connection.

The following configuration gets the connection parameters from the modem through DHCP, but doesn't create a default route.

root@OpenWrt:~# uci show network
network.eth0=switch
network.eth0.vlan0=0 1 2 3 5*
network.eth0.vlan1=4 5
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan.type=bridge
network.lan.ifname=eth0.0
network.lan.proto=static
network.lan.netmask=255.255.255.0
network.lan.ipaddr=192.168.0.1
network.wan=interface
network.wan.ifname=eth0.1
network.wan.keepalive=30
network.wan.mtu=1492
network.wan.defaultroute=1
network.wan.ppp_redial=persist
network.wan.gateway=192.168.1.1
network.wan.netmask=255.255.255.0
network.wan.proto=dhcp

root@OpenWrt:~# ifup wan
udhcpc (v1.11.2) started
Sending discover...
Sending select for 78.92.218.197...
Lease of 78.92.218.197 obtained, lease time 60
udhcpc: ifconfig eth0.1 78.92.218.197 netmask 255.255.255.255 broadcast +
udhcpc: setting dns servers: 84.2.46.1

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:1F:C6:D6:C6:A5
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20228 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1596420 (1.5 MiB)  TX bytes:1725362 (1.6 MiB)

eth0      Link encap:Ethernet  HWaddr 00:1F:C6:D6:C6:A5
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28649 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27853 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2656967 (2.5 MiB)  TX bytes:2662867 (2.5 MiB)
          Interrupt:4

eth0.0    Link encap:Ethernet  HWaddr 00:1F:C6:D6:C6:A5
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25185 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20228 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1700365 (1.6 MiB)  TX bytes:1806274 (1.7 MiB)

eth0.1    Link encap:Ethernet  HWaddr 00:1F:C6:D6:C6:A5
          inet addr:78.92.218.197  Bcast:78.92.218.197  Mask:255.255.255.255
          UP BROADCAST RUNNING MULTICAST  MTU:1492  Metric:1
          RX packets:3465 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7626 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:441016 (430.6 KiB)  TX bytes:601838 (587.7 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:37369 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37369 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2231527 (2.1 MiB)  TX bytes:2231527 (2.1 MiB)

root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 br-lan

root@OpenWrt:~# route add default gw eth0.1
route: resolving eth0.1

root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 br-lan

As you can see, I cannot add the default route manually.

Please let me know what am I missing.

Thank you very much!

Same problem here.
I think there's a bug in udhcp, or better, the dhcp server of the modem is badly implemented so it's giving troubles!
You could manually edit the routing table but however you'll lose packet at every renew. (60s!!)

Any other dhcp client available outside busybox?

(Last edited by kle on 13 Jul 2009, 09:22)

I'm trying to get it working with dhcpcd, it seems to go okay.

How can I now replace udhcp in the scripts? Any way to set it as the default client?

If I remember correctly some 320B (are they different from 321B?) shipped with a bugged dhcp server. D-Link resolved the problem in a firmware update.

Yes, I'm using the DSL-320B and it's damnly bugged.. Even with the latest firmware! sad

OpenWRT receive the correct DHCPOFFER only whe using dhcpcd.
By using the default udhcpc included in busybox it can't get the correct routes and worst of all the interface is deconfigured at every renewal (less than 60s!).
I can't use static setup since the public IP address is dynamic. sad

So, this is the new question:
How could I replace udhcpc in the whole system? (Already here: http://forum.openwrt.org/viewtopic.php?id=21065)

(Last edited by kle on 14 Jul 2009, 14:17)

ath wrote:

some 320B (are they different from 321B?)

I think 321B is Annex B, 320B is Annex A.

As I read your posts I'm getting more and more fed up with this modem.

OpenWrt worked magically with the old modem that my ISP gave me (and evetually took away to replace it with an integrated non hacker friendly box which I kicked out in the meantime).  OpenWrt also works beautifully with the Huawei modem that I bought in the meantime.  Mind you, these two modems don't have any fancy useless web admin interface, but *standard compliance*.

Not only the DHCP daemon of the D-Link modem is crappy, I cannot even change the network number of it because of a bug in the web interface.  It is my opinion the D-Link creates mediocre products but this one seems clearly inferior to me according to the above opinions and my experience.  What's about this bug on your modem, guys?

There was a note in the box of the modem mentioning that it runs on GPL'ed software, so they do have to publicize the source.  I found a page in the past somewhere under a D-Link related domain that supposedly had the source but all I got was some useless binary garbage of several megabytes instead of a compressed file that contains the source.  I couldn't even find a binary firmware.  Anyone did?

(Last edited by mondalaci on 16 Jul 2009, 01:24)

I've just plugged in my DSL-321B after using my Huawei SmartAX MT800u-T for a long time and it worked perfectly!  So the DSL-321B *does work* with the ASUS WL500GPV2 running Kamikaze.

Unfortunately I don't know what have been changed since my last try but in case you're interested my OpenWrt configuration can be found at http://monda.hu/blog/2009/08/17/install … wl500gpv2/

Cheers!

The discussion might have continued from here.