- 03
- Mar
Nothing is worse than entering repetitive, monotonous commands into a router to accomplish a simple task. By using PHPTelnet we can create a script that will make use of a web form to provision (create pvc or a Private Virtual Circuit) DSL customers in a Cisco router. The script will also write to a log file for security and troubleshooting purposes. This script could be used for many other tasks as well as it is very easy to modify.
NOTE: Depending on your setup, you may need to make modifications to the script.

First, I will focus on the PHP script, and then the web form.
The first part of the script will call in the PHPTelnet.php file. And grab the variables from our web form with the POST method.
-
require_once "PHPTelnet.php";
-
-
$telnet = new PHPTelnet();
-
-
$vpi = $_POST[‘VPI’];
-
$vci = $_POST[‘VCI’];
-
$spd = $_POST[‘SPD’];
This next section deals with logging the requests to a file named ‘log.txt’. Make sure you manually create the file first.
Initiate the connection. Make sure to modify the IP address, username, and password.
Read the rest of this entry …


