Послать ping на все хосты подсети с циски можно, если во всех младших битах IP-адреса, относящейся к подсети (определяется маской подсети), указать нули. Например, если адрес на интерфейсе a.b.2.1/24, то можно отправить запросы ping на все хосты подсети, принадлежащие этой подсети:
router-3825-c.d.1.248#ping a.b.2.0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to a.b.2.0, timeout is 2 seconds:
Reply to request 0 from a.b.2.10, 1 ms
Reply to request 0 from a.b.2.80, 32 ms
Reply to request 0 from a.b.2.32, 12 ms
Reply to request 0 from a.b.2.112, 4 ms
Reply to request 0 from a.b.2.96, 4 ms
Reply to request 0 from a.b.2.64, 1 ms
Reply to request 1 from a.b.2.10, 1 ms
Reply to request 1 from a.b.2.80, 36 ms
Reply to request 1 from a.b.2.32, 12 ms
Reply to request 1 from a.b.2.112, 4 ms
Reply to request 1 from a.b.2.96, 4 ms
Reply to request 1 from a.b.2.64, 1 ms
Reply to request 2 from a.b.2.10, 1 ms
Reply to request 2 from a.b.2.80, 28 ms
Reply to request 2 from a.b.2.96, 16 ms
Reply to request 2 from a.b.2.32, 8 ms
Reply to request 2 from a.b.2.112, 4 ms
Reply to request 2 from a.b.2.64, 1 ms
Reply to request 3 from a.b.2.64, 1 ms
Reply to request 3 from a.b.2.80, 80 ms
Reply to request 3 from a.b.2.32, 8 ms
Reply to request 3 from a.b.2.112, 8 ms
Reply to request 3 from a.b.2.96, 4 ms
Reply to request 3 from a.b.2.10, 1 ms
Reply to request 4 from a.b.2.10, 1 ms
Reply to request 4 from a.b.2.80, 28 ms
Reply to request 4 from a.b.2.32, 8 ms
Reply to request 4 from a.b.2.112, 4 ms
Reply to request 4 from a.b.2.96, 4 ms
Reply to request 4 from a.b.2.64, 1 ms
Поскольку процесс получается длительный, то лучше указать счетчик повторов равным 1 (по умолчанию он равен 5). Для этого нужно воспользоваться расширенными возможностями ping - просто ввести ping и в командную строку, и в диалоговом режиме указать 1 в ответ на запрос "Repeat count [5]:".
Такой же ping можно послать на *nix командой (маска подсети интерфейса /16):
[root@localhost ~]# ping -b e.f.0.0 -c 1
WARNING: pinging broadcast address
PING e.f.0.0 (e.f.0.0) 56(84) bytes of data.
64 bytes from e.f.11.111: icmp_seq=0 ttl=64 time=0.022 ms
64 bytes from e.f.0.121: icmp_seq=0 ttl=64 time=0.122 ms (DUP!)
64 bytes from e.f.100.121: icmp_seq=0 ttl=64 time=0.127 ms (DUP!)
64 bytes from e.f.2.108: icmp_seq=0 ttl=64 time=0.132 ms (DUP!)
64 bytes from e.f.3.220: icmp_seq=0 ttl=64 time=0.182 ms (DUP!)
64 bytes from e.f.0.163: icmp_seq=0 ttl=64 time=0.187 ms (DUP!)
64 bytes from e.f.0.17: icmp_seq=0 ttl=255 time=0.192 ms (DUP!)
64 bytes from e.f.0.30: icmp_seq=0 ttl=255 time=0.220 ms (DUP!)
64 bytes from e.f.100.79: icmp_seq=0 ttl=255 time=0.225 ms (DUP!)
64 bytes from e.f.0.9: icmp_seq=0 ttl=255 time=0.249 ms (DUP!)
64 bytes from e.f.1.25: icmp_seq=0 ttl=64 time=0.285 ms (DUP!)
64 bytes from e.f.100.80: icmp_seq=0 ttl=255 time=0.302 ms (DUP!)
64 bytes from e.f.0.246: icmp_seq=0 ttl=64 time=0.306 ms (DUP!)
64 bytes from e.f.1.28: icmp_seq=0 ttl=64 time=0.310 ms (DUP!)
64 bytes from e.f.2.35: icmp_seq=0 ttl=64 time=0.331 ms (DUP!)
64 bytes from e.f.0.245: icmp_seq=0 ttl=64 time=0.336 ms (DUP!)
64 bytes from e.f.1.34: icmp_seq=0 ttl=64 time=0.353 ms (DUP!)
64 bytes from e.f.0.8: icmp_seq=0 ttl=255 time=0.456 ms (DUP!)
64 bytes from e.f.1.56: icmp_seq=0 ttl=64 time=0.488 ms (DUP!)
64 bytes from e.f.1.13: icmp_seq=0 ttl=64 time=0.528 ms (DUP!)
64 bytes from e.f.1.17: icmp_seq=0 ttl=64 time=0.533 ms (DUP!)
64 bytes from e.f.1.7: icmp_seq=0 ttl=64 time=0.538 ms (DUP!)
64 bytes from e.f.1.32: icmp_seq=0 ttl=64 time=0.557 ms (DUP!)
64 bytes from e.f.2.149: icmp_seq=0 ttl=64 time=0.561 ms (DUP!)
64 bytes from e.f.0.62: icmp_seq=0 ttl=64 time=0.567 ms (DUP!)
64 bytes from e.f.2.125: icmp_seq=0 ttl=64 time=0.586 ms (DUP!)
64 bytes from e.f.2.154: icmp_seq=0 ttl=64 time=0.598 ms (DUP!)
64 bytes from e.f.2.92: icmp_seq=0 ttl=64 time=0.603 ms (DUP!)
64 bytes from e.f.2.85: icmp_seq=0 ttl=64 time=0.622 ms (DUP!)
64 bytes from e.f.2.210: icmp_seq=0 ttl=64 time=0.627 ms (DUP!)
64 bytes from e.f.0.161: icmp_seq=0 ttl=64 time=0.706 ms (DUP!)
64 bytes from e.f.0.168: icmp_seq=0 ttl=64 time=0.726 ms (DUP!)
64 bytes from e.f.0.162: icmp_seq=0 ttl=64 time=0.731 ms (DUP!)
64 bytes from e.f.0.242: icmp_seq=0 ttl=64 time=0.736 ms (DUP!)
64 bytes from e.f.0.139: icmp_seq=0 ttl=64 time=0.755 ms (DUP!)
64 bytes from e.f.0.169: icmp_seq=0 ttl=64 time=0.760 ms (DUP!)
64 bytes from e.f.1.19: icmp_seq=0 ttl=64 time=0.767 ms (DUP!)
64 bytes from e.f.1.43: icmp_seq=0 ttl=64 time=0.784 ms (DUP!)
64 bytes from e.f.1.46: icmp_seq=0 ttl=64 time=0.789 ms (DUP!)
64 bytes from e.f.1.45: icmp_seq=0 ttl=64 time=0.809 ms (DUP!)
64 bytes from e.f.1.48: icmp_seq=0 ttl=64 time=0.813 ms (DUP!)
64 bytes from e.f.1.20: icmp_seq=0 ttl=64 time=0.818 ms (DUP!)
64 bytes from e.f.0.61: icmp_seq=0 ttl=64 time=0.839 ms (DUP!)
64 bytes from e.f.1.6: icmp_seq=0 ttl=64 time=0.844 ms (DUP!)
64 bytes from e.f.1.11: icmp_seq=0 ttl=64 time=0.848 ms (DUP!)
64 bytes from e.f.1.47: icmp_seq=0 ttl=64 time=0.868 ms (DUP!)
64 bytes from e.f.2.142: icmp_seq=0 ttl=64 time=0.872 ms (DUP!)
64 bytes from e.f.1.8: icmp_seq=0 ttl=64 time=0.878 ms (DUP!)
64 bytes from e.f.1.39: icmp_seq=0 ttl=64 time=0.897 ms (DUP!)
64 bytes from e.f.1.40: icmp_seq=0 ttl=64 time=0.902 ms (DUP!)
64 bytes from e.f.1.10: icmp_seq=0 ttl=64 time=0.907 ms (DUP!)
64 bytes from e.f.1.9: icmp_seq=0 ttl=64 time=0.926 ms (DUP!)
64 bytes from e.f.1.26: icmp_seq=0 ttl=64 time=0.931 ms (DUP!)
64 bytes from e.f.1.41: icmp_seq=0 ttl=64 time=0.936 ms (DUP!)
64 bytes from e.f.1.30: icmp_seq=0 ttl=64 time=0.956 ms (DUP!)
64 bytes from e.f.2.192: icmp_seq=0 ttl=64 time=0.960 ms (DUP!)
64 bytes from e.f.0.165: icmp_seq=0 ttl=64 time=0.965 ms (DUP!)
64 bytes from e.f.1.15: icmp_seq=0 ttl=64 time=1.03 ms (DUP!)
64 bytes from e.f.1.27: icmp_seq=0 ttl=60 time=1.31 ms (DUP!)
64 bytes from e.f.1.36: icmp_seq=0 ttl=60 time=1.32 ms (DUP!)
64 bytes from e.f.1.31: icmp_seq=0 ttl=60 time=1.36 ms (DUP!)
64 bytes from e.f.1.12: icmp_seq=0 ttl=60 time=1.37 ms (DUP!)
64 bytes from e.f.1.37: icmp_seq=0 ttl=60 time=1.39 ms (DUP!)
64 bytes from e.f.0.248: icmp_seq=0 ttl=64 time=1.40 ms (DUP!)
64 bytes from e.f.1.18: icmp_seq=0 ttl=60 time=1.42 ms (DUP!)
64 bytes from e.f.1.22: icmp_seq=0 ttl=60 time=1.45 ms (DUP!)
64 bytes from e.f.1.14: icmp_seq=0 ttl=60 time=1.47 ms (DUP!)
64 bytes from e.f.1.16: icmp_seq=0 ttl=60 time=1.53 ms (DUP!)
64 bytes from e.f.1.123: icmp_seq=0 ttl=60 time=1.68 ms (DUP!)
64 bytes from e.f.0.254: icmp_seq=0 ttl=255 time=1.76 ms (DUP!)
64 bytes from e.f.1.33: icmp_seq=0 ttl=60 time=2.00 ms (DUP!)
64 bytes from e.f.1.21: icmp_seq=0 ttl=60 time=2.05 ms (DUP!)
64 bytes from e.f.1.23: icmp_seq=0 ttl=60 time=2.06 ms (DUP!)
64 bytes from e.f.0.45: icmp_seq=0 ttl=255 time=2.23 ms (DUP!)
64 bytes from e.f.9.88: icmp_seq=0 ttl=255 time=2.62 ms (DUP!)
--- e.f.0.0 ping statistics ---
1 packets transmitted, 1 received, +74 duplicates, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.022/0.845/2.621/0.541 ms, pipe 2
На платформах Windows, к сожалению, такой возможности у ping нет. |