Tag Archives: dd-wrt

dir-320 dd-wrt link speed

Standard in the firmware dd-wrt is a function of changes in link speed (10/100 mb/s) that shit is not working!
Because with this had to search a suitable solution is found:

robocfg

The only utility audit port for dir-320, which fully works. It is possible to disable / enable the ports individually, translate the port in different modes (none | disable | block | listen | learn | forward), tagging, and velocity of the interface. Similar utilities such as ethtool and mII-tooles fail (stupidly did not work).

simple usage

./robocfg port 3 media 10FD

thats make port 3 to 10 mbs. how its so easy. I'm using it because my cabble in not good.

backup dd-wrt

Settings of such equipment is typically stored in nonvolatile memory. The devices can be found in the proc / mtd

root @ router: ~ # cat / proc / mtd
dev: size erasesize name
# Boot
mtd0: 00040000 00010000 "cfe
"
# Kernel
mtd1: 003b0000 00010000 "linux
"
# Root filesystem
mtd2: 001db400 00010000 "rootfs
"
# Parameters
mtd3: 00010000 00002000 "nvram
"
# Free partition (where I keep extra initialization scripts)
mtd4: 000f0000 00010000 «ddwrt»

Now, where do a full dump of interest to us section, and save somewhere on your computer.

# Do a dump
root @ router: ~ # dd if = / dev/mtdblock/3 of = / tmp / config.dd
128 0 records in
128 0 records out
root @ router: ~ #

# Save to your computer
yurial @ note: ~ $ scp root@192.168.0.1: / tmp / config.dd config.dd

To restore the settings to produce the inverse operation, and reboot.

# Copy the settings from your PC to your device
yurial @ note: ~ $ scp config.dd root@192.168.0.1: / tmp / config.dd

# Copy the settings from the dump
root @ router: ~ # dd if = / tmp / config.dd of = / dev/mtdblock/3
# Reboot
# Ps before rebooting unplug usb-connected devices
root @ router: ~ # reboot-f

In general, this way you can make a backup, not only for firmware dd-wrt, and not only on dir-320. Such a method suitable, for example, to backup iphone, or geeksphone.

PS: on my dir-320 under its own firmware before restarting I would do a sync, to make sure that all data were recorded. However, under dd-wrt I, this led to the crash.

dd-wrt backup

Settings of such equipment is typically stored in nonvolatile memory. The devices can be found in the /proc/mtd

root@router:~# cat /proc/mtd
dev:    size   erasesize  name
#loader
mtd0: 00040000 00010000 "cfe"
#kernel
mtd1: 003b0000 00010000 "linux"
#root file system
mtd2: 001db400 00010000 "rootfs"
#settings
mtd3: 00010000 00002000 "nvram"
#free partition (I keep it extra initialization scripts)
mtd4: 000f0000 00010000 "ddwrt"

Now, where do a full dump of interest to us section, and save somewhere on your computer.

#dump
root@router:~# dd if=/dev/mtdblock/3 of=/tmp/config.dd
128+0 records in
128+0 records out
#store on your computer
yurial@note:~$ scp root@192.168.0.1:/tmp/config.dd config.dd

To restore the settings to produce the inverse operation, and reboot.

#copy the settings from your PC to your device
yurial@note:~$ scp config.dd root@192.168.0.1:/tmp/config.dd
#copy the settings from the dump
root@router:~# dd if=/tmp/config.dd of=/dev/mtdblock/3
#reboot
#ps  before rebooting, disconnect usb-connected devices
root@router:~# reboot -f

In general, this way you can make a backup, not only for firmware dd-wrt, and not only on dir-320. Such a method suitable, for example, to backup iphone, or geeksphone.

PS: on my dir-320, under my own firmware before restarting I would do a sync, to make sure that all data were recorded. However, under dd-wrt I, this led to the crash.

dir-320 + dd-wrt + gcc (compiling under dir-320)

We go on dd-wrt.com. In section download firmware for dir-320 – dd-wrt.v24_usb_generic.bin (latest v24).

It is required console tftp, it is possible to establish through the manager of installation of standard applications in windows, as and in linux.

We keep in some folder under a name firmware.bin. We open the console №1, we pass in a folder where  firmware.bin, we make a command «tftp 192.168.0.1 ″, we prepare a command« put firmware.bin»

We open the second console, we write and it is started «ping-f 192.168.0.1 ″ (for linux)« ping 192.168.0.1-n 1000 ″ (for win). ICMP the answer shouldn't come back, if, of course, at a router ip not 192.168.0.1.

We switch off a router power, then turn on it. It is necessary to seize that moment when there will be answers from a router in the second console. During this moment it is necessary to start in advance prepared command in the first console.

If all has passed successfully there will be a message in the first console that the firmware is successfully loaded. Otherwise we repeat above written.

It is necessary to wait burning of a light-emitting diode «status», or occurrences of a wireless network «dd-wrt» that signals that the router is booting with new firmeware successfully!

As a result we receive a router with an firmeware dd-wrt.

For the next we will need in flash drive with ext2fs. It is possible to format in any way. An example for linux Ubuntu.

# mkfs.ext2/dev/sdb1

As a result it is received flash drive with section ext2fs.

We insert it in USB router port.

We correct router options through web. Under the standard now at router IP will be 192.168.1.1. In an address line of the browser we write 192.168.1.1.  Login/pass – admin/admin. Further Services-> USB. To include points on «Base support USB","Support USB 1.1 (OHCI)","Support of USB-disks","Support file.system ext2/ext3 ″,« Automatic Drive Mount », others to disconnect. Assembling point«/opt». Further button" Apply ". The router reboots.

Further a tab «servicing» (penultimate). It is necessary to include «Support JFFS2. As we press point to apply. The router reboots.

Now it is necessary to come a telnet on a router.

# telnet 192.168.1.1

login/pass – root/admin.

Whether now it is necessary to check up mounted a flash drive.

# mount

If there is a point/dev/discs/disc0/part1 on/opt type ext2 (rw), means mounted.

Further we mount a folder jffs.

# mkdir/opt/jffs/

# mount-o bind/opt/jffs//jffs/

All. The system is ready to installation!!

We put optware.

# wget-O/tmp/prep_optware http://wd.mirmana.com/prep_optware

# sh/tmp/prep_optware

Process long. We wait.

We load/is updated a tree of packages.
# ipkg-opt update

We put buildroot.
# ipkg install buildroot
Process as the long.

We export enviroments the necessary.
# export LD_LIBRARY_PATH =/opt/lib: $ LD_LIBRARY_PATH

All. Now it is possible to compile the programs on C.

#gcc <input file>-o <outputfile>