Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

How to ping a range of IP addresses from a router ?

I want to PINg a range of ip addresses, C-class from my router.

Is there a command that supports this or not ?

8 REPLIES

Re: How to ping a range of IP addresses from a router ?

Hi,

If you want to ping all the devices within a particular subnet say a.b.c.0 then ping the address a.b.c.255 from the router. You'll get a response from all the devices which are alive.

Hope this helps.

Regards,

AbhisheK

Please rate all posts!!!

New Member

Re: How to ping a range of IP addresses from a router ?

Thanks,

I was using a.b.c.0 but that didn't work.

Re: How to ping a range of IP addresses from a router ?

You are welcome!

Please rate the post if it helped you...

Silver

Re: How to ping a range of IP addresses from a router ?

I suggest to use those scan tool to check the IP availability. Or write a script and ping from a host.

Re: How to ping a range of IP addresses from a router ?

Hello,

in addition to the other posts, check if your router supports tcl scripting (I think it starts with IOS 12.3). Here is an example of such a script (this one would ping addresses 192.168.1.1 thru 192.168.1.10):

Router#

Router#tclsh

Router(tcl)#foreach i {

+>192.168.1.1

+>192.168.2.1

+>192.168.3.1

+>192.168.4.1

+>192.168.5.1

+>192.168.6.1

+>192.168.7.1

+>192.168.8.1

+>192.168.9.1

+>192.168.10.1

+>} {ping $i}

When you are done, exit tcl with this command:

Router(tcl)#tclquit

HTH,

GNT

Hall of Fame Super Silver

Re: How to ping a range of IP addresses from a router ?

One clarification to the suggestion about pinging to the subnet broadcast address. This will work if the router interface where the hosts are located is configured with ip directed-broadcast. It will not work if the router interface is configured with no ip directed-broadcast. In earlier versions of IOS the default was ip directed-broadcast. But for a good while the default has become no ip directed-broadcast. So for many routers you may have to turn on this feature for the ping to the subnet broadcast address to work.

The reason that Cisco changed the default for this feature was concern from a security perspective. The ability to remotely send a broadcast to every device in the subnet is involved in several Denial Of Service attacks. I would suggest that you think carefully before you enable directed broadcast.

HTH

Rick

Re: How to ping a range of IP addresses from a router ?

Hey!

Rick,

Thanks for adding that bit of info, I missed out on that one!

Regards,

AbhisheK

Hall of Fame Super Silver

Re: How to ping a range of IP addresses from a router ?

AbhisheK

You are welcome.

When I read the original post my first reaction was that the closest that we could come on the router was to ping the broadcast address of the subnet. So we both had the same idea of a solution. I just added the clarification that directed broadcast must be enabled for this to work. And that directed broadcast does have some security implications.

It is good that the forum is a collaborative process.

HTH

Rick

10457
Views
10
Helpful
8
Replies
CreatePlease login to create content