网站打不开,ssh连不上,这是很多站长的痛。下面例举3种方法,判断IP是不是被屏蔽了。
1,路由分析法
# traceroute 212.239.8.22 //linux下
traceroute to 212.239.8.22 (212.239.8.22), 30 hops max, 60 byte packets
1 192.168.10.1 (192.168.10.1) 0.308 ms 0.515 ms 0.634 ms
2 * * *
3 124.74.57.93 (124.74.57.93) 5.325 ms 5.314 ms 5.310 ms
4 101.95.42.177 (101.95.42.177) 5.219 ms 5.222 ms 5.214 ms
5 61.152.86.178 (61.152.86.178) 6.495 ms 6.604 ms 6.596 ms
6 * * *
7 * * *
8 * * *
9 * * *
10 * * *
F:\test> tracert 212.239.8.22 //windows下
在IP查询工具查一下,会发现,61.152.86.178是上海 电信骨干网,到这儿就不通了。只能说被它屏蔽掉了
2,登录墙外VPS,ping 212.239.8.22,这个方法的前提是你有二个墙外VPS,并且没有同时被封。如果墙外ping的通,墙内ping不通,说明被屏蔽了。
3,如果利用VPN或代理能够访问,不用就是不能访问,说明被墙了。
补充:L
首先查看当前规则:
iptables --list
[root@joytest1 ~]# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- xxxx.xxxx.50.45 anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT icmp -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:svn
ACCEPT tcp -- anywhere anywhere tcp dpt:pptp
ACCEPT gre -- anywhere anywhere
ACCEPT udp -- anywhere anywhere udp dpt:domain
DROP all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:ni-ftp
增加:
iptables -A INPUT -s xxx.xx.xxx.xxx -j ACCEPT
重启服务
service iptables restart