11-05-2009 03:24 PM - edited 03-06-2019 08:28 AM
I'm trying to track the status of a LAN. Where it's working, servers attached, HSRP operating correctly.
I would like to build a probe that would just ask "is anyone on the LAN?". I know I can do PING to x.x.x.255/24 and get multiple answers. One answer would prove someone is connected and the LAN segment is working. However, IP SLA ICMP-ECHO does not allow a destination address of a broadcast address (255.255.255.255). When a directed broadcast IP address is used (10.23.23.255/24) is used, the debug ip packet detail indicates "encapsulation failure" - no MAC was returned when the address was ARP'd. Tried a static ARP entry, it said it sent it, but no responses. Ping works, but SLA ICMP-ECHO does not.
Any suggestions on how to probe a LAN and then object track it?
11-07-2009 11:00 PM
What version of code are you running? It would be possible to use the Embedded Event Manager with a stub object to do what you want. If this was running on a switch, you wouldn't even need to use ping. You could, for example, check the MAC table to see if there are any active MACs on a given VLAN.
11-09-2009 10:13 AM
Currently using C2811 router with IOS Version 12.4(20)T1. Embedded Events is in 12.4(22)T, can upgrade is needed.
I'll got read up on EEM. May have questions later!
11-09-2009 05:35 PM
No need to upgrade. EEM has been around since 12.3(4)T, and you have EEM 2.4 in your version of code, so you have a lot of power. You will still need to create a Tcl policy, though. If you upgrade to 12.4(22)T, you can do what you need with CLI alone.
Given that you're going to be doing this on a router, and if the broadcast ping works for you, run the ping command via EEM, then parse the output. If you get a response, assume there is at least one host on the LAN.
A more reliable choice is to cycle through all available LAN addresses, and send one quick ping to each:
foreach ip $ips {
set result [run_cli [list "ping ip $ip repeat 1 timeout 0"]]
if { [regexp -line {^!} $result] } {
set found_host 1
break
}
}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide