DrayTek UK Users' Community Forum
Help, Advice and Solutions from DrayTek Users
Anyone got docs for API / Automating Firewall operations against Drayteks?
- gbowdler
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
10 Dec 2021 23:11 #100228
by gbowdler
Anyone got docs for API / Automating Firewall operations against Drayteks? was created by gbowdler
I want to create an easy UI for my wife to enable and disable firewall rules to give her control over the kids wifi when I'm not there.
I can see that there is an aa & ab &SSLGroup fields for login and that an authtoken called sFormAuthStr is returned, but the payload for, say enabling or disabling a firewall rule isn't clear as there is both and ipfeds.cgi file and an associated .sht file which seems to contain the rules for the entire page.
You can use the CLI ipf <ruleset> <rulenumber> -e 0|1 (enable / disable), however when I try to automate an ssh login I can login but it seems to login sometimes but fails the exec.
so, seem to be a bit stuck on how I can make an easy interface for my wife to enable / diasble internet access for the kids - any ideas please?
I can see that there is an aa & ab &SSLGroup fields for login and that an authtoken called sFormAuthStr is returned, but the payload for, say enabling or disabling a firewall rule isn't clear as there is both and ipfeds.cgi file and an associated .sht file which seems to contain the rules for the entire page.
You can use the CLI ipf <ruleset> <rulenumber> -e 0|1 (enable / disable), however when I try to automate an ssh login I can login but it seems to login sometimes but fails the exec.
so, seem to be a bit stuck on how I can make an easy interface for my wife to enable / diasble internet access for the kids - any ideas please?
Please Log in or Create an account to join the conversation.
- hornbyp
- Offline
- Big Contributor
Less
More
- Posts: 1323
- Thank you received: 0
11 Dec 2021 01:47 #100229
by hornbyp
Replied by hornbyp on topic Re: Anyone got docs for API / Automating Firewall operations against Drayteks?
I've successfully automated Telnet scripting of my Vigor 2860 in the past. I just tried it with your requirement and got it to work.
However - your mention of SSH, makes me think you may be a 'unix' type ... ... and the tool I use is for Windows. (Alternatives are bound to exist for the *nix world)
The website for the tool I use is no longer available, but the 'Wayback machine' successfully archived it (in 1998 ... the copy on my system is dated 1997 )
See:
https://web.archive.org/web/19990129004722fw_/http://www.er.uqam.ca/merlin/fg591543/tst/
Command:
where router.scp contains:-
Output (in temp.txt)
However - your mention of SSH, makes me think you may be a 'unix' type ...
The website for the tool I use is no longer available, but the 'Wayback machine' successfully archived it (in 1998 ... the copy on my system is dated 1997
See:
Command:
Code:
tst10 /r:router.scp /o:temp.txt
where router.scp contains:-
Code:
Routername 23
wait "Account:"
send "admin\m"
wait "Password:"
send "topsecret\m"
wait "MyRouterPrompt>"
send "ipf rule 1 1 -e 1\m"
wait "MyRouterPrompt>"
send "quit\m"
Output (in temp.txt)
Code:
Account:
Account:admin
admin
Password: topsecret_password_unfortunately_gets_echoed!
*********
User login successful, expired time is "Unlimited".
Type ? for command help
MyRouterPrompt> ipf rule 1 1 -e 1
ipf rule 1 1 -e 1
Setting saved.
MyRouterPrompt> quit
Please Log in or Create an account to join the conversation.
- mbames
- Offline
- Member
Less
More
- Posts: 326
- Thank you received: 0
11 Dec 2021 17:08 #100234
by mbames
Replied by mbames on topic Re: Anyone got docs for API / Automating Firewall operations against Drayteks?
Please Log in or Create an account to join the conversation.
Moderators: Chris, Sami
Copyright © 2024 DrayTek