可以使用exec去进行查询判断,判断traceroute to 出的ip和最后追踪到的IP是否匹配,如果不匹配可能就被墙了。
也可以有个保险的方法,去请求下看是否有返回数据没有基本就是墙了。
查询命令方法:
traceroute --tcp youtubemy.com
[root@localhost apizl_dev]# traceroute --tcp youtubemy.com
traceroute to youtubemy.com (199.59.148.97), 30 hops max, 60 byte packets
1 122.114.171.254 (122.114.171.254) 13.673 ms 13.580 ms 13.536 ms
2 172.31.12.3 (172.31.12.3) 1.192 ms 13.509 ms 13.428 ms
3 * * *
示例工具:https://www.toolnb.com/beiqiang/qq.com.html
参考资料:
https://blog.csdn.net/asdf8968/article/details/83787777
https://o2.airscr.com/374/
https://www.cnblogs.com/dion-90/p/8519744.html
http://allenn.cn/articles/2016-10/2016-10-20-learn-gfw/
https://blog.csdn.net/qq_30135181/article/details/50992151?locationNum=14&fps=1
http://bbs.51cto.com/thread-1176533-1.html
https://www.ivpser.com/mtr/
http://blog.51yip.com/server/1794.html