Can I ssh into Zywall USG310 from c# application ?
DantLucian
Posts: 6
Hello everybody,
I want to get dhcp-table informations to update my database.
So I want to write an application to get informations from ssh connections.
Is it possible ?
i've tried but the program connect successfully but I can't run or execute commands.
do you have any idea about that ?
Thanks for your response.
Dante
I want to get dhcp-table informations to update my database.
So I want to write an application to get informations from ssh connections.
Is it possible ?
i've tried but the program connect successfully but I can't run or execute commands.
do you have any idea about that ?
Thanks for your response.
Dante
0
All Replies
-
Hi @DantLucian
Try the command "show ip dhcp binding" in your application after login. This command should popup the leased ip address bindings
0 -
Hi @Zyxel_VicI am not looking for the right command to execute because I can use the "show arp-table" command.However I can't execute the command and get the result from C#.The thread dedicated to the "runCommand" command of the ssh client, remains on hold and doesn't return any result.You will find below an extract of the code executed from a console application on C#.using (var client = new SshClient(ipAddressOrHostName, 22, userName, password)){client.Connect();if (client.IsConnected){var cmd = client.CreateCommand("show ip dhcp binding");var asynch = cmd.BeginExecute();
// stuck in this loop and doesn't completewhile (!asynch.IsCompleted){// Waiting for command to complete...System.Threading.Thread.Sleep(2000);}var result = cmd.EndExecute(asynch);}}Do you have an idea of the cause of the problem?Thank you in advance for your answer.0 -
Hi @DantLucian
It should be the same on the device systemwise. I can't tell why there're different result when putting different command in your code. Perhaps you can consult some other C# experts.0 -
Hi @Zyxel_VicThe problem does not come from the different commands but from the execution of the "show ip dhcp binding" command which does not finish.I manage to execute this command in Telnet but not in ssh.Do you have an idea why?Have you already realized this case (Execute a command on a USG310 or others from a third party application in ssh) ?If yes, which application ?If not, is it possible to do it ?Did you execute the code I sent you in order to better understand the problem ?Thank you in advance for your answer.0
-
Hi @Zyxel_VicThe problem does not come from the different commands but from the execution of the "show ip dhcp binding" command which does not finish.I manage to execute this command in Telnet but not in ssh.Do you have an idea why?Have you already realized this case (Execute a command on a USG310 or others from a third party application in ssh) ?If yes, which application ?If not, is it possible to do it ?Did you execute the code I sent you in order to better understand the problem ?Thank you in advance for your answer.0
-
DantLucian said:Hi @Zyxel_VicThe problem does not come from the different commands but from the execution of the "show ip dhcp binding" command which does not finish.I manage to execute this command in Telnet but not in ssh.Do you have an idea why?Have you already realized this case (Execute a command on a USG310 or others from a third party application in ssh) ?If yes, which application ?If not, is it possible to do it ?Did you execute the code I sent you in order to better understand the problem ?Thank you in advance for your answer.0
-
I using Python 3.8.2 on Windows 10, with netmiko module.
Write simple Python script to send command and get output from my ZyWALL110.
So far, no problem.from netmiko import ConnectHandlerfrom getpass import getpassdevice1 = {"device_type": "cisco_ios","host": "192.168.168.1","username": "admin","password": getpass(),"session_log": "logs.txt"}# command to executecommand = "show ip dhcp binding"with ConnectHandler(**device1) as net_connect:output = net_connect.send_command(command)1 -
Hi lan31It works in python but it doesn't answer my question with C#.Thank you for the proposed solution.I tested it and it works very well.0
-
So I think I will close this ticket.
0 -
usg ssh access denied Nov 14, 2013 · If you need to SSH into an access point ... Step by step procedure You can use the following CLI command to unlock the source IP address via console or SSH.
0
Categories
- All Categories
- 415 Beta Program
- 2.4K Nebula
- 144 Nebula Ideas
- 94 Nebula Status and Incidents
- 5.6K Security
- 237 USG FLEX H Series
- 267 Security Ideas
- 1.4K Switch
- 71 Switch Ideas
- 1.1K Wireless
- 40 Wireless Ideas
- 6.3K Consumer Product
- 247 Service & License
- 384 News and Release
- 83 Security Advisories
- 29 Education Center
- 10 [Campaign] Zyxel Network Detective
- 3.2K FAQ
- 34 Documents
- 34 Nebula Monthly Express
- 83 About Community
- 71 Security Highlight