论坛风格切换切换到宽版
  • 830阅读
  • 4回复

[问题求助]iptables -t filter -A INPUT -s 192.168.1.2 -j DROP [复制链接]

上一主题 下一主题
离线yangjfa.
 
发帖
2064
C币
-152459
威望
378
贡献值
1
银元
-1
铜钱
4551
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
iptables -t filter -A IN.PUT -s 192.168.1.2 -.j DROP.
我是否写错了,我的本意是让192.168.1.2 不能ping通我的.linux.电影

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线twttwt.
发帖
2015
C币
-60598
威望
373
贡献值
1
银元
-1
铜钱
4450
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
Re:iptables
man iptables,或者看看 iptables 手册
INPUT 和 FORWARD 两个链的功能是不同的

发帖
2099
C币
-235665
威望
403
贡献值
1
银元
-1
铜钱
4673
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-13
Re:iptables
如果你想单向无法ping通的话(就是说192.168.1.2无法ping通你,但你可以ping通192.168.1.2),还应该加一个--syn的参数

离线lzzsgsb.
发帖
2008
C币
-262851
威望
381
贡献值
7
银元
3
铜钱
4528
人人网人气币
0
只看该作者 地板  发表于: 2010-04-13
Re:iptables


QUOTE:原帖由 "czcaozheng"]如果你想单向无法ping通的话(就是说192.168.1.2无法ping通你,但你可以ping通192.168.1.2),还应该加一个--syn的参数[/quote 发表:

man iptables
[quote]
       [!] --syn
              Only  match TCP packets with the SYN bit set and the ACK and RST
              bits cleared.  Such packets are used to request  TCP  connection
              initiation;  for  example,  blocking  such  packets coming in an
              interface will prevent incoming TCP  connections,  but  outgoing
              TCP  connections will be unaffected.  It is equivalent to --tcp-
              flags SYN,RST,ACK SYN.  If the "!" flag  precedes  the  "--syn",
              the sense of the option is inverted.

由此得知,--syn 是属于 TCP 协议的,而不是 ICMP,因此你说的是错误的
若想阻止 ping 而允许 pong,应该细化到 icmp-type 的 0 和 8

发帖
1968
C币
-235592
威望
358
贡献值
1
银元
0
铜钱
4434
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-13
Re:iptables
多谢大家的指点,我明白了
快速回复
限100 字节
如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
 
上一个 下一个