(simpel) traffic shaping

From: Michael (none@michael--subwire.dk.lh.bsd-dk.dk)
Date: Fri 14 Nov 2003 - 00:24:55 CET


From: "Michael" <none@michael--subwire.dk.lh.bsd-dk.dk>
To: <none@bsd-dk--bsd-dk.dk.lh.bsd-dk.dk>
Subject: (simpel) traffic shaping
Date: Fri, 14 Nov 2003 00:24:55 +0100

Prøver at få traffic shaping til at fungere ordentligt.

Målet er højeste prioritet til HTTP+SSH og laveste til resten. Eller endnu
bedre at sætte en grænse på f.eks. 215/128 til peer2peer prgrammer.

Forløbig har jeg

fwcmd=/sbin/ipfw
inet=192.168.1.1/24
imask=255.255.255.0
oif=rl0
iif=rl1

# do some traffic-shaping, configure a pipe
${fwcmd} pipe 10 config bw 512Kbit/s
${fwcmd} pipe 20 config bw 2Mbit/s

# create some queues with various weight
${fwcmd} queue 12 config pipe 10 weight 100
${fwcmd} queue 14 config pipe 10 weight 50
${fwcmd} queue 16 config pipe 10 weight 5
${fwcmd} queue 22 config pipe 20 weight 100
${fwcmd} queue 24 config pipe 20 weight 50
${fwcmd} queue 26 config pipe 20 weight 5

# iif
${fwcmd} add 340 queue 12 tcp from ${inet}:${imask} to any dst-port http in
recv ${iif}
${fwcmd} add 340 queue 12 tcp from ${inet}:${imask} to any dst-port ssh in
recv ${iif}
${fwcmd} add 340 queue 12 udp from ${inet}:${imask} to any dst-port 53 in
recv ${iif}
${fwcmd} add 340 queue 14 tcp from ${inet}:${imask} to any dst-port smtp in
recv ${iif}
${fwcmd} add 340 queue 14 tcp from ${inet}:${imask} to any dst-port pop3 in
recv ${iif}
${fwcmd} add 340 queue 16 tcp from ${inet}:${imask} to any dst-port ftp in
recv ${iif}
${fwcmd} add 340 queue 16 ip from ${inet}:${imask} to any in recv ${iif}

# oif
${fwcmd} add 350 queue 22 tcp from any to ${inet}:${imask} src-port http in
recv ${oif}
${fwcmd} add 350 queue 22 tcp from any to ${inet}:${imask} src-port ssh in
recv ${oif}
${fwcmd} add 350 queue 22 udp from any to ${inet}:${imask} src-port 53 in
recv ${oif}
${fwcmd} add 350 queue 24 tcp from any to ${inet}:${imask} src-port smtp in
recv ${oif}
${fwcmd} add 350 queue 24 tcp from any to ${inet}:${imask} src-port pop3 in
recv ${oif}
${fwcmd} add 350 queue 24 tcp from any to ${inet}:${imask} src-port ftp in
recv ${oif}
${fwcmd} add 350 queue 26 ip from any to ${inet}:${imask} in recv ${oif}

...

Jeg forventer naturligvis ikke at nogen skulle lave et script til mig, men
måske nogen kan se hvorfor dette ikke ser ud til at virke, eller dette er
helt forkert?

Findes der evt. en eller anden form for generator til dette? Eller er der
andre tricks? :)

Jeg har DUMMYNET i kernen.

--
Mvh
Michael



This archive was generated by hypermail 2b30 : Wed 15 Nov 2006 - 18:24:33 CET