- 论坛徽章:
- 0
|
pc----------------------------openbsd4.2-------------------------cisco
10.6.103.19 10.6.103.18 10.6.103.2 10.6.103.1
按照上图连接,装好openbsd4.2后,pc即可ssh登陆10.6.103.18,设置网桥:
vi /etc/bridgename.bridge0
add rl0 add rl1 up
:wq
reboot
pc机即可上网了。
vi /etc/rc.conf
找到 pf=NO 这一句,改为 pf=YES
:wq
修改pf配置
vi /etc/pf.conf
具体为:
#========= my pf ========
# OpenBSD4.2: queue, 2008/04/15
ext_if = "rl1"
altq on $ext_if cbq bandwidth 1Mb \
queue { deflt, http, ssh, mail, rsets, ftp }
queue deflt bandwidth 10% priority 0 cbq(default ecn)
queue http bandwidth 100Kb priority 3 { http_vhosts, http_cust1 }
queue http_vhosts bandwidth 40% cbq(borrow red)
queue http_cust1 bandwidth 100Kb
queue mail bandwidth 10% priority 1
queue ssh bandwidth 50Kb priority 7 cbq(borrow)
queue rsets bandwidth 75Kb priority 0 cbq(red)
queue ftp bandwidth 10Kb priority 1 cbq
block return in on $ext_if inet all queue rsets
pass in on $ext_if inet proto tcp from any to any port 80 queue http
pass out on $ext_if inet proto tcp from any to any port 22 queue ssh
pass in on $ext_if inet proto tcp from any to any port 22 queue ssh
pass out on $ext_if inet proto tcp from any to any port 25 queue mail
pass in on $ext_if inet proto tcp from any to any port 21 queue ftp
pass out on $ext_if inet all
然后执行:# pfctl -F all -f /etc/pf.conf ,系统显示为如下:
rules cleared
nat cleared
0 tables deleted.
altq cleared
6 states cleared
source tracking entries cleared
pf: statistics cleared
pf: interface flags reset
pfctl: the sum of the child bandwidth higher than parent "http"
#
在pc上用“FlashFXP”下载一个单位内网的高清电影,速度由pf没限制前的数兆变为了400KB(“FlashFXP”软件状态栏显示数据),无论怎么改ftp的带宽都有这么高,不知道怎么回事?再就是上面那个“子带宽之和高于父带宽”的提示总有。
请指教原因。
我的出发点是想在比较乱的网段至6509之间加个pf控制流量,目前仅一台pc的流量都不能准确控制,没法再进一步试验控制网段内各ip的流量了。 |
|