This is a discussion on Automating router http configuration within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I have a router that is configured via a web browser (It's a Netgear). I need to change the ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a router that is configured via a web browser (It's a Netgear). I need to change the port forwarding options now and again, and so would like to write a script to do this automatically, then I can just run the script rather than firing up a browser. I figure if I strip out the necessary HTML to make the changes (eg, everything in the form) and submit this to the Netgear's port 80 (Along with my login credentials in the form), this would make my life easier. My query is, what could I achieve to do this. Say I set up a couple of HTML files with the form data in, how could I submit that? If I put something in the script to "lynx form.html" it'd only display it on the screen, not submit the form as well. Anyone achieved something similar to this before? |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2003-12-19, Mr Balloon <mrballoon@aol.com> wrote: > I have a router that is configured via a web browser (It's a Netgear). > > I need to change the port forwarding options now and again, and so would > like to write a script to do this automatically, then I can just run the > script rather than firing up a browser. > > I figure if I strip out the necessary HTML to make the changes (eg, > everything in the form) and submit this to the Netgear's port 80 (Along with > my login credentials in the form), this would make my life easier. > > My query is, what could I achieve to do this. You wouldn't strip out the HTML, but figure out what POST parameters the Netgear wants. You can then use the Perl LWP modules to post that data to the Netgear. These issues are all offtopic here, so I suggest finding a CGI or (if you start coding in Perl) a Perl forum for your questions. - --keith - -- kkeller-usenet@wombat.san-francisco.ca.us (try just my userid to email me) AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/4yxqhVcNCxZ5ID8RAo5CAKCcDfvncD9p47CcthMW6CY3yepdNA CeMqzR mBNEzv6hdHCyQU8nVl4tObc= =mvOa -----END PGP SIGNATURE----- |
| |||
| Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 pgp trash troll delete > You wouldn't strip out the HTML, but figure out what POST > parameters the Netgear wants. You can then use the Perl LWP > modules to post that data to the Netgear. These issues are all > offtopic here, so I suggest finding a CGI or (if you start coding > in Perl) a Perl forum for your questions. Here you are complaining about an off-topic posting and yet you are using pgp which is against the policy of this ng. cordially, as always, rm |
| |||
| On Fri, 19 Dec 2003 08:50:53 -0800, Keith Keller wrote: > On 2003-12-19, Mr Balloon <mrballoon@aol.com> wrote: >> I have a router that is configured via a web browser (It's a Netgear). >> >> I need to change the port forwarding options now and again, and so would >> like to write a script to do this automatically, then I can just run the >> script rather than firing up a browser. I would think you should be able to do that via SNMP try net-snmp ( maybe from: http://linuxpackages.net ) for that. >> I figure if I strip out the necessary HTML to make the changes (eg, >> everything in the form) and submit this to the Netgear's port 80 (Along with >> my login credentials in the form), this would make my life easier. You could probably look at a valid connection (dumping the payload with "ngrep", "sniffit" or some such) and script some ol' hackery with "socket" or "nc" (netcat) ... >> My query is, what could I achieve to do this. Try the "-auth" and (maybe) "-post_data" flags to "lynx" -- man lynx . What ever you do though, it will probably take some coding. > You wouldn't strip out the HTML, but figure out what POST parameters the > Netgear wants. You can then use the Perl LWP modules to post that data > to the Netgear. Maybe have a look at the scrips used for dynamically updateing DNS records and modify them (if SNMP isn't available). Such as the "clients" for dyndns.org > These issues are all offtopic here, Agreed. > so I suggest finding a CGI Wouldn't a CGI (common gateway interface) be server-side scriting - in this scenario: on the router? > or (if you start coding in Perl) a Perl forum for your questions. Or, "expect" some "telnet" trick :-). -- -Menno. |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2003-12-19, Menno Duursma <menno@desktop.lan> wrote: > > I would think you should be able to do that via SNMP try net-snmp > ( maybe from: http://linuxpackages.net ) for that. Not all routers support SNMP. I don't believe my Netgear ''router'' does. > You could probably look at a valid connection (dumping the payload > with "ngrep", "sniffit" or some such) and script some ol' hackery with > "socket" or "nc" (netcat) ... See below. > Wouldn't a CGI (common gateway interface) be server-side scriting - > in this scenario: on the router? Well, the router has some sort of CGI program that processes the POST data from the web browser. It is helpful to know how parts of an HTML document will be processed by the CGI on the other end (or, at least, what keys and values the CGI expects). But you're right, no particular CGI knowledge is really needed; knowing which HTML tags will be processed by the CGI is more important. > Or, "expect" some "telnet" trick :-). Ewww. - --keith - -- kkeller-usenet@wombat.san-francisco.ca.us (try just my userid to email me) AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD4DBQE/49BkhVcNCxZ5ID8RAhBDAJjR3XckNCY83XQbVhzGFkcG2euAAJ 9tEct9 oh0A//TevgvncU0cCOqzvA== =rW/f -----END PGP SIGNATURE----- |
| |||
| Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 pgp trash troll delete > On 2003-12-19, Menno Duursma <menno@desktop.lan> wrote: > > > > I would think you should be able to do that via SNMP try net-snmp > > ( maybe from: http://linuxpackages.net ) for that. > Not all routers support SNMP. I don't believe my Netgear ''router'' > does. But doesn't the use of pgp interfere with SNMP? Perhaps you might consider using pgp in a responsible manner in the future. We would sure appreciate it. cordially, as always, rm |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 dcba@dcba.dcba.org wrote: > Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 > > pgp trash troll delete > >> On 2003-12-19, Menno Duursma <menno@desktop.lan> wrote: >> > >> > I would think you should be able to do that via SNMP try net-snmp >> > ( maybe from: http://linuxpackages.net ) for that. > >> Not all routers support SNMP. I don't believe my Netgear ''router'' >> does. > > But doesn't the use of pgp interfere with SNMP? Perhaps you might > consider using pgp in a responsible manner in the future. We would > sure appreciate it. > > cordially, as always, > > rm For newsgroup searchers: No it doesn't interfere with SNMP, just our resident anti-pgp troll :P - -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. *****---*Linus*Torvalds -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/5CBjDvn9hyzHIq4RAlLNAJ9mKLq24KSqO5Ldy8aarTv7T5Tr7Q CfRzP+ dfT1JGHSZunq3VLUXSmJSQ4= =lVZs -----END PGP SIGNATURE----- |
| ||||
| Fred Emmott <pcfreak65@hotmail.com> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 pgp trash troll delete > For newsgroup searchers: No it doesn't interfere with SNMP, just > our resident anti-pgp troll :P There are several hundred "anti-pgp trolls" and we bring this issue to light on their behalf. Please refrain from the unwarranted use of pgp. It violates this ng's policy, it violates our sensibilities, and it violates common sense. cordially, as always, rm |