Date: Mon, 10 Feb 2003 14:55:55 +0100 (CET) From: Claus Guttesen <none@cguttesen--yahoo.dk.lh.bsd-dk.dk> Subject: Re: ipfw og båndbredde-allokering (opfølgning) To: bsd-dk@bsd-dk.dk
Beklager forrige mail, fandt retur-tasten.
Fik vha. Nicolai Petri's fine indspil sat min firewall
op, så den blot tjekkede reglerne i én retning.
Mit formål var at tildele porte som http samt ssh høj
prioritet, og så skubbe ting som smtp, pop3, ftp etc.
længere ned. Men efter at have sat det i drift
opdagede jeg at den kun prioriterede på udgående
traffik, mens indgående havnede i samme potte. Årsagen
er naturligvis at jeg kobler mig mod en web-server på
port 80, mens retur-pakken havner over port 1023.
Efter at have nærlæst ipfw-manualen, fandt jeg ud af,
at jeg måtte opgradére til ipfw2, hvis jeg skulle
skelne imellem src-port samt dst-port. Manualen
beskriver meget godt, hvordan man skal opgradere,
Kræver i korte træk en rekompilering af kernen samt en
ændring af /etc/make.conf.
Mine regler endte med at se sådan ud:
# do some traffic-shaping, configure a pipe
${fwcmd} pipe 10 config bw 1Mbit/s
${fwcmd} pipe 20 config bw 1Mbit/s
# create some queues with various weight
${fwcmd} queue 11 config pipe 10 weight 50
${fwcmd} queue 12 config pipe 10 weight 25
${fwcmd} queue 13 config pipe 10 weight 5
${fwcmd} queue 21 config pipe 20 weight 50
${fwcmd} queue 22 config pipe 20 weight 25
${fwcmd} queue 23 config pipe 20 weight 5
# create some rules that will be applied to the queues
# inside-interface
${fwcmd} add 340 queue 11 tcp from 192.168.1.0/24 to
any dst-port http in recv xl0
${fwcmd} add 340 queue 11 tcp from 192.168.1.0/24 to
any dst-port ssh in recv xl0
${fwcmd} add 340 queue 12 tcp from 192.168.1.0/24 to
any dst-port smtp in recv xl0
${fwcmd} add 340 queue 12 tcp from 192.168.1.0/24 to
any dst-port pop3 in recv xl0
${fwcmd} add 340 queue 13 ip from 192.168.1.0/24 to
any in recv xl0
# outside-interface
${fwcmd} add 350 queue 21 tcp from any to
192.168.1.0/24 src-port http in recv xl1
${fwcmd} add 350 queue 21 tcp from any to
192.168.1.0/24 src-port ssh in recv xl1
${fwcmd} add 350 queue 22 tcp from any to
192.168.1.0/24 src-port smtp in recv xl1
${fwcmd} add 350 queue 22 tcp from any to
192.168.1.0/24 src-port pop3 in recv xl1
${fwcmd} add 350 queue 23 ip from any to
192.168.1.0/24 in recv xl1
Så nu er trafikken prioriteret i begge retning.
Hilsen
Claus
Har du problemer med din hjemmecomputer? Få hjælp med Yahoo!s PC-support på http://dk.shopping.yahoo.com/pcsupport/index.html
This archive was generated by hypermail 2b30 : Wed 15 Nov 2006 - 18:24:27 CET