cisco ios wget alternative

tinyme

n00b
Joined
Feb 27, 2013
Messages
39
Dear all,

I'm searching for a cisco alternative of the wget command. I tried to use the commands for setting a dyndns account but this doesn't work.

This was the code I tried:

Code:
ip ddns update method ip
HTTP
add http://ourdomain/myuser/mypass
interval maximum 0 0 5 0
int FastEthernet1
ip ddns update ip
 
Dear all,

I'm searching for a cisco alternative of the wget command. I tried to use the commands for setting a dyndns account but this doesn't work.

This was the code I tried:

Code:
ip ddns update method ip
HTTP
add http://ourdomain/myuser/mypass
interval maximum 0 0 5 0
int FastEthernet1
ip ddns update ip

I don't know of any exact equivalent. What are you trying to accomplish? Perhaps I'd be able to give you something appropriate. Cisco has thought of pretty much everything.
 
Dear all,

I'm searching for a cisco alternative of the wget command. I tried to use the commands for setting a dyndns account but this doesn't work.

This was the code I tried:

Code:
ip ddns update method ip
HTTP
add http://ourdomain/myuser/mypass
interval maximum 0 0 5 0
int FastEthernet1
ip ddns update ip

On the add line....what exactly is it going to? It should be pointing to the dynamic dns service not your own domain name.

I.E. for no-ip.com-
Code:
add http://username:[email protected]/nic/update?hostname=hostname.yourdomain.com

dyndns.org
Code:
http://username:[email protected]/nic/updatesystem=dyndns&hostname=<h>&myip=<a>
 
I don't know of any exact equivalent. What are you trying to accomplish? Perhaps I'd be able to give you something appropriate. Cisco has thought of pretty much everything.

I'm trying to use our own website.

the wget equivalent is:

Code:
*/5 * * * * root `wget -qO - http://ourdomain/updateConfigWithCredentials/3/[email protected]/mypassword[> /tmp/php`

or with fetch

Code:
*/5 * * * * fetch http://ourdomain/updateConfigWithCredentials/3/[email protected]/mypassword

That part is working in a cronjob in dd-wrt and linux/bsd

I'm searching for the equivalents for cisco and microtik (for microtik I don't have a router yet)

In the wget the 3 is the routerid, then email as username and password.
 
Last edited:
On the add line....what exactly is it going to? It should be pointing to the dynamic dns service not your own domain name.

I.E. for no-ip.com-
Code:
add http://username:[email protected]/nic/update?hostname=hostname.yourdomain.com

dyndns.org
Code:
http://username:[email protected]/nic/updatesystem=dyndns&hostname=<h>&myip=<a>

That's the problem,... a dynamic dns provider is not an option. We will be our own provider (without the dnspart)
 
Unless I've misunderstood you you're really not interested in updating dns as that was just an example you were trying to work from. Yes?

If so what is it exactly are you trying to accomplish as an end result? What information are you trying to get from the router than cannot be be gathered with SNMP?
 
Unless I've misunderstood you you're really not interested in updating dns as that was just an example you were trying to work from. Yes?

If so what is it exactly are you trying to accomplish as an end result? What information are you trying to get from the router than cannot be be gathered with SNMP?

I just want to use a website for adminpurposes that updates the ip in the database.

DNS is easally implemented with this. I can install mydns who makes use of the existing database.

The wget (or fetch) script only executes the webscript on our server.

Above scripts are for linux and bsd. Those are working and that's what I want to accomplish on cisco.
 
check if kron is available on your version of ios. I actually do something very similar with a phonehome script for remote access into different sites with dynamic IP's. all of them have dd-wrt or a linux box behind the firewall that I can run a script on.
 
Code:
kron occurrence update in 1 recurring
!
kron policy-list update
 cli write
 cli tclsh http://mylinkandpass

This one doesn't work the cron is coming back but the tclsh line isn't executed
 
What's the webserver doing with the request anyway? If this doesn't involve third parties, why not just do properly signed DNS updates?
 
What's the webserver doing with the request anyway? If this doesn't involve third parties, why not just do properly signed DNS updates?

The request writes the ip to a database. I don't need a complete domain name.
 
The request writes the ip to a database. I don't need a complete domain name.

And who is a consumer of that database and by what key do they query the IP address? It looks like you're reinventing DNS.
 
And who is a consumer of that database and by what key do they query the IP address? It looks like you're reinventing DNS.

Why should I use domain names if I only need ip?
It's not my purpose to setup a new DYNDNS service my purpose is that I can update the dynamic ip in our adminpanel.
The ip I get with a simple script that gets the external ip from where the request comes.
 
Last edited:
This sounds way over complicated for a simple task. What side of the router are you on? Why can't you get the outside IP via something stupid like expect or correctly via SNMP?
 
Why should I use domain names if I only need ip?
It's not my purpose to setup a new DYNDNS service my purpose is that I can update the dynamic ip in our adminpanel.
The ip I get with a simple script that gets the external ip from where the request comes.

Do you really display an IP address in your admin panel without any identifier like "external router" or something? How do you know what equipment the IP address belongs to?

You're basically saying "Why should I use domain names if I reinvented DNS myself, badly?"

Edit: I better not ask if you're really using HTTP instead of HTTPS with a proper certificate chain.
 
