Firmware includes tcpdump, netcat, pptp, tc, dyndns and ntp clients
for D-Link DSL-xxxT devices.
HINT!
To avoid future questions bear in mind that after flashing modified firmware the
login of your D-Link device becomes normal "root", not "admin"! The password can
be set up-to 18 symbols. Needless to say new password will take effect only after
restarting.
Flashing process step-by-step:
1) First of all, upload kernel image file called ***kernel*** to the device
in a usual way, i.e. using D-Link's web interface. Rebooting...
2) After restarting flash ***fs*** image in a like manner. Automate restarting
goes again.
3) Now upload config.xml ( if it is necessary) using restore the configuration
feature. One more reset comes.
To return to "original" firmware:
1) Upload ***fs*** image file, restart.
2) Upload ***kernel*** image.
3) Reinstall config.xml for corresponding FW, if needed...
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc. for 500ô:
f407ce76106ee2cd12f9490e3f6cef2c DSL-500T_kernel_V1.00B02T02.RU.20041224.MC06.1
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc. for 504ô:
748feff0b7a50a3d6df40ea12a5d059f DSL-504T_kernel_V1.00B02T02.RU.20041224.MC06.1
FS firmware based on the 20041224 FW with the DSP firmware 1.01.00.00 for 50xT:
b749e215b53e22059f215d4e20506746 DSL-50xT_fs_V1.00B02T02.RU.20041224.MC06.1_dsp1010000
FS firmware based on the 20041224 FW with the DSP firmware 3.00.08.00 for 50xT:
715fad639bd5123ae41e1d7b37cf6db2 DSL-50xT_fs_V1.00B02T02.RU.20041224.MC06.1_dsp3000800
Current status:
Release candidate 2, version MC06.1. (Fixed version)
What's new:
- Now it's possible to upload iptables' rules right after loading the iptables'
modules. Section start_ipt, for example:
.
.
.
.
.
.
-A INPUT -j DROP
.
- Now you can get the IP Account in a text form with subsequent reset of the counter.
For these purposes wget or similar kind programs can be used:
wget http://192.168.1.1/cgi-bin/ipaccount_txt
- New kernel is added. It should secure the maximum protection from damage of the
env area while "Save All" command is used. The chances of it still persist
still but the appearance of it became more infrequent than before.
Now kernels are to be issued for specific devices:
for 300T, 500T and 504T (the same with G604T)...
---------
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc. for 500ô:
bb34d32c298fcaf31f22488090a3bf50 DSL-500T_kernel_V1.00B02T02.RU.20041224.MC06
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc for 504ô:
2d5722dcc32544133708712d70600fb2 DSL-504T_kernel_V1.00B02T02.RU.20041224.MC06
FS firmware based on the 20041224 FW with DSP firmware 1.01.00.00 for 50xT:
6367efbce7b78c37d39d6e0a045c80ad DSL-50xT_fs_V1.00B02T02.RU.20041224.MC06_dsp1010000
FS firmware based on the 20041224 with DSP firmware 3.00.08.00 for 50xT:
cdacf8cf3c8dc7d13cf26f3589790b3f DSL-50xT_fs_V1.00B02T02.RU.20041224.MC06_dsp3000800
Current staus:
Release candidate 2, version MC06.
What's new:
- In the main page of Dlink's web interface in the Home section version info of
the FW can be found.
- IP AcÓounts. Now it became possible to check the traffic counter of every
IP address on the network after integrating this feature with the web interface.
This option is situated in Status page. To activate it you should edit config.xml
enabling the count_net parameter in the setenv section. Also it is necessary to
fill in the IP address and subnet mask:
.
.
.
.
.
.
192.168.1.0/24
- Utelnetd telnet server is replaced with integrated into busybox one. Now it is
possible to enter long commands and to edit them. Typing commands via Utelnetd
was at random thus it moved the text all the time. Hope this will solve another
problem with Enter command under Win2k/XP telnet clients.
- Now it's possible to start the system in a semi-emergency mode while env is
damaged. Nevertheless it takes to restore env via ADAM2 telnet service.
But it guarantees that mtd disk partitions would not be lost. In such
semi-emergency mode "Status" LED blinks 10 times faster than usually what
gives warning of the env's mtd disks malfunction. As it turned out, it is the
main reason of impossibility to save the configuration and to restore back-uped
mtd3 disk's image. The next (MC07) version of the FW will have integrated tools
for more simple recovery of env area and maintaining the mtd3 disk's backup.
Currently this question is not studied well yet.
---- OLD -----
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc. for 500ô:
3ea2181c8072abfcfa3b1cc9fe6c70b2 DSL-500T_kernel_V1.00B02T02.RU.20041224.MC05
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc. for 504ô:
dc12991a653aa4732aea777a10e03467 DSL-504T_kernel_V1.00B02T02.RU.20041224.MC05
FS firmware based on the 20041224 FW with DSP firmware 1.01.00.00 for 50xT:
dc0aaad5307d9b4c68ae606290894289 DSL-50xT_fs_V1.00B02T02.RU.20041224.MC05_dsp1010000
FS firmware based on the 20041224 FW with DSP firmware 3.00.08.00 for 50xT:
4d0eebc5e2d06a1e3ed4f30adc755620 DSL-50xT_fs_V1.00B02T02.RU.20041224.MC05_dsp3000800
Current status:
Release candidate 3, version MC05.
What's new:
- Lot's of renewals and improvements in the kernel:
In lzma decompressor squashfs vmalloc()&vfree() were replaced with kmalloc()&kfree()
what allowed to optimize the speed of lzma decompression process and enabled the
kernel to work at 300ô devices.
- Netfilter now is replaced with more fresh version (patch-o-matic-20031219), also
several backports from the 2.4.2x kernels were completed to make it work.
- Iptables version 1.2.6a is updated to 1.2.8
- PPTP VPN passthrough is now tested and works. Earlier it was impossible to establish
more than one connection via NAT to PPTP server. Required modules taken out of
elder netfilter version didn't the job, so I had to port new version.
Again, to activate PPTP VPN passthrough it is necessary to edit setenv section
of config.xml and to enter the pptp_nat parameter:
.
.
.
.
.
.
yes
- Big list of netfilter modules working via NAT is added:
Quake III Arena protocol support - insmod ip_conntrack_quake3; insmod ip_nat_quake3
RTSP protocol support - insmod ip_conntrack_rtsp; insmod ip_conntrack_rtsp
MMS(Microsoft Windows Media Services) protocol support - insmod ip_conntrack_mms;
insmod ip_nat_mms
CuSeeMe protocol support - insmod ip_nat_cuseeme
- ARP support & etc.
------- OLD ------
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc. for 500ô:
6e372ddd61a1ff730df059189666a43d DSL-500T_kernel_V1.00B02T02.RU.20041224.MC04
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc. for 504ô:
1f62eaa2dfcb36ef50e98bdc89182786 DSL-504T_kernel_V1.00B02T02.RU.20041224.MC04
FS firmware based on the 20041224 FW with DSP firmware 1.01.00.00 for 50xT:
4c9ccf38047caf6ef34e64dd54b1584b DSL-50xT_fs_V1.00B02T02.RU.20041224.MC04_dsp1010000
FS firmware based on the 20041224 FW with firmware 3.00.08.00 for 50xT:
3af6953d03df276268249b6eff744075 DSL-50xT_fs_V1.00B02T02.RU.20041224.MC04_dsp3000800
Current status:
Release candidate 2, version MC04.
What's new:
- Extremely high load of the CPU by thttpd is fixed. It was the result of the
system and control manager difference in time setting. As interim measure it
was offered to use Internet time synchronization via NTP. Now it is not
necessary.
- New version of busybox from CVS is installed.
--- OLD ----
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc. for 500ô:
6e372ddd61a1ff730df059189666a43d DSL-500T_kernel_V1.00B02T02.RU.20041224.MC03
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs-2.1 etc. for 504ô:
1f62eaa2dfcb36ef50e98bdc89182786 DSL-504T_kernel_V1.00B02T02.RU.20041224.MC03
FS firmware based on the 20041224 FW with DSP firmware 1.01.00.00 for 50xT:
a923ab69bf1443bd42105ae9628de6a3 DSL-50xT_fs_V1.00B02T02.RU.20041224.MC03_dsp1010000
FS firmware based on the 20041224 with DSP firmware 3.00.08.00 for 50xT:
ad0f19ff04d4b9962f483d51dd8e97b2 DSL-50xT_fs_V1.00B02T02.RU.20041224.MC03_dsp3000800
What's new:
- Migration to new squashfs-2.1 is made. Now it became possible to built up more
compact firmwares. Also the memory bug in a work of squashfs had gone.
Squashfs-1.x possesed it - so i had to exepak several binaries, now it is not
necessary.
- Returned back the busybox's init.
- This firmware contains 2 fs images:
*_dsp1010000 - fs image with DSP firmware 1.01.00.00 - is used in last FWs.
*_dsp3000800 - fs image with DSP firmware 3.00.08.00 - is used in old FWs.
If you have problems with connecting to your provider's DSLAM then try these
fs images by turns and leave that which is the most stable in connecting and
holding on.
--------
VERY IMPORTANT!!!
Flash the kernel image exactly into your device! Don't mix it up in no circumstances!
Otherwise the "Recovery" part at the end of this text waits for you.
Since now FS firmware will be available right for 2 devices - 500ô and 504ô,
the only difference is in kernel images.
---- OLD ----
FS firmware based on the 20041224 FW with DSP firmware dated 20040830 D-Link
dbb7f085d12e2438766e768aef587c8f DSL-500T_fs_V1.00B02T02.RU.20041224.MC01
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs etc.:
f1d4c30898683fba494518a4923f1e2d DSL-504T_kernel_V1.00B02T02.RU.20041224.MC01
What's new:
1. Working process on the kernel for DSL-504T device (with the integrated 4 port
switch) is over now. It means the kernel is built up and works :), by the
way - MIPS' disassembler is lassie.
2. DSL-500T's FS images are 100% compatible with DSL-504T that's why separate FS
images for 504ô are not planned be issued. There is no sense in it so all
future FS firmwares will suit two devices at once. Besides, 504ô was not mine
and I had to return - now I am not able to check the work of FS images.
3. Following changes in the FS image were made:
- Busybox is built including integrated netcat, so it became possible to delete
separate version of nc.
- Restored original init busybox. Possibly patched "init" caused the router's
hang up after working for 50 hrs. But may be it was not patched "init"?
- The limit of 8 symbols in the web manager password's length is removed
(original FW had it for some reason).
ATTENTION!
Read the manual attentively! Especially those who intend to install firmwares for
the first time.
----- ---
FS firmware based on the 20041224 FW with DSP firmware dated 20040830 D-Link
cc88ed80ca6cb1996f81a636e047a11f DSL-500T_fs_V1.00B02T02.RU.20041224.MC00
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs etc.:
e640bc8771db9484c1b54ac06bc404a2 DSL-500T_kernel_V1.00B02T02.RU.20041224.MC00
What's new:
1. Additional command "more" is now integrated in busybox.
2. Utilities tcpdump and netcat are added.
3. Uptime bug in web interface is fixed now (D-Link).
4. Modules for PPTP/GRE work behind NAT are added (for testing purposes). To
activate them edit section setenv of config.xml - type pptp_nat parameter:
.
.
.
.
.
.
yes
5. Script wondershaper - wshaper is finished off. Now it became possible to determine
speeds through setenv of config.xml. If are not set exactly they are automatically
taken from the modem. New options for priorities using setenv are implemented.
New options' list:
speeds:
tc_downlink (Kbit)
tc_uplink (Kbit)
high priority:
tc_hipriohostsrc
tc_hipriohostdst
tc_hiprioportsrc
tc_hiprioportdst
low priority:
tc_nopriohostsrc
tc_nopriohostdst
tc_noprioportsrc
tc_noprioportdst
Wshaper itself is situated in the script's folder, so you can examine it in details.
Enumeration of hosts and ports should be typed in gaps, for example:
.
.
.
.
.
.
yes
100
80
111 22 8080
6. Some programs were packed with exepak thus problems with the amount of RAM
appeared.
----- OLD -----
FS firmware based on the 20041410 FW with DSP firmware dated 20040830 D-Link
in LZMA squashfs format:
e1dea00bfd71e717e839c49ca28777fb DSL-500T_fs_V1.00B02T02.RU.20041116.MC.02
Kernel firmware supporting PTY, MPPE, CBQ, HTB, LZMA squashfs etc.:
e640bc8771db9484c1b54ac06bc404a2 DSL-500T_kernel_V1.00B02T02.RU.20041116.MC.02
What's new:
1. uClibc is entirely rebuilt with the support of libm, what allows to port software
with float É double classes using kernel FPU emulator for MIPS architecture.
Compiling the soft don't used the key -msoft-float for gcc!
2. New version of busybox v.1.00 is ported. Including additional integrated commands
such as awk, sed, uptime, ftpget, ftpput, xargs, killall etc.
Whole command list can be seen via telnet. Shell ash(sh) is bult up with the
mathematical operations option using let command or twice round brackets,
like: $((23*54/12)).
3 System kernel is recompiled with the options of QoS (packet scheduler CBQ, HTB,
SFQ, ATM etc.). Still being tested...
4. After replacing of original uClibc and busybox with new ones (including additional
options) it became possible to port TC (traffic control) program for QoS.
QoS function is in testing mode now! Some information concerning TC can be get
here:
http://www.opennet.ru/base/net/adv_route_qos.txt.html (RUSSIAN)
or here:
http://lartc.org/
5. Now the realization of wondershaper 1.1a(HTB) is integrated into the FW. What it
is and how does it work can be learned here:
http://lartc.org/wondershaper/
Script is completelyautomatic and works only in PPP mode. To activate wondershaper
edit section of config.xml file and add the following:
.
.
.
.
.
.
yes
The same name, wshaper, has wondershaper script. It is a little bit improved
comparing to original one - it takes the speeds from /proc/avalanche/avsar_modem_stats
and as the first argument interprets the name of the network interface. Also there is
opportunity to view statistics or to delete rules using the telnet mode:
# wshaper status ppp0
# wshaper stop ppp0
P.S. If someone has his own observations and aditions concerning wondershaper,
then original version of this script used in the FW is situated in the script folder
of current archive.
6. For more advanced and familiar with tc - all rules can be typed into section
of config.xml, but these rules take affect only provided with active
PPP interface. It can happen so that PPP is not used. For such purposes new section
in config.xml was inserted which snaps into action analogously to "external" but
just at the final stage of system booting (init - rcS), i.e. as the network interface
ethX, nasX, brX can be selected. The name of this section - start_init:
.
.
.
.
filter add dev eth0 protocol ip parent 10: prio 1 u32 match ip dport 22 0xffff flowid 10:1
.
filter add dev eth0 protocol ip parent 10: prio 2 flowid 10:2
.
.
P.S. Will remind that FS and KERNEL images now use only LZMA compression.
So if you have original D-Link firmware installed then the procedure for such FW
is the following:
First you load the KERNEL and only then - FS one.
In the case of backflashing the first is FS image to be uploaded and then - KERNEL
one. All these conditions should be meet if you flash FWs using web interface.
To flash FW via service ftp client ADAM2 the order is not important. Just the places
of mtd's partitions are crucial. At the low end of this README the manual how to work
with ADAM2 ftp is added...
----- OLD--------
5b050ed6c02bf59d688edf8d7a4e3eb5 DSL-500T_fs_V1.00B02T02.RU.20041116.20041410.MC.01
fe638543d396e7a24f62831e9f8abe0d DSL-500T_kernel_V1.00B02T02.RU.20041116.MC.01
Changes:
Migration to LZMA compression - more compact FS image's size.
FS firmware based on 20041410 FW with DSP firmware dated 20040830 D-Link:
md5sum a6dfbd33ae4f5d9fa91a8d34cf070f1e DSL-500T_fs_V1.00B02T02.RU.20041116.20041410.MC.00
Kernel firmware supporting PTY and MPPE (recommended):
md5sum f4c6b9773805aec58570732ec0deb192 DSL-500T_kernel_V1.00B02T02.RU.20041116.MC.00
IMPORTANT:
If you make saving of the configuration via web-interface then all additional options listed below would be deleted and you should enter them again! This problem to be solved in future versions?
What's new:
- New kernel image is added.
Basic distinctions comparing to original D-Link's kernel:
- MPPE encryption support is integrated.
- PTY devices support in added.
First of all change the KERNEL firmware, then - FS...
- PPTP (pptp)client is added, also PPPD compiled with the support of PTY, MPPE and MS-CHAP-V2,
it is available under tpppd. To make it work you need to flash new (!) kernel.
To test the PPTP connection type command pptpc via telnet with the following keys:
pptpc [pppd options up to 8 if needed]
(Integrated pppd options - persist maxfail 20 lcp-echo-failure 10 lcp-echo-interval 60)
An example of enabling the VPN vua PPTP from home to your office using the MPPE encryption
(naturally if the server supports this encryption). To make automatic start-up edit .xml config:
.
.
.
.
.
.
.
.
.
.
.
.
-u usrname:password -h myname.homelinux.org -w -r -q
-u ntp1.demos.net clock.uregina.ca ntp1.fau.de ntp.cesnet.cz
100.30.100.30 mcmcc passwDfgh noipdefault mppe-stateful require-mppe
MSD-3
192.168.30.0
255.255.254.0
192.168.40.0
Explanation:
Focus on the new parameters in setenv - vpnnet[x] and vpnnetmask[x]. Let us suppose,
networks 192.168.30.0 with the mask 255.255.254.0 and 192.168.40.0 with the mask
255.255.255.0 are situated in your office. To access them you need to determine routes,
i.e. to set up routing for these networks - that's why these parameters were implemented.
If you don't determine vpnnetmask[x], then subnet mask will be 255.255.255.0. You can
set up to 16 routes (from 0 till 15 ) in the same manner...
Integrated MPPE supports 48bit and 128bit encryption!
/*
To connect using PPTP to your provider you need the presence of nasX network interface.
It is necessary to check its presence with ifconfig command. If it is up and doesn't own
IP then you should restart this interface with proper address which your provider assigned:
ifconfig nasè down
ifconfig nasè up /* you can also set subnet mask - netmask */
Because of I my provider has no such service all written above is just in testing stage.
In the future, after the finish of testing,
*/
- Value in ip_conntrack_tcp_timeout_close_wait is noticeably decreased to 60 seconds.
- The size of active connections table ip_conntrack_max is increased. Before - 1024,
now 2048. it should improve the work in p2p (edonkey & etc). Since the device have small
amount of memory - 16Mb I recommend to set the size of 1024. So consider the appearance of
situation with the lack of memory - I don't advise to establish big amount of active
connections (!).
- Added Timezone option allows the device to show time under the terms of your time zone.
To set it new segment setenv with t_zone part was added. There you should enter your zone
relatively to UTC.
Example:
.
.
.
.
.
.
.
.
.
.
.
.
/* Out earlier added segment for ntpdate and ddns */
.
.
.
/* New segment for environment variable options, to be used later on */
MSD-4 /* Setting of Moscow Time zone which is 4hts before the UTC.
So we take MSD zone and subtract 4 (or 3). */
If you type date command in the console the time should be listed under your time zone, e.g. Tue Oct 19 14:06:01 MSD 2004
This option works only in the telnet and it doesn't have influence on the web-based manager, it shows time just in UTC. I didn't check whether it was fixed in last firmwares but now its own ntp client works in them.
- (!) Only for secialists: Xmlstarter is rewritten so now you can create ypur own segment in the XML config and call them via arguments::
.
.
-u ntp1.demos.net
.
.
To be called as ./xmlstarter my_uzel, i.e. everything what is in my_uzel segment will be processed.
Also it necessitated to set the environment variable whyle the system is booting up, e.g setting of the timezone
.
.
MSD-3
.
.
It's called as ./xmlstarter my_uzel timezone, but in practice it turn out the following way,
little alterations is to be made to starting script /etc/init.d/rcS:
# Set timezone
if [ -f /var/tmp/tincfg.xml ]
then
GTZ=`xmlstarter my_uzel timezone`
if [ ! -z "$GTZ" ]
then
export TZ=$GTZ
fi
fi
# End
Thus we can set any variable while the system's boot by determining 2 arguments for xmlstarter.
New version of xmlstarter is situated in the src directory.
Update:
1. First download XML config from the device via the web interface: go to "Tools" part, choose
"Update Gateway", there is "Configuration - Backup & Restore", push "Back Up" button, browser
should offer you to save config.xml, save it wherever you want.
2. Now you should edit received file. Be extremely exact - avoid mistakes and do everything as
I describe. At first let's look into the structure of this XML config:
.
.
.
.
.
.
.
.
.
.
.
.
It's obvious that basic segment contains 3 parts such as entities, modules and dependencies.
My idea is to add the fourth segment called "external". It's structure is like this:
.
.
.
-u usrname:password -h myname.homelinux.org -w -r -q
-u ntp1.demos.net clock.uregina.ca ntp1.fau.de ntp.cesnet.cz
"External's" modules use the names of launched programs. Required options for these
programs are inside them. Now being acquainted with everything let's add necessary
modules in the such form into our config.xml. If you need "iptables" to start you can
set the launch in the same way. You can do this so ever: in special editing program
or using usual text editor. But keeping mind that config.xml has no tabulation or line
feed marks and it looks like one long line. So special editors can add the identification
string at the very top - you need to delete it!
3. Everything is to be made in a same way as in the first point up to the moment of config's
loading. Now edited config file should be restored back. To do so use "Select a Configuration file",
select your file and press Restore button. If your config has no errors it uploads now and the device
reboots.
4. Now upload new firmware in a usual way.
ddns - dyndns client based on dyndnsupdate-0.6.14
Options are:
-a, --address Ip address (Required or -r or -i).
-b, --backmx Set backup mx ON, default is OFF.
-d, --debug Show communication with server.
-f, --force Force update when ipaddress is not changed.
-h, --host ,[host] Host/hostnames (Required).
-i, --interface Network device to grab ip address from
(Required or -a or -r).
-l, --syslog Log all messages to syslog. (Disable!!!)
-m, --mx Hostname of your mail exchange.
-o, --offline Set host offline.
-q, --quiet Don't print any status/error messages.
-r, --resolv Resolv your ip address automaticly
(Required or -a or -i).
-s, --system[dyndns:statdns:custom]
Use only one of dyndns, statdns or custom
(Without the -s/--sytem default is "dyndns").
-u, --user : User ID and Password (Required).
-w, --wildcard Set your domain for wildcard aliases ON,
defalut is OFF.
--help displays this help.
--version displays version information.
--credits displays credits.
ntpdate - ntp client which takes time from internet and sets it as system. In this device the time is in UTC standard.
usage: ntpdate [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-r rate]
[-t timeo] [-U username] server ...
COMMAND LINE OPTIONS
-a key Enable the authentication function and specify the key
identifier to be used for authentication as the argument key
ntpdate . The keys and key identifiers must match in both the
client and server key files. The default is to disable the
authentication function.
-B Force the time to always be slewed using the adjtime() system
call, even if the measured offset is greater than +-128 ms. The
default is to step the time using settimeofday() if the offset
is greater than +-128 ms. Note that, if the offset is much
greater than +-128 ms in this case, that it can take a long
time (hours) to slew the clock to the correct value. During
this time. the host should not be used to synchronize clients.
-b Force the time to be stepped using the settimeofday() system
call, rather than slewed (default) using the adjtime() system
call. This option should be used when called from a startup
file at boot time.
-d Enable the debugging mode, in which ntpdate will go through
all the steps, but not adjust the local clock. Information use-
ful for general debugging will also be printed.
-e authdelay Specify the processing delay to perform an authenti-
cation function as the value authdelay , in seconds and frac-
tion (see ntpd for details). This number is usually small
enough to be negligible for most purposes, though specifying a
value may improve timekeeping on very slow CPU's.
-k keyfile Specify the path for the authentication key file as the
string keyfile . The default is /etc/ntp.keys . This file
should be in the format described in ntpd .
-o version Specify the NTP version for outgoint packets as the
integer version , which can be 1 or 2. The default is 3. This
allows ntpdate to be used with older NTP versions.
-p samples Specify the number of samples to be acquired from each
server as the integer samples , with values from 1 to 8 inclu-
sive. The default is 4.
-q Query only - don't set the clock.
-s Divert logging output from the standard output (default) to the
system syslog facility. This is designed primarily for conve-
nience of cron scripts.
-t timeout Specify the maximum time waiting for a server response
as the value timeout , in seconds and fraction. The value is is
rounded to a multiple of 0.2 seconds. The default is 1 second,
a value suitable for polling across a LAN.
-u Direct ntpdate to use an unprivileged port or outgoing pack-
ets. This is most useful when behind a firewall that blocks
incoming traffic to privileged ports, and you want to synchro-
nise with hosts beyond the firewall. Note that the
-U user_name ntpdate process drops root privileges and changes
user ID to user_name and group ID to the primary group of
server_user.
-d option always uses unprivileged ports.
- v Be verbose. This option will cause ntpdate 's version identi-
fication string to be logged.
Copyright (C) 2005,2004 McMCC
Recovery HOWTO:
--------- The firmware was not properly installed -------
URL: http://www.dlink.ru/phorum/viewtopic.php?t=6143
All D-Link modems (and not only) have service FTP server ADAM2 with the fixed IP
address 10.8.8.8(for DSL-G604T - 10.48.88.66). In Linux you can simply start up
eth0:1 subinterface, having root privileges of course:
[root@mcmcc root]# ifconfig eth0:1 10.8.8.7 up
Next i strated ftp with the IP 10.8.8.8:
[igor@mcmcc igor]$ ftp 10.8.8.8
After that I turned on the modem keeping reset button pressed (but it is not so
necessary - you just need to establish ftp connection while the modem early start)
and then released it. In couple seconds I received the invitation and proceeded
with the recovery process as it is listed below:
Connected to 10.8.8.8.
220 ADAM2 FTP Server ready.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (10.8.8.8:igor): adam2
331 Password required for adam2.
Password: adam2
230 User adam2 successfully logged in.
Remote system type is UNIX.
ftp> debug
Debugging on (debug=1).
ftp> bin
---> TYPE I
200 Type set to I.
ftp> quote MEDIA FLSH
---> MEDIA FLSH
200 Media set to FLSH.
ftp> put fs.img "fs.img mtd0"
local: fs.img remote: fs.img mtd0
---> PASV
227 Entering Passive Mode (10,8,8,8,162,0).
---> STOR fs.img mtd0
150 Opening BINARY mode data connection for file transfer.
226 Transfer complete.
1318920 bytes sent in 30.3 seconds (54 Kbytes/s)
ftp> quote REBOOT
---> REBOOT
221-Thank you for using the FTP service on ADAM2.
221 Goodbye.
ftp> quit
---> QUIT
Some comments:
I enabled debug mode for more obviousness. Be sure you enabled BINARY mode with the
"bin" command right before typing "quote MEDIA FLSH". Now let's talk bout the MTD
table, i.e. partitions on the flash disk:
mtd0: FS image (to make it more simple I renamed it to fs.img which uploaded to the modem)
mtd1: kernel image
mtd2: service ftp server ADAM2 in person ;)
mtd3: Environment + config.xml
Environment is in the same place where config.xml is, i.e. in the beginning right
before config.xml. Besides this is the reason I do not recommend to flash config.xml
in such a way otherwise you can get environment area damaged. Writing process of the
config.xml in D-links is not direct to mtd3 - to /dev/ticfg device which makes a gap
of the first block in mtd3.
(Ó) McMCC, 2004
--------------
P.S.
While I examined and experimented on the kernel I made this recovery process very often.
But I didn't hold RESET because the device activated ADAM2 service ftp by itself.
Kernel image should be uploaded to mtd1 definitely! Not to any other device! ADAM2 is similar
to BIOS program and has integrated FTP-server, console and can work with BOOTP.
Lot's of useful info was taken here:
http://www.akk.org/~enrik/fbox/recovery.txt
---- Environment area was damaged ---
http://www.dlink.ru/phorum/viewtopic.php?t=6548
Q. Right after entering "put fs.img "fs.img mtd0" command I get this:
550: environment variable not set.
put fs.img: server said: environment variable not set.
Cannot open local file fs.img mtd0 for reading (errno = 2).
put fs.img mtd0: could not open file.
WTF? Why? I despond...:(:(:(
A.
It's simple enough - you have damaged environment area. And there is only one way
to recover it - using telnet with the port 21 of 10.8.8.8(For DSL-G604T - 10.48.88.66):
$ telnet 10.8.8.8 21
Trying 10.8.8.8...
Connected to 10.8.8.8
Escape character is '^]'.
220 ADAM2 FTP Server ready.
USER adam2 (entered by user)
331 Password required for adam2.
PASS adam2 (entered by user)
230 User adam2 successfully logged in.
Some details concerning commands:
GETENV - To get info about "key"
For exmple:
GETENV mtd0
The response should be such:
mtd0 0x900a0000,0x903f0000
If you don't get it - then be sure that environment area is damaged.
SETENV , - to set the value of "key
UNSETENV - Deletes key
It's advisable to make sure of which values are absent in "enviroment".
If not all present then remember which are not. Not avoid typing them see the
full list of values for 500T:
memsize 0x01000000
flashsize 0x00400000
modetty0 38400,n,8,1,hw
modetty1 38400,n,8,1,hw
bootserport tty0
cpufrequency 150000000
sysfrequency 125000000
bootloaderVersion 0.22.02
ProductID AR7DB
HWRevision Unknown
SerialNumber none
my_ipaddress 10.8.8.8
maca 00:0X:XX:XX:XX:D2
prompt Adam2_AR7DB
firstfreeaddress 0x9401d328
req_fullrate_freq 125000000
mtd0 0x900a0000,0x903f0000
mtd1 0x90010000,0x900a0000
mtd2 0x90000000,0x90010000
mtd3 0x903f0000,0x90400000
autoload 1
usb_vid 0x0
usb_pid 0x0
usb_man N/A
usb_prod N/A
Here "key"s go the first. Their values are after the gap. MAC address of your
device can be found on the sticker which is between ADSL and LAN ports. If
"enviroment" is entirely damaged then you have to enter everything. Above
all is the fact of "SETENV command successful" response for entering every
parameter.
Here are commands to be entered:
SETENV mtd3,0x903f0000,0x90400000
SETENV memsize,0x01000000
SETENV flashsize,0x00400000
SETENV modetty0,38400,n,8,1,hw
.... (etc)
SETENV mtd0,0x900a0000,0x903f0000
SETENV mtd1,0x90010000,0x900a0000
SETENV mtd2,0x90000000,0x90010000
Above are entered parameters for mtd3
.... (etc.)
SETENV usb_prod,N/A
And finally do this command:
REBOOT
And get this answer:
221-Thank you for using the FTP service on ADAM2.
221 Goodbye.
Connection closed by foreign host.
After rebooting everything should work ok. Recently I proceeded with everything
with the device of my friend which didn't boot. But if you don't clearly understand
what is written above then I can only advise not to do anything by yourself and to
bring the device to warranty service center (not the fairest way, of course?)
================================
Mokruchin I.V. aka McMCC
mcmcc@mail.ru
================================
-= (c)2005 Translated by Afad =-