Sunday, July 31, 2005

Configuring Cisco router through ASP.NET 2.0

OK, so how do you do interactive programming of the Cisco device using the cool .NET 2.0 System.IO.Ports.SerialPort class? Here's a sample. This sample will work with Visual Studio 2005 Beta 2. I built a website project based on the filesystem (i.e., not on IIS or FTP). The web page gives you a dropdown list to choose from amongst COM1, COM2, and COM3, lets you type the enable password in a text box and the command to run. It then displays the result of the command into a label. What you can do with it is only limited by your imagination. Enjoy again!

2 comments:

Jheera said...

I am utilizing similar technique here based on .net 1.1 using telnet library and ssh library (modified version of c# granados) to communicate with either CAT-OS or Native-IOS routers. I decided not to go through the SNMP route, to retain the TACACS authentication model.

Stumbled across your blog and found this post, so couldn't resist to leave a comment. Keep up the great work : )

Regards,
Arif Khan
Phoenix, AZ
Batch 96-97

Muhammad Saqib Ilyas said...

Oh, your comments are very valuable. I'm glad you posted them. I agree about SNMP, no authentication, not a good idea. Even if you restrict to some trusted IP sources, you are prone to IP spoofing.