View Single Post
  #1   (View Single Post)  
Old 18th May 2009
Enemy Enemy is offline
New User
 
Join Date: May 2009
Posts: 3
Question [FreeBSD + PF cbq + borrow] Dynamic shaping

Hi all,

Before now I've only used IPFW + Dummynet, but decided to use PF and ALTQ for dynamic shaping. But I can't make it use whole bandwidth when there is only one host on, so the link is free, borrow parameter is designed to expand parent bandwidth when it is free, but not in my case

current configuration gives host only 50% of bandwidth even when the link is free,
here is PF config:
Code:
ext_if="rl0" # 
int_if="rl1" # 
lan="192.168.10.0/24" # LAN
set loginterface $ext_if

table <user1_ips> { 192.168.10.2, 192.168.10.5 } #IP addresses of user1
table <user2_ips> { 192.168.10.3 } #IP of user2
scrub in all
# IN
altq on $int_if cbq bandwidth 100Mb queue { inet_in, default_in }
queue inet_in bandwidth 512Kb { user1_in, user2_in }
queue user1_in bandwidth 50% cbq(red, borrow)
queue user2_in bandwidth 50% cbq(red, borrow)
queue default_in bandwidth 99% cbq(default)

# OUT
altq on $ext_if cbq bandwidth 100Mb queue { inet_out, default_out }
queue inet_out bandwidth 256Kb { user1_out, user2_out }
queue user1_out bandwidth 50% cbq(red, borrow)
queue user2_out bandwidth 50% cbq(red, borrow)
queue default_out bandwidth 99% cbq(default)

# NAT
nat on $ext_if from $lan to !$lan -> $ext_if

# Queues
# IN
pass in on $int_if from <user1_ips> to !$lan queue user1_out no state
pass in on $int_if from <user2_ips> to !$lan queue user2_out no state
# OUT
pass out on $int_if from !$lan to <user1_ips> queue user1_in no state
pass out on $int_if from !$lan to <user2_ips> queue user2_in no state
Also, when I'll solve this problem, I'd like to make different shapes for local-IX traffic and overseas (World) traffic, what's the best way to do this with this config?

Thanks!
Reply With Quote