代码: 全选
iptables -P INPUT DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED -p all -j ACCEPT
不是iptables配置问题,而是锐速appex模块对网络数据包有影响,2者启动顺序问题
代码: 全选
iptables -P INPUT DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED -p all -j ACCEPT
2. 送回來 跟 in both directions 不符合web服务器发送回来的数据包难道不是ESTABLISHED状态的么?
我把一样的配置放到虚拟机上,发现虚拟机上能正常访问,重装了一下系统,结果好了.....poloshiao 写了:1. 參閱
1-1. http://manpages.ubuntu.com/manpages/xen ... les.8.html
1-2. https://help.ubuntu.com/community/IptablesHowTo
1-3. https://www.frozentux.net/iptables-tuto ... orial.html
1-4. http://www.netfilter.org/documentation/ ... HOWTO.html2. 送回來 跟 in both directions 不符合web服务器发送回来的数据包难道不是ESTABLISHED状态的么?
2-1. http://serverfault.com/questions/371316 ... ckets?rq=1
iptables: difference between NEW, ESTABLISHED and RELATED packets
ESTABLISHED -- meaning that the packet is associated with a connection which has seen packets in both directions,
2-2. http://serverfault.com/questions/762604 ... shed-state
Iptables: Difference between RELATED and ESTABLISHED state?
发现wget无法访问web服务器80端口了
http://superuser.com/a/695952重装了一下系统,结果好了.....
发现wget无法访问web服务器80端口了,web服务器发送回来的数据包难道不是ESTABLISHED状态的么?
DNS的可能性我用ip方式排除了.我的理解是vps用wget获取web数据(80或者443),那么vps应该会发出一个带NEW状态的包给目标web服务器,我的OUTPUT是全部ACCEPT的,所以这个包应该是能发送到web服务器的,而web服务器应该会返回带ESTABLISHED的数据包,应该不会被vps的防火墙给拦住. 这样理解不知道有没有问题poloshiao 写了:发现wget无法访问web服务器80端口了http://superuser.com/a/695952重装了一下系统,结果好了.....
the reason why wget is failing is that you have made no allowance for DNS, thus where is no name resolution on your system: you are blocking all such requests.
前面所說的 wget 失敗 可能原因之一是 無法獲得 DNS 通過
意思是
wget 失敗 跟 ESTABLISHED 状态 不一定存在因果關係发现wget无法访问web服务器80端口了,web服务器发送回来的数据包难道不是ESTABLISHED状态的么?
看看 這一段 有沒有幫助我的理解是vps用wget获取web数据(80或者443),那么vps应该会发出一个带NEW状态的包给目标web服务器,我的OUTPUT是全部ACCEPT的,所以这个包应该是能发送到web服务器的,而web服务器应该会返回带ESTABLISHED的数据包,应该不会被vps的防火墙给拦住.
代码: 全选
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
这条我加了,但是没效果poloshiao 写了:看看 這一段 有沒有幫助我的理解是vps用wget获取web数据(80或者443),那么vps应该会发出一个带NEW状态的包给目标web服务器,我的OUTPUT是全部ACCEPT的,所以这个包应该是能发送到web服务器的,而web服务器应该会返回带ESTABLISHED的数据包,应该不会被vps的防火墙给拦住.
http://superuser.com/questions/695887/i ... 952#695952
wget connects to port 80 on the other end but gets a random port number on our end.
add this and see if it does anything.代码: 全选
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
你是希望達到什麼效果 ?这条我加了,但是没效果