Do you really display an IP address in your admin panel without any identifier like "external router" or something? How do you know what equipment the IP address belongs to?

You're basically saying "Why should I use domain names if I reinvented DNS myself, badly?"

Edit: I better not ask if you're really using HTTP instead of HTTPS with a proper certificate chain.

There is only one equipment that has a dynamic ip. There is also a unique identifier for each router. There is also a unique username and password.

Why should I use something I don't need? I'm not reinventing DNS because I don't need DNS. So why do you keep saying I'm reinventing something if I only need a part of it.
 
This sounds way over complicated for a simple task. What side of the router are you on? Why can't you get the outside IP via something stupid like expect or correctly via SNMP?

I'm on the server side, not on the routerside.
I already know I have to use tcl. Now I only have to execute a tcl command via a kronjob.
 
I'm on the server side, not on the routerside.
I already know I have to use tcl. Now I only have to execute a tcl command via a kronjob.

By server side I assume that to mean inside. No reason you can't use tcl to login to the router and parse out the IP. It is still a stupid way to do it but it can be easily done and likely published and easily found via Google. Again, SNMP would be the preferred way to do this.


Here, I Googled it for you:

http://www.sghaida.com/parsing-cisco-configuration-using-tcl-and-bash-scripts/
 
Last edited:
By server side I assume that to mean inside. No reason you can't use tcl to login to the router and parse out the IP. It is still a stupid way to do it but it can be easily done and likely published and easily found via Google. Again, SNMP would be the preferred way to do this.


Here, I Googled it for you:

http://www.sghaida.com/parsing-cisco-configuration-using-tcl-and-bash-scripts/

Actually the dynamic public ip's are collected on a webserver on the internet. The script should be executed onto the router.
 
To be clear:

This is what I want:

Currently I have following command that works for updating the ip

Code:
tclsh http://myupdateaddress

When I try to use this in a kronjob

Code:
kron occurrence update in 1 recurring
kron policy list update
cli tclsh http://myupdateaddress
cli write

The router executes the kron every minute but the
Code:
 tclsh http://myupdateaddress
doesn't execute.

I also tried setting up an ntp server but no result
 
Last edited:
Cron script on the SERVER to query the interface IP via SNMP and write it to your database
 
The script is now running once and then deletes the cli line from config.
 
Code:
router(config-kron-occurrence)#
Apr  7 14:34:22.035: Major 1, Minor 0
Apr  7 14:34:22.035: Timer Event update
Apr  7 14:34:22.035: Kron delay for next update 60000
Apr  7 14:34:22.035: Call parse_cmd 'tclsh http://mydomain
Apr  7 14:34:22.175: Kron CLI return 0
'
**CLI 'tclsh http://mydomain/update
Loading http://mydomain/update
Apr  7 14:34:22.175: Major 4, Minor 7po
Apr  7 14:34:22.175: Respond to end of CLI Process
Apr  7 14:34:22.175: Forcing Removing Policy update
Apr  7 14:34:22.175: Removing Policy update
Apr  7 14:34:22.175:     Removing CLI 'tclsh http://mydomain
Apr  7 14:34:22.175: Done Removing Policy update

This is what I get after the kron executes.
 
After searching for some other options I got it working with the

Code:
ip sla
command
 
After searching for some other options I got it working with the

Code:
ip sla
command

Interesting. I've been doing a lot with IP SLA myself recently, but I've never considered it for running a script (though I'm guessing a track actually triggers the script?). Is this something you could share? It would be very useful to me.
 
Interesting. I've been doing a lot with IP SLA myself recently, but I've never considered it for running a script (though I'm guessing a track actually triggers the script?). Is this something you could share? It would be very useful to me.

It's not really a script (three lines)

Code:
ip sla 1
 http get http://yourupdatesite/yourid/youremail/YOUR_PWD
ip sla schedule 1 life forever start-time now

I still have to change the number of times it runs the script (this runs every minute)

On the serverside we use a javascript page that get's the public ip and updates it when you have the right login.

I don't know if this was interisting enough ;)
 
I'm still confused, why don't you use the built in IOS dynamic DNS functionality? You can specify any URL you want, the min and max time intervals, all that stuff. Its specifically made to do what I think (maybe I'm wrong?) you're doing.
 
I couldn't get it working this is also much less code. Can you give an example for my updatelink?
 
Much less code? There is maybe five or six commands to enter. What is the URL you want to use?
 
It's not really a script (three lines)

Code:
ip sla 1
 http get http://yourupdatesite/yourid/youremail/YOUR_PWD
ip sla schedule 1 life forever start-time now

I still have to change the number of times it runs the script (this runs every minute)

On the serverside we use a javascript page that get's the public ip and updates it when you have the right login.

I don't know if this was interisting enough ;)

Ohhh I see. I've used the http get in an IP SLA before.

Damn, I could have told you that at the beginning of this thread, except that I didn't really get what you were trying to accomplish. I've never worked with DDNS in IOS, to be honest.
 
Ohhh I see. I've used the http get in an IP SLA before.

Damn, I could have told you that at the beginning of this thread, except that I didn't really get what you were trying to accomplish. I've never worked with DDNS in IOS, to be honest.

I should have explained it better then :)
 
Back
Top