找出指定网络内能连通外网的ip

来源:互联网 发布:美萍软件使用教程 编辑:程序博客网 时间:2024/06/11 20:47
#/*************************************************************************                                                                                                                  #    > File Name: scannet.sh#    > Author: liyong#    > Mail: 2550702985@qq.com#    > Created Time: 2017-05-10 11:08#    > Last modified: 2017-05-10 11:08read -p " please input your network(eg:172.16.252.166)" net #取ip段 设置ipnet=` echo $net|cut -d"." -f1-2`for ((i=250;i<=254;i++));do    for ((j=0;j<=255;j++));do      ifconfig eth1 $net.$i.$j      #curl www.baidu.com && echo $net.$i.$j >> ip.log      #可以同时用多个网卡测试,提高效率      ping -c1 -w1 -I eth1 www.baidu.com && echo $net.$i.$j >> ip.log      #ifconfig eth1    donedone
1 0
原创粉丝点击