免费注册 查看新帖 |

Chinaunix

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

关于iptables [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-04-05 16:54 |只看该作者 |倒序浏览
各位大侠,到底该打开哪些个udp端口才能正常浏览网页呢。我做的iptables 只有把匹配udp协议的包全放过才能进行正常网页浏览。我不想开那么多的udp端口,该打开那些端口呢?匹配tcp协议的包我打开了21、22、25、80、110这些。
诚心求教

论坛徽章:
0
2 [报告]
发表于 2005-04-05 16:57 |只看该作者

关于iptables

你一定是禁止了UDP/53
在FORWARD里打开就好了(如果做NAT)
或者在OUTPUT里打开(如果单机上网)

论坛徽章:
0
3 [报告]
发表于 2005-04-05 16:57 |只看该作者

关于iptables

帮你顶一下。
同时问一下楼主,你是如何打开80,21端口的?iptables的命令能不能贴出来?

论坛徽章:
0
4 [报告]
发表于 2005-04-05 17:11 |只看该作者

关于iptables

原帖由 "platinum" 发表:
你一定是禁止了UDP/53
在FORWARD里打开就好了(如果做NAT)
或者在OUTPUT里打开(如果单机上网)

我新建了一个FORWARD的子链udp_package,FORWARD链的默认策略是DROP,但在子链中打开了udp/53端口,可还是不行。版主老大,该怎么办呢?

论坛徽章:
0
5 [报告]
发表于 2005-04-05 17:12 |只看该作者

关于iptables

iptables -vL
把结果贴出来
如果你的firewall是写成一个shell的模式,贴出shell

论坛徽章:
0
6 [报告]
发表于 2005-04-05 17:22 |只看该作者

关于iptables

Chain INPUT (policy DROP 12653 packets, 825K bytes)
pkts bytes target     prot opt in     out     source               destination         
12271 6582K tcp_packager  tcp  --  any    any     anywhere             anywhere            
11233  785K udp_packager  udp  --  any    any     anywhere             anywhere            
   50  4408 icmp_packager  icmp --  any    any     anywhere             anywhere            
1109 81267 ACCEPT     all  --  eth0   any     192.168.10.0/24      anywhere            

Chain FORWARD (policy DROP 1481 packets, 161K bytes)
pkts bytes target     prot opt in     out     source               destination         
   73  4216 icmp_packager  icmp --  any    any     anywhere             anywhere            
3018  336K udp_packager  udp  --  any    any     anywhere             anywhere            
  566 66380 tcp_packager  tcp  --  any    any     anywhere             anywhere            
  716 92399 ACCEPT     all  --  eth0   eth1    anywhere             anywhere            

Chain OUTPUT (policy ACCEPT 13528 packets, 6679K bytes)
pkts bytes target     prot opt in     out     source               destination         

Chain icmp_packager (2 references)
pkts bytes target     prot opt in     out     source               destination         
   57  4604 ACCEPT     icmp --  any    any     anywhere             anywhere            icmp echo-request

Chain tcp_packager (2 references)
pkts bytes target     prot opt in     out     source               destination         
   16   784 ACCEPT     tcp  --  any    any     anywhere             anywhere            multiport dports ftp,ssh,smtp,http,pop3
11514 6582K ACCEPT     tcp  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED

Chain udp_packager (2 references)
pkts bytes target     prot opt in     out     source               destination         
   40  2594 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:domain

论坛徽章:
0
7 [报告]
发表于 2005-04-05 17:24 |只看该作者

关于iptables

如果我把udp_packager中的udp包全部ACCEPT,就可以正常访问

论坛徽章:
0
8 [报告]
发表于 2005-04-05 17:27 |只看该作者

关于iptables

iptables -A FORWARD -m state --ESTABLISHED,RELATED -j ACCEPT

论坛徽章:
0
9 [报告]
发表于 2005-04-05 17:29 |只看该作者

关于iptables

对了,内网:eth0 外网:eth1 ,该机器是网关,squid+iptables 做的透明代理

论坛徽章:
0
10 [报告]
发表于 2005-04-05 17:33 |只看该作者

关于iptables

[quote]原帖由 "platinum"]iptables -A FORWARD -m state --ESTABLISHED,RELATED -j ACCEPT[/quote 发表:

老大,为什么要加这一行呢,我不是在子链中放行了匹配ESTABLISHED和RELATED状态的包吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP