mas_raka
November 13th, 2003, 02:50
I have set up freebsd with pf from port, all running well : but i have problem in altq section . what i want is student network have bandwith 60% from 128K/s and office have 40% from that bandwith too.

Here's part of my pf.conf :

# Macros: define common values, so they can be referenced and changed easily.
ext_if="fxp0" # replace with actual external interface name i.e., dc0
int_if="fxp1" # replace with actual internal interface name i.e., dc1
lan3="xl0"
internal_net="192.168.1.0/24"
external_addr="202.159.31.198"
unfiltered = "{ lo0, fxp1, xl0 }"
unroutable = "{ 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, \
192.168.0.0/16, 255.255.255.255/32 }"
#warganegara
student ="192.168.1.0/24"
office = "192.168.2.0/24"


set loginterface $ext_if
set limit states 10000
set limit frags 500

scrub in on $ext_if all fragment reassemble
scrub out on $ext_if all random-id fragment reassemble

#bandwithnya neh
# traffic to Internet , sebelumnya pake default neh utk wnet default borrow red
altq on $ext_if bandwidth 128Kb cbq queue {student, office }
queue student bandwidth 60% cbq(default borrow red)
queue office bandwidth 40% priority 7 cbq(borrow red)

# nat & redirectionnya
no nat on $unfiltered from any to any
no rdr on $unfiltered from any to any


#192.168.1.0/24 ==> student
nat on $ext_if inet from 192.168.1.0/24 to any -> $ext_if

#192.168.2.0/24 ==> office
nat on $ext_if inet from 192.168.2.0/24 to any -> $ext_if

when i view altq :

goten# pfctl -vvsq
queue root_fxp0 bandwidth 128Kb priority 0 cbq( wrr root ) {student, office}
[ pkts: 22047 bytes: 3248656 dropped pkts: 0 bytes: 0 ]
[ qlength: 0/ 50 borrows: 0 suspends: 0 ]
queue student bandwidth 99Kb cbq( red borrow default )
[ pkts: 22047 bytes: 3248656 dropped pkts: 0 bytes: 0 ]
[ qlength: 0/ 50 borrows: 268 suspends: 0 ]
queue office bandwidth 66Kb priority 7 cbq( red borrow )
[ pkts: 0 bytes: 0 dropped pkts: 0 bytes: 0 ]
[ qlength: 0/ 50 borrows: 0 suspends: 0 ]

i try to connect using ip 192.168.1.10 and other computer using 192.168.2.15 but the output of pfctl -vvsq still same on "queue office bandwidth" return 0 .

Any idea how to fix that ?

bsdjunkie
November 15th, 2003, 21:03
Bumping this topic for you..

Ive never used altq, nor pf on freebsd, but hopefully someone may have an idea...