我的vps防火牆擋住了wget,curl,連yum update都會超時。
主機是Vultr的,不像阿里雲,Vultr沒有面板可以管理網絡,應該全靠本機防火牆。
但ping指令沒有問題,安裝的網路轉送服務,go語言的ss manyuser也沒問題。
關閉防火牆即可正常下載,開啟防火牆後wget會逾時。
--2017-01-28 08:46:06-- (try: 2) http://dldir1.qq.com/qqfile/qq/QQ8.9/19990/QQ8.9.exe
Connecting to dldir1.qq.com|174.35.24.138|:80... failed: Connection timed out.
Connecting to dldir1.qq.com|174.35.25.7|:80... failed: Connection timed out.
Retrying.
我依照教學重新該配置了規則,已刪掉樓下朋友說的drop all條目。 input的最後一筆記錄應該就是把drop掉的資料記錄下來。
[root@www ~]# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:20160
ACCEPT tcp -- anywhere anywhere tcp dpts:50001:50100
ACCEPT tcp -- anywhere anywhere tcp dpts:11024:11120
ACCEPT icmp -- anywhere anywhere icmp any
ACCEPT all -- localhost localhost
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
ACCEPT tcp -- 一个ip anywhere
LOG all -- anywhere anywhere limit: avg 10/sec burst 5 LOG level warning
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
執行wget後,查看防火牆日誌/var/log/messages
會出現這個。同時還有很多訪問80和443的記錄。也不知道他們訪問成功了沒有。我自己測試訪問80埠沒問題。
Jan 28 08:44:06 www kernel: IN=eth0 OUT= MAC= SRC=174.35.24.138 DST=我的ip LEN=44 TOS=0x00 PREC=0x00 TTL=60 ID=0 DF PROTO=TCP SPT=80 DPT=47754 WINDOW=65535 RES=0x00 ACK SYN URGP=0
TCP三次握手是我發一個syn,對方發一個syn ack,我再發一個ack回去。這裡似乎是把對方發的ack syn擋住了,求各位指點。
系統版本:
[root@www ~]# cat /proc/version
Linux version 2.6.32-573.22.1.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Mar 23 03:35:39 UTC 2016
[root@www ~]# uname -a
Linux 2.6.32-573.22.1.el6.x86_64 #1 SMP Wed Mar 23 03:35:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@www ~]# cat /etc/issue
CentOS release 6.8 (Final)
Kernel \r on an \m
[root@www ~]# cat /etc/redhat-release
CentOS release 6.8 (Final)
[root@www ~]# iptables --version
iptables v1.4.7