linux中檢查ip被封的3種方法

來源:互聯網
上載者:User

網站打不開,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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.