DIR-300 sous OpenWRT

Attention ne concerne que la révision B du Dir-300

On ne trouve pas les firmwares pour le Dlink Dir-300B dans les downloads du site OpenWrt, aussi les voici ci-dessous en version Backfire 10.03.1, en factory reset et mise à jour.

openwrt-ramips-rt305x-dir-300-b1-squashfs-factory.bin
openwrt-ramips-rt305x-dir-300-b1-squashfs-sysupgrade.bin

L’interface graphique est une version trunk de Luci, pas forcément très stable, voir l’installation de Luci.

On obtient le fonctionnement en point d’accès (les 5 prises RJ45 + wifi dans le même bridge), en retouchant les fichiers de configuration suivants :

/etc/config/network

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'

config 'interface' 'lan'
        option 'ifname' 'eth0.1 eth0.2'
        option 'type' 'bridge'
        option 'proto' 'dhcp'

 /etc/config/wireless

config 'wifi-device' 'radio0'
        option 'type' 'mac80211'
        option 'channel' '11'
        option 'hwmode' '11ng'
        option 'htmode' 'HT20'
        list 'ht_capab' 'GF'
        list 'ht_capab' 'SHORT-GI-20'
        list 'ht_capab' 'SHORT-GI-40'
        list 'ht_capab' 'RX-STBC1'
        # Contrairement a ce qui est mentionne dans le fichier par defaut
        # ne pas supprimer la ligne ci-dessous, mais mettre l'option a 0,
        # car elle est utilisee par l'utilitaire wifitoggle
        option 'disabled' '0'

config 'wifi-iface'
        option 'device' 'radio0'
        option 'network' 'lan'
        option 'mode' 'ap'
        option 'ssid' 'OpenWrt'
        option 'encryption' 'psk2'
        option 'key' '1234567890123456'

/etc/config/wifitoggle

config wifitoggle
        option button   'wps'
        option device   'radio0'
        # Le changement d'etat est permanent ou d'une duree
        # indiquee par l'option timer
        option persistent       '1'
        option timer            '600'
        option led_sysfs                'd-link:blue:wps'
        option led_enable_trigger       'timer'
        option led_enable_delayon       '500'
        option led_enable_delayoff      '500'
        option led_disable_default      '0'

Dmesg de boot sur le port série sous OpenWRT


La connexion série est à paramétrer en 57600 8N1.

U-Boot 1.1.3 (Jan 13 2009 - 17:40:14) (Alpha) - SVN revision : 105

Model: WRGN23

Board: RT2880 DRAM:  32 MB
twe0 set to <NULL>
toe0 set to <NULL>
============================================
Ralink UBoot Version: 3.1 Alpha
--------------------------------------------
ASIC 3052_MP2 (MAC to GigaMAC Mode)
DRAM COMPONENT: 256Mbits
DRAM BUS: 16BIT
Total memory: 32Mbytes
Date:Jan 13 2009  Time:17:40:14
============================================
icache: sets:128, ways:4, linesz:32 ,total:16384
dcache: sets:128, ways:4, linesz:32 ,total:16384

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   9: Load Boot Loader code then write to Flash via TFTP.
  0 seconds ...

Eth0 (10/100-M) :  ethaddr = (00:26:5a:a2:xx:xx) 00 26 5A A2 xx xx
3: System Boot system code via Flash.
## Powering down port 0 ~ 3.
## Booting image at bf050000 ...
   Image Name:   MIPS OpenWrt Linux-2.6.39.4
   Created:      2012-01-02  11:54:56 UTC

 System Control Status = 0x23400000
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    806906 Bytes = 788 kB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

[    0.000000] Linux version 2.6.39.4 (marc@cfk06) (gcc version 4.5.4 20110808 (prerelease) (Linaro
GCC 4.5-2011.08) ) #2 Mon Jan 2 12:54:45 CET 2012
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24Kc)
[    0.000000] Ralink RT3052   id:1 rev:3 running at 320.00 MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=DIR-300-B1 mtdparts=physmap-flash.0:192k(u-boot)ro,64k(de
vdata)ro,64k(devconf)ro,832k(kernel),2944k(rootfs),3776k@0x50000(firmware) console=ttyS1,57600 rootf
stype=squashfs,jffs2
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Writing ErrCtl register=0001624c
[    0.000000] Readback ErrCtl register=0001624c
[    0.000000] Memory: 30020k/32768k available (1851k kernel code, 2748k reserved, 315k data, 156k i
nit, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:48
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.010000] Calibrating delay loop... 212.58 BogoMIPS (lpj=1062912)
[    0.090000] pid_max: default: 32768 minimum: 301
[    0.090000] Mount-cache hash table entries: 512
[    0.100000] NET: Registered protocol family 16
[    0.110000] MIPS: machine is D-Link DIR-300 B1
[    0.130000] bio: create slab <bio-0> at 0
[    0.140000] Switching to clocksource MIPS
[    0.150000] NET: Registered protocol family 2
[    0.160000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.180000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.190000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.210000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.220000] TCP reno registered
[    0.220000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.240000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.250000] NET: Registered protocol family 1
[    0.310000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.320000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red
Hat, Inc.
[    0.340000] msgmni has been set to 58
[    0.350000] io scheduler noop registered
[    0.360000] io scheduler deadline registered (default)
[    0.370000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.380000] serial8250: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A
[    0.400000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
[    0.420000] physmap platform flash device: 00800000 at bf000000
[    0.430000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2
Chip ID 0x0022a8
[    0.450000] Amd/Fujitsu Extended Query Table at 0x0040
[    0.460000]   Amd/Fujitsu Extended Query version 1.1.
[    0.470000] number of CFI chips: 1
[    0.480000] 6 cmdlinepart partitions found on MTD device physmap-flash.0
[    0.490000] Creating 6 MTD partitions on "physmap-flash.0":
[    0.500000] 0x000000000000-0x000000030000 : "u-boot"
[    0.520000] 0x000000030000-0x000000040000 : "devdata"
[    0.530000] 0x000000040000-0x000000050000 : "devconf"
[    0.550000] 0x000000050000-0x000000120000 : "kernel"
[    0.560000] 0x000000120000-0x000000400000 : "rootfs"
[    0.580000] mtd: partition "rootfs" set to be root filesystem
[    0.590000] mtd: partition "rootfs_data" created automatically, ofs=370000, len=90000
[    0.600000] 0x000000370000-0x000000400000 : "rootfs_data"
[    0.620000] 0x000000050000-0x000000400000 : "firmware"
[    0.650000] TCP westwood registered
[    0.650000] NET: Registered protocol family 17
[    0.660000] 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
[    0.680000] All bugs added by David S. Miller <davem@redhat.com>
[    0.700000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    0.710000] Freeing unused kernel memory: 156k freed
[    2.970000] input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
[    3.060000] Button Hotplug driver version 0.4.1
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
[    6.740000] JFFS2 notice: (346) jffs2_build_xattr_subsystem: complete building xattr subsystem, 2
3 of xdatum (0 unchecked, 22 orphan) and 31 of xref (0 dead, 25 orphan) found.
switching to jffs2
- init -

Please press Enter to activate this console. [    9.200000] Compat-wireless backport release: compat
-wireless-2011-11-29
[    9.210000] Backport based on wireless-testing.git master-2011-12-01
[    9.390000] cfg80211: Calling CRDA to update world regulatory domain
[   10.000000] cfg80211: World regulatory domain updated:
[   10.010000] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   10.030000] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.050000] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   10.060000] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   10.080000] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.090000] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.610000] usbcore: registered new interface driver usbfs
[   10.620000] usbcore: registered new interface driver hub
[   10.640000] usbcore: registered new device driver usb
[   11.750000] PPP generic driver version 2.4.2
[   11.850000] tun: Universal TUN/TAP device driver, 1.6
[   11.860000] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[   12.230000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.780000] NET: Registered protocol family 24
[   12.960000] nf_conntrack version 0.5.0 (471 buckets, 1884 max)
[   14.000000] dwc_otg: version 2.72a 24-JUN-2008
[   16.800000] device eth0.1 entered promiscuous mode
[   16.810000] device eth0 entered promiscuous mode
[   16.870000] br-lan: port 1(eth0.1) entering forwarding state
[   16.880000] br-lan: port 1(eth0.1) entering forwarding state
[   18.020000] device eth0.2 entered promiscuous mode
[   18.030000] br-lan: port 2(eth0.2) entering forwarding state
[   18.040000] br-lan: port 2(eth0.2) entering forwarding state
[   19.050000] device wlan0 entered promiscuous mode
[   19.060000] br-lan: port 3(wlan0) entering forwarding state
[   19.070000] br-lan: port 3(wlan0) entering forwarding state
[   21.710000] device wlan0 left promiscuous mode
[   21.720000] br-lan: port 3(wlan0) entering forwarding state
[   21.990000] device wlan0 entered promiscuous mode
[   22.000000] br-lan: port 3(wlan0) entering forwarding state
[   22.010000] br-lan: port 3(wlan0) entering forwarding state
[   28.840000] ramips-wdt: timeout value 60 must be 0 < timeout < 40

BusyBox v1.19.3 (2011-12-30 22:45:21 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 ATTITUDE ADJUSTMENT (bleeding edge, r29637) ----------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@dir314:/#