Welcome Guest ( Log In | Register )

Bump Topic Topic Closed RSS Feed

Outline · [ Standard ] · Linear+

 Attn Dlink 500T user: beware, Strange problem

views
     
wilson88
post Jan 13 2006, 01:35 AM

Dupe Acc
******
Senior Member
1,807 posts

Joined: Jul 2005
From: World Wide Web
QUOTE(Toshihiko @ Aug 9 2005, 11:38 PM)
Solution:

Telnet Scripting for the DSL-G604/504T/.......
 
Several posts in this DSL-G604T/504T/....... support forum provide examples of how to Telnet to the router and issue commands.

There is however a problem in that while the operation of the router can be changed, the changes cannot always be saved to a configuration backup file (config.xml) and are lost when the router is rebooted, and must be re-issued.

This post documents how to automate this process, and how to simplify the re-issuing of commands should it be necessary to reboot or restart the router.

The process is called Telnet Scripting. To use it you need:
- a Telnet Scripting tool
- a file containing Telnet commands (that is, a script file)

The Telnet Scripting tool that I use is TST10.EXE, written by Albert Yale. It can be downloaded from here (http://users.skynet.be/bk330420/gg/TST10.zip). [Aside: Read about other tools from Albert Yale here]

Here's a trivial example of its use, a script to login to the DSL-G604T and display the help text:

192.168.1.1 23
WAIT "login:"
SEND "root\m"
WAIT "Password:"
SEND "admin\m"
WAIT "#"
SEND "help\m"
WAIT "#"

The script assumes the default IP address of the router (192.168.1.1) and the default login password (admin).

If the script were stored in the file help.txt then the command to issue it (assuming it is in the same directory as TST10.EXE) would be:

tst10 /r:help.txt

Info on the script syntax and the parameters of TST10.EXE can be found by running the program.

A real life example of where this is useful is given below. This provides a script to set the NAT session parameters for success (?) with P2P applications, by increasing the number of concurrent NAT sessions and setting appropriate timeout values to ensure 'stale' session data is discarded. Acknowledgement and thanks to a post by samPT in this forum for the values.


192.168.1.1 23
WAIT "login:"
SEND "root\m"
WAIT "Password:"
SEND "admin\m"
WAIT "#"
SEND "cd /proc/sys/net/ipv4/netfilter\m"
WAIT "#"
SEND "echo 9999 > ip_conntrack_max\m"
WAIT "#"
SEND "echo 50 > ip_conntrack_generic_timeout\m"
WAIT "#"
SEND "echo 5 > ip_conntrack_tcp_timeout_close\m"
WAIT "#"
SEND "echo 120 > ip_conntrack_tcp_timeout_close_wait\m"
WAIT "#"
SEND "echo 1200 > ip_conntrack_tcp_timeout_established\m"
WAIT "#"
SEND "echo 120 > ip_conntrack_tcp_timeout_fin_wait\m"
WAIT "#"
SEND "echo 60 > ip_conntrack_tcp_timeout_time_wait\m"
WAIT "#"
SEND "echo 10 > ip_conntrack_udp_timeout\m"
WAIT "#"
SEND "cd /\m"
WAIT "#"
SEND "exit\m"


Save this in a file (say) nat_sessions.txt, edit the default IP address and password to match your installation. Run a command prompt, change to the directory with the script + program, and execute it with:
tst10 /r:nat_sessions.txt /m

Just to confirm that these commands have taken effect and that the values have been written to the specific files, change directory and type them out. Here's an example:
cd /proc/sys/net/ipv4/netfilter/
cat ip_conntrack_max

You can extend this Telnet Scripting technique to do as many things as your Linux knowledge and the embedded toolset in the DSL-G604T allows. Which means that you perhaps won't need to wait for new firmware releases and fixes. Clearly this won't cover everything, but I'm sure you get the idea...

Hope this helps
*
Izzit this u need .. the telscript ?

Topic ClosedOptions
 

Change to:
| Lo-Fi Version
0.0149sec    0.44    6 queries    GZIP Disabled
Time is now: 1st December 2025 - 07:36 PM