免费注册 查看新帖 |

Chinaunix

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

[网络管理] 能否减小iptables作nat时的延迟? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-02-20 04:15 |只看该作者 |倒序浏览
网吧10M光纤接入,用一台客户机直接接光猫上网,用IE开2个窗口下载,速度有1.2m/s,估计已是最大速度,这时ping电信dns服务器,time值只有15以内

用一台客户机接一台交换机,再接光猫上网,最大速度下载,这时time值也是15ms以内。
但如果中间加一台linux作nat上网的话,下载时的time值就变成100ms了。
而在别的一家网吧,一样的测试环境,time值也就15ms,还有一家网吧情况和我这一样,不过那网吧用的是tp-link的路由器,别的条件一样。
linux版本是经过二次开发的sw2.0,网卡都是用的8139D的,差是差了点,不过跑那么点数据,应该不会有什么问题吧。
请问怎么样设置iptables里的相关参数, 减小延迟?

论坛徽章:
0
2 [报告]
发表于 2006-02-20 07:38 |只看该作者
iptables-save
看一下再说

论坛徽章:
0
3 [报告]
发表于 2006-02-20 13:38 |只看该作者
减小延迟大多需要靠硬件来撑,不过linux的iptables的tos设置得当,可以让你需要的某些服务优先进出是真的...这样也变相地减小了(必要应用)的延迟

论坛徽章:
0
4 [报告]
发表于 2006-02-20 16:31 |只看该作者
[root@smoothwall root]# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination
ipac~o     all  --  anywhere             anywhere
ipblock    all  --  anywhere             anywhere
ipblock    all  --  anywhere             anywhere
ipblock    all  --  anywhere             anywhere
advnet     all  --  anywhere             anywhere
advnet     all  --  anywhere             anywhere
advnet     all  --  anywhere             anywhere
spoof      all  --  anywhere             anywhere
spoof      all  --  anywhere             anywhere
spoof      all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
secin      all  --  anywhere             anywhere
block      all  --  anywhere             anywhere
LOG        all  --  anywhere             anywhere           LOG level warning
REJECT     all  --  anywhere             anywhere           reject-with icmp-port-unreachable

Chain FORWARD (policy DROP)
target     prot opt source               destination
ipac~fi    all  --  anywhere             anywhere
ipac~fo    all  --  anywhere             anywhere
ipblock    all  --  anywhere             anywhere
ipblock    all  --  anywhere             anywhere
ipblock    all  --  anywhere             anywhere
secout     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere           state NEW
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere           state NEW
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere           state NEW
portfwf    all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
LOG        all  --  anywhere             anywhere           LOG level warning
REJECT     all  --  anywhere             anywhere           reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ipac~i     all  --  anywhere             anywhere

Chain advnet (3 references)
target     prot opt source               destination

Chain block (1 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere
xtaccess   all  --  anywhere             anywhere
ipsec      all  --  anywhere             anywhere
ipsec      all  --  anywhere             anywhere
ipsec      all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     icmp --  anywhere             192.168.1.0/24

Chain dmzholes (0 references)
target     prot opt source               destination

Chain ipac~fi (1 references)
target     prot opt source               destination
           all  --  anywhere             anywhere
           all  --  anywhere             anywhere

Chain ipac~fo (1 references)
target     prot opt source               destination
           all  --  anywhere             anywhere
           all  --  anywhere             anywhere

Chain ipac~i (1 references)
target     prot opt source               destination
           all  --  anywhere             anywhere
           all  --  anywhere             anywhere

Chain ipac~o (1 references)
target     prot opt source               destination
           all  --  anywhere             anywhere
           all  --  anywhere             anywhere

Chain ipblock (6 references)
target     prot opt source               destination

Chain ipsec (3 references)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere           udp dpt:isakmp
ACCEPT     gre  --  anywhere             anywhere
ACCEPT     ipv6-crypt--  anywhere             anywhere

Chain portfwf (1 references)
target     prot opt source               destination

Chain secin (1 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain secout (1 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain spoof (3 references)
target     prot opt source               destination
DROP       all  --  192.168.0.0/24       anywhere

Chain xtaccess (1 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:auth

论坛徽章:
0
5 [报告]
发表于 2006-02-20 16:37 |只看该作者
[root@smoothwall root]# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
jmpsquid   all  --  anywhere             anywhere
portfw     all  --  anywhere             anywhere

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  anywhere             anywhere
MASQUERADE  all  --  anywhere             anywhere
MASQUERADE  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain jmpsquid (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             10.0.0.0/8
RETURN     all  --  anywhere             172.16.0.0/12
RETURN     all  --  anywhere             192.168.0.0/16
RETURN     all  --  anywhere             169.254.0.0/16
squid      all  --  anywhere             anywhere

Chain portfw (1 references)
target     prot opt source               destination

Chain squid (1 references)
target     prot opt source               destination
[root@smoothwall root]#

论坛徽章:
0
6 [报告]
发表于 2006-02-20 16:41 |只看该作者
这是设了IP后,防火墙自动生成的脚本。

skylove说用tos,现在要让下载的流量最后出去,但IE下载端口是80,怎么区别这些流量?

论坛徽章:
0
7 [报告]
发表于 2006-02-21 00:22 |只看该作者
这个防火墙规则看着跟论文是的。。。。

论坛徽章:
0
8 [报告]
发表于 2006-02-21 00:32 |只看该作者
原帖由 platinum 于 2006-2-21 00:22 发表
这个防火墙规则看着跟论文是的。。。。



有什么问题说啊,别掉我喟口了.

论坛徽章:
0
9 [报告]
发表于 2006-02-21 08:03 |只看该作者
你没加 -v 参数,又没贴 iptables-save 的结果,我看起来都一样
比如这些
[root@smoothwall root]# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination
ipac~o     all  --  anywhere             anywhere
ipblock    all  --  anywhere             anywhere
ipblock    all  --  anywhere             anywhere
ipblock    all  --  anywhere             anywhere
advnet     all  --  anywhere             anywhere
advnet     all  --  anywhere             anywhere
advnet     all  --  anywhere             anywhere
spoof      all  --  anywhere             anywhere
spoof      all  --  anywhere             anywhere
spoof      all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

看着大量的这些东西,我只有两个感觉
1、太多了,像论文
2、都一样,像小学被老师罚抄课文 n 遍。。。

这样的规则不造成延迟才怪

论坛徽章:
0
10 [报告]
发表于 2006-02-21 19:24 |只看该作者
iptables -V 是显示版本信息,有啥用啊。
iptables-save由于不是redhat,所以没这个命令。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP