找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5409|回复: 12

[限速] 怎样在ROS里面根据端口号限速

[复制链接]
发表于 2007-4-27 00:28:49 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
请问怎样在了ros里面根据端口号的多少来限制速度?例如:如何将除80端口以外的端口限速,谢谢!
routeros
 楼主| 发表于 2007-4-27 02:12:57 | 显示全部楼层
千万别沉下去啊,还请各位大侠帮助!~~
routeros
回复

使用道具 举报

发表于 2007-4-27 11:09:50 | 显示全部楼层
mark 80端口 为mark_http ,mark !80为 mark_all 然后做queue tree,坛子里有教程,搜
routeros
回复

使用道具 举报

 楼主| 发表于 2007-4-27 14:06:14 | 显示全部楼层
大哥,我找不到那个帖子啊!有没有例子啊,给我Copy一份可以吗,叩谢!~~
routeros
回复

使用道具 举报

发表于 2007-4-27 17:03:28 | 显示全部楼层
先mark包
0   ;;; mark_conn_all
     chain=prerouting action=mark-connection
     new-connection-mark=mark-conn-all passthrough=yes


1   ;;; mark-all
     chain=prerouting connection-mark=mark-conn-all action=mark-packet
     new-packet-mark=mark-all passthrough=yes


4   ;;; mark-conn-http
     chain=prerouting protocol=tcp dst-port=80 action=mark-connection
     new-connection-mark=mark-conn-http passthrough=yes

5   ;;; NAT 80 Mark
     chain=prerouting protocol=tcp src-port=80 action=mark-connection
     new-connection-mark=mark-conn-http passthrough=yes


7   ;;; mark-http
     chain=prerouting connection-mark=mark-conn-http action=mark-packet
     new-packet-mark=mark-http passthrough=yes


在queue/tree
0   name="all-download" parent=Bridge1 packet-mark="" limit-at=0
     queue=pqc_down priority=8 max-limit=850000 burst-limit=0
     burst-threshold=0 burst-time=0s

1   name="all-upload" parent=all_upload1 packet-mark=mark-all limit-at=0
     queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s

2   name="http-upload" parent=all_upload1 packet-mark=mark-http limit-at=0
     queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s


5   name="n_http_all_down" parent=all-download packet-mark=mark-all limit-at=>
     queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s

6   name="http-download" parent=all-download packet-mark=mark-http limit-at=0
     queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s

7   name="all_upload1" parent=PPPOE packet-mark="" limit-at=0 queue=default
     priority=8 max-limit=350000 burst-limit=0 burst-threshold=0
     burst-time=0s

我的是80端口优先,改一下就可以对非80端口限速了。
routeros
回复

使用道具 举报

 楼主| 发表于 2007-4-28 09:32:02 | 显示全部楼层
楼上的大侠,我想做的是限制 非 80 端口的速度,而不限制80端口的速度啊!~~~
routeros
回复

使用道具 举报

发表于 2007-4-28 10:18:57 | 显示全部楼层

我已经写的很清楚了,不限制80端口,就不标记他,其他一样,把mark-connection 那里的端口改成!80就ok了.
routeros
回复

使用道具 举报

 楼主| 发表于 2007-4-28 12:08:11 | 显示全部楼层
只需要将80改为!80就可以了吗,其他的是不是跟上面的一样都不需要更改啊?大哥,我对命令行不是很熟悉~~
routeros
回复

使用道具 举报

 楼主| 发表于 2007-4-28 12:26:49 | 显示全部楼层
5   ;;; NAT 80 Mark
     chain=prerouting protocol=tcp src-port=80 action=mark-connection
     new-connection-mark=mark-conn-http passthrough=yes

这条是什么意思啊?我的网络里没有NAT,这条还用加吗?
routeros
回复

使用道具 举报

发表于 2007-4-28 12:50:48 | 显示全部楼层
原帖由 kriz777 于 2007-4-28 12:26 发表
5   ;;; NAT 80 Mark
     chain=prerouting protocol=tcp src-port=80 action=mark-connection
     new-connection-mark=mark-conn-http passthrough=yes

这条是什么意思啊?我的网络里没有NAT,这条还 ...

我的注释错了,这条是http 80的上行标记
routeros
回复

使用道具 举报

 楼主| 发表于 2007-4-28 13:28:51 | 显示全部楼层
上行和下行都必须单独标记吗?能不能不标记它啊。另外上面提到的all_Upload、all_Upload1、all-download
等都是预先设置的规则吧,我这里没有,也没找到从哪儿设置。这些就应该是标记上行和下行的策略吧?

另外可以加我吗?我的QQ381856781  MSN:kriz_z@hotmail.com
routeros
回复

使用道具 举报

 楼主| 发表于 2007-4-29 08:33:05 | 显示全部楼层
大哥,根据你的配置怎么改啊?我搞了一天也没明白过来,呵呵!~

为什么一定要先做Mark Connection 再做 Mark Packet 吗?  我直接把 port= !80 protocol = tcp 然后 直接选取 Mark packet 这样不可以吗?

另外我看到你用的是PCQ,我不想用PCQ。因为我无论在网络是否空闲的状态下也要限制速度。请指教!~

我最后的结果是要么全部限速了,要么就什么也没限制到。
routeros
回复

使用道具 举报

发表于 2007-4-29 10:07:42 | 显示全部楼层
我使用了htb,你可以不使用,我是直接从我的 ros copy过来的.已经加了你的msn了
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-9-29 19:15 , Processed in 0.149573 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表