DD-WRT executing system commands remotely using cURL

post-2250-1238359496
What you need:

1. A router loaded with DD-WRT.
2. cURL – http://curl.haxx.se/ (Windows users may be able to get a precompiled binary with this google search query)
3. The IP address of your router (default is usually 192.168.1.1)
4. The Web GUI username & password of your router.

Here’s is the syntax, just replace the information in red (Note that spaces in your system command must be replaced with + signs):

curl http://192.168.1.1/apply.cgi -d "submit_button=Ping&action=ApplyTake&submit_type=start&change_action=gozila_cgi&next_page=Diagnostics.asp&ping_ip=your+system+command" -u username:password

Here is an example to add a static route, using the typical username/password combination:

curl http://192.168.1.1/apply.cgi -d "submit_button=Ping&action=ApplyTake&submit_type=start&change_action=gozila_cgi&next_page=Diagnostics.asp&ping_ip=route+add+-net+21.5.128.0+netmask+255.255.128.0+dev+ppp0" -u admin:admin

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s