shell脚本批量追踪ip路由走向
shell脚本批量追踪ip路由走向需求:有大量ip地址需要追踪路由,查看是否经过(第三跳经过)192.168.23.2,如不经过,需要显示不能经过的ip思路:追踪路由用traceroute -m 4指定4跳即结束,由于到192.168.23.2不到4跳。所以追踪为4足够.脚本如下:forIPin`cat$1` do traceroute-m4-n$IP|grep"192.168.23.2" if["$?"!=0] then echo"$IPisnotina...