iptables设置后好像不生效,麻烦帮忙看下
本帖最后由 file3 于 2015-11-23 15:40 编辑在centos7上使用一下命令配置:iptables -P INPUT DROP
iptables -I INPUT -p tcp -m tcp --dport 6379 -j ACCEPT在使用nc开启服务:nc -l -p 6379 -v再从其他机器上连接这台机器的tcp:6379,但是nc上没有任何打印。
从iptables -nvL看Chain INPUT (policy ACCEPT 226K packets, 28M bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp--virbr0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:53
0 0 ACCEPT tcp--virbr0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:53
0 0 ACCEPT udp--virbr0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:67
0 0 ACCEPT tcp--virbr0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:67
0 0 ACCEPT tcp--* * 0.0.0.0/0 0.0.0.0/0 tcp dpt:6379的pkts和bytes很久才会有反应,tcp已经建联超时了这里都不一定有反应。
麻烦各位大神看下这是为什么。谢谢。
另外:在使用iptables -P INPUT ACCEPT的时候依然是nc没有任何反应。 RHEL7的网络设置变了,可以搜索下
页:
[1]