请教:iptables的设置问题

由 jlyuan 在 01-15-2004 17:17 发表:

请教:iptables的设置问题

这是我的iptables的filter文件

Firewall configuration written by lokkit

Manual customization of this file is not recommended.

Note: ifup-post will punch the current nameservers through the

firewall; such entries will not be listed here.

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:RH-Lokkit-0-50-INPUT - [0:0]

-A INPUT -j RH-Lokkit-0-50-INPUT

-A FORWARD -j RH-Lokkit-0-50-INPUT

-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 389 --syn -j ACCEPT

-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 22 --syn -j ACCEPT

-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 80 --syn -j ACCEPT

-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 21 --syn -j ACCEPT

-A RH-Lokkit-0-50-INPUT -i lo -j ACCEPT

-A RH-Lokkit-0-50-INPUT -p udp -m udp -s 202.101.98.55 --sport 53 -d 0/0 -j ACCEPT

-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --syn -j REJECT

-A RH-Lokkit-0-50-INPUT -p udp -m udp -j REJECT

COMMIT

我的ftp连不上去,提示成功登陆,但后面出错,是什么原因啊???


由 jlyuan 在 01-15-2004 17:20 发表:


我加了一条:

-A RH-Lokkit-0-50-INPUT -p udp -m tcp --dport 20 --syn -j ACCEPT

提示配置文件出错

大家帮帮我啊!!


由 jlyuan 在 01-16-2004 08:43 发表:


没人知道吗???

自己顶一下


由 Brain 在 01-16-2004 09:34 发表:


> quote: > > * * * > > 最初由 jlyuan 发表
>
> **我加了一条:
>
> -A RH-Lokkit-0-50-INPUT -p udp -m tcp --dport 20 --syn -j ACCEPT
>
>
>
> 提示配置文件出错
>
>
>
> 大家帮帮我啊!! ** > > * * *

试试用-A RH-Lokkit-0-50-INPUT -p udp -m udp --dport 20 --syn -j ACCEPT


别以为苦出身就朴实长得拧吧就不花了

HP-COMPAQ NC6000

PM1.5,512M,ATI9600M,i8x0声卡,Combo光驱(幸福享用中)

内猫,无线网卡,兰牙(痛苦摸索中)

RH9,up to 2.6.4内核


由 Snoopy 在 01-27-2004 01:22 发表:


那不是redhat默认防火墙的规则吗?

感觉不大好用,还是自己写好


And then in the evening light, when the bars of freedom fall

I watch the two of you in the shadows on the wall

How in the darkness steals some of the choices from my hand

Then will I begin to under


由 jlyuan 在 01-29-2004 09:09 发表:

感觉不大好用,还是自己写好

请问斑竹 自己要怎么写啊? 写一个filter文件就可以了??

我现在用的是RH的默认防火墙,很想自己写一个,请赐教!~


由 Snoopy 在 01-29-2004 17:20 发表:


比如你想怎样,禁止icmp,禁止什么ip访问,禁止什么端口,

自己写当然比默认的防火墙好吧,之前我也是那样学过来的


And then in the evening light, when the bars of freedom fall

I watch the two of you in the shadows on the wall

How in the darkness steals some of the choices from my hand

Then will I begin to under


由 大熊宝宝 在 01-29-2004 17:23 发表:


请加载

modprobe ip_nat_ftp

modprobe ip_conntrack

modprobe ip_conntrack_ftp

不然怎么行


请兄弟们正确发贴,把问题发到相关版块 发贴标题请简明扼要 谢谢大家配合.

新会员发贴前请学会搜索论坛 有可能你的问题已经有答案了


由 jlyuan 在 01-30-2004 14:22 发表:

比如你想怎样,禁止icmp,禁止什么ip访问,禁止什么端口,

你所说的这些功能是在filter中加入一行指令就可以实现吗?

还有

请加载

modprobe ip_nat_ftp

modprobe ip_conntrack

modprobe ip_conntrack_ftp

是什么意思?为什么要加载他们?有什么用?我是菜鸟,请多指教。


由 Snoopy 在 01-30-2004 14:26 发表:


iptables -A INPUT -p icmp -j DROP

iptables -A INPUT -s ip -j DROP

iptables -A INPUT -p 协议 -p --dport 端口 -j DROP

比如icmp,上面是禁止所有icmp通信,具体想开什么得参考下文章


And then in the evening light, when the bars of freedom fall

I watch the two of you in the shadows on the wall

How in the darkness steals some of the choices from my hand

Then will I begin to under


由 jlyuan 在 01-30-2004 17:06 发表:

请问pinksnoopy兄:

我先把所有端口关掉

iptables -A INPUT -j DROP

然后开放一个ip(192.168.1.11)

iptables -A INPUT -s 192.168.1.11

开放22端口

iptables -A INPUT -p tcp --dport 22 -j ACCEPT

做完之后telnet 22端口可以通,可是我的ssh客户端连不上去这是怎么回事??


由 Snoopy 在 01-30-2004 17:11 发表:


那你的客户机的ip是不是1.11?

你上面那样写

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus