Cisco OSPF Expect Script
Uncategorized
Add comments
Sep 082009
This Expect script takes as it’s argument, the IP Address of an IOS device that is using AAA Authentication (Username/Password), and returns the OSPF Neighbors of the device.
Usage: ospf_neighbors_script ip address
The script also creates a file with the OSPF Neighbors in the directory it’s run from. The format is “ip address-ospf_neighbors”,
{quickdown:47}
kshort@LinuxStudent:~$ ospf_neighbors_script 10.255.0.26
Username? kshort
Password?
Username? kshort
Password?
Trying 192.168.0.26…
Connected to 192.168.0.26.
Escape character is ‘^]’.
Connected to 192.168.0.26.
Escape character is ‘^]’.
User Access Verification
Username: kshort
Password:
Test-Router#terminal length 0
Test-Router#sho ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
192.168.1.1 0 FULL/ - 00:00:38 192.168.0.85 Serial1/0.2
192.168.2.1 0 FULL/ - 00:00:38 192.168.0.25 Serial1/0.1
192.168.3.1 1 FULL/BDR 00:00:39 192.168.2.70 GigabitEthernet0/1
192.168.4.1 1 FULL/BDR 00:00:38 192.168.2.66 GigabitEthernet0/0
Test-Router#