当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 8 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : [已解决]iptables的问题
帖子发表于 : 2016-03-22 15:10 

注册: 2015-10-28 15:18
帖子: 11
系统: Archlinux
送出感谢: 0 次
接收感谢: 0 次
代码:
iptables -P INPUT DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED  -p all -j ACCEPT

发现wget无法访问web服务器80端口了,web服务器发送回来的数据包难道不是ESTABLISHED状态的么?

不是iptables配置问题,而是锐速appex模块对网络数据包有影响,2者启动顺序问题


最后由 achengmao 编辑于 2016-12-30 17:21,总共编辑了 1 次

页首
 用户资料  
 
2 楼 
 文章标题 : Re: iptables的问题
帖子发表于 : 2016-03-22 17:57 

注册: 2009-08-04 16:33
帖子: 16893
送出感谢: 21
接收感谢: 1827
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.html
引用:
web服务器发送回来的数据包难道不是ESTABLISHED状态的么?

2. 送回來in both directions 不符合
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?


页首
 用户资料  
 
3 楼 
 文章标题 : Re: iptables的问题
帖子发表于 : 2016-03-22 20:51 

注册: 2015-10-28 15:18
帖子: 11
系统: Archlinux
送出感谢: 0 次
接收感谢: 0 次
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.html
引用:
web服务器发送回来的数据包难道不是ESTABLISHED状态的么?

2. 送回來in both directions 不符合
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?


我把一样的配置放到虚拟机上,发现虚拟机上能正常访问,重装了一下系统,结果好了.....


页首
 用户资料  
 
4 楼 
 文章标题 : Re: iptables的问题
帖子发表于 : 2016-03-22 21:20 

注册: 2009-08-04 16:33
帖子: 16893
送出感谢: 21
接收感谢: 1827
引用:
发现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状态的么?


页首
 用户资料  
 
5 楼 
 文章标题 : Re: iptables的问题
帖子发表于 : 2016-03-22 21:32 

注册: 2015-10-28 15:18
帖子: 11
系统: Archlinux
送出感谢: 0 次
接收感谢: 0 次
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状态的么?


DNS的可能性我用ip方式排除了.我的理解是vps用wget获取web数据(80或者443),那么vps应该会发出一个带NEW状态的包给目标web服务器,我的OUTPUT是全部ACCEPT的,所以这个包应该是能发送到web服务器的,而web服务器应该会返回带ESTABLISHED的数据包,应该不会被vps的防火墙给拦住. 这样理解不知道有没有问题 :em06


页首
 用户资料  
 
6 楼 
 文章标题 : Re: iptables的问题
帖子发表于 : 2016-03-23 5:42 

注册: 2009-08-04 16:33
帖子: 16893
送出感谢: 21
接收感谢: 1827
引用:
我的理解是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


页首
 用户资料  
 
7 楼 
 文章标题 : Re: iptables的问题
帖子发表于 : 2016-03-23 13:18 

注册: 2015-10-28 15:18
帖子: 11
系统: Archlinux
送出感谢: 0 次
接收感谢: 0 次
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

这条我加了,但是没效果


页首
 用户资料  
 
8 楼 
 文章标题 : Re: iptables的问题
帖子发表于 : 2016-03-23 17:59 

注册: 2009-08-04 16:33
帖子: 16893
送出感谢: 21
接收感谢: 1827
引用:
这条我加了,但是没效果

你是希望達到什麼效果 ?


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 8 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 1 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译