论坛风格切换切换到宽版
  • 904阅读
  • 8回复

[问题求助]iptables 中的--reject -with是什么东东 [复制链接]

上一主题 下一主题
离线twttwt.
 
发帖
2015
C币
-60598
威望
373
贡献值
1
银元
-1
铜钱
4450
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
iptables 中的--reject -with是什么东东,我每次重新启.动iptables.服务,都会报这个东东语法错误,应该是系统里自己带的,我从来没添加过的,实在没办法,.我只能把有这个的几句用#注释掉,但是我新加的nat语句好像在里面看不到了,奇怪.了电影
q.JPG (.93.86 KB) 电脑
下载次数:6
20.05-03-24 09:30           鲜花

http://upload.bbs.csuboy.com/Mon_1004/126_7078_d5bc2627c9c7611.jpg[/img]    美容

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

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线liuxiao30.
发帖
2037
C币
-140620
威望
363
贡献值
1
银元
-1
铜钱
4544
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
Re:iptables
man iptables


QUOTE:   REJECT
       This  is  used  to send back an error packet in response to the matched
       packet: otherwise it is equivalent to DROP so it is a terminating  TAR-
       GET,  ending  rule  traversal.  This target is only valid in the INPUT,
       FORWARD and OUTPUT chains,  and  user-defined  chains  which  are  only
       called  from those chains.  The following option controls the nature of
       the error packet returned:

       --reject-with type
              The type given can be
               icmp-net-unreachable
               icmp-host-unreachable
               icmp-port-unreachable
               icmp-proto-unreachable
               icmp-net-prohibited
               icmp-host-prohibited or
               icmp-admin-prohibited (*)
              which return the appropriate ICMP error  message  (port-unreach-
              able is the default).  The option tcp-reset can be used on rules
              which only match the TCP protocol: this causes a TCP RST  packet
              to  be  sent  back.   This  is  mainly useful for blocking ident
              (113/tcp) probes which frequently occur  when  sending  mail  to
              broken mail hosts (which won't accept your mail otherwise).

       (*)  Using  icmp-admin-prohibited  with  kernels that do not support it
       will result in a plain DROP instead of REJECT

是什么都在里面写了,要学会如何自学

另外,人家是“--reject-with”,你的好像有的是“--reject -with”,多了一个空格,难怪会报错

离线dm15.
发帖
2010
C币
-60893
威望
371
贡献值
1
银元
-1
铜钱
4454
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-13
Re:iptables
多谢版主
但是我去掉空格也试了
提示  unkown arg  '--reject-with'
还是不行啊

离线lun0412.
发帖
2057
C币
-132078
威望
382
贡献值
1
银元
-2
铜钱
4590
人人网人气币
0
只看该作者 地板  发表于: 2010-04-13
Re:iptables
那这样
你一条一条手动去写,看到底哪句话不行,然后贴出来我看一下

离线54nb.
发帖
2136
C币
-140107
威望
384
贡献值
1
银元
-4
铜钱
4658
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-13
Re:iptables
我试过了,如图,只要带 --reject-with或--reject -with字样的都通不过,不知我的iptables是否与其它人的默认是否一样,因为刚装好时是没错误的,还有,能否恢复到原始状态呢,
用什么命令?

离线卡西亚.
发帖
2146
C币
-60466
威望
407
贡献值
1
银元
-1
铜钱
4829
人人网人气币
0
只看该作者 5楼 发表于: 2010-04-13
Re:iptables
iptables -A INPUT -s 1.1.1.1 -j REJECT
iptables -A INPUT -s 1.1.1.1 -j REJECT --reject-with icmp-host-unreachable
两个都不行吗?还是第一个行第二个不行?

离线paranoia.
发帖
1941
C币
-263065
威望
356
贡献值
1
银元
-2
铜钱
4372
人人网人气币
0
只看该作者 6楼 发表于: 2010-04-13
Re:iptables
我试了,好像些不进去啊,执行完了,打开iptables,里面没有任何改变,
我直接将
-A INPUT -s 1.1.1.1 -j REJECT
-A INPUT -s 1.1.1.1 -j REJECT --reject-with icmp-host-unreachable
添加到iptables里,执行没问题,

发帖
2117
C币
-235085
威望
407
贡献值
1
银元
-3
铜钱
4779
人人网人气币
0
只看该作者 7楼 发表于: 2010-04-13
Re:iptables
把iptables-save出来的东西一个一个手动执行,看看哪个不行

离线lsp678.
发帖
2033
C币
-60763
威望
381
贡献值
1
银元
-3
铜钱
4575
人人网人气币
0
只看该作者 8楼 发表于: 2010-04-13
Re:iptables
--reject-with是针对“-j REJECT”用的
而你这句话是“-j ACCEPT”
当然不行了
快速回复
限100 字节
如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
 
上一个 下一个