免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3281 | 回复: 4
打印 上一主题 下一主题

iptables的规则.请教高手.菜鸟问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-04 16:20 |只看该作者 |倒序浏览
10可用积分
如何要在LINUX让防火墙开放ftp和samba端口呢?
我是这样写的
iptables -A INPUT -p tcp --sport ftp -j ACCEPT
iptables -A INPUT -p tcp --sport 546 -j ACCEPT
iptables -A INPUT -p tcp --sport 547 -j ACCEPT
是不是需要把3个表都写满呢?
我这边的环境还是有新的一张表的.是别人建的.
iptables -L结果是这样的
Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere            icmp any
ACCEPT     ipv6-crypt--  anywhere             anywhere
ACCEPT     ipv6-auth--  anywhere             anywhere
ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:5353
ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
ACCEPT     udp  --  anywhere             anywhere            udp dpt:2198
ACCEPT     udp  --  anywhere             anywhere            udp dpt:2199
ACCEPT     udp  --  anywhere             anywhere            udp dpt:2200
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:webcache
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:1099
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ftp
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
           tcp  --  anywhere             anywhere            tcp spt:ftp
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:ftp
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:dhcpv6-client
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:dhcpv6-server
           tcp  --  anywhere             anywhere            tcp spt:dhcpv6-client
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:dhcpv6-client
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:dhcpv6-server
ACCEPT     udp  --  anywhere             anywhere            udp spt:dhcpv6-client
ACCEPT     udp  --  anywhere             anywhere            udp spt:dhcpv6-server
我想请问各位大虾我要怎样改呢?

论坛徽章:
0
2 [报告]
发表于 2007-12-05 09:37 |只看该作者
iptables -A INPUT -p tcp --dport ftp -j ACCEPT
iptables -A INPUT -p tcp --dport 445 -j ACCEPT

论坛徽章:
0
3 [报告]
发表于 2008-04-23 11:57 |只看该作者
请把其它的chain都打印出来看看.
iptables -L -n

论坛徽章:
0
4 [报告]
发表于 2008-05-29 10:57 |只看该作者
用IPTABLEA -NVXL
看看你的规则

论坛徽章:
0
5 [报告]
发表于 2008-05-30 08:56 |只看该作者
iptables-save
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP