Страница 1 из 1

PIPE и QUEUE в IPFW

Добавлено: 2009-07-27 8:28:52
ScoRpuwa
ДЕло вот в чем, есть сеть, у меня на сервере прописано вот так, но почему-то не ощущается приоритета. Да и когда нет никого в сети тож немного инет работат с тормозами. Что, где я неправильно прописал? Помогите!

Код: Выделить всё

#!/bin/sh
cmd="ipfw -q add"
ipfw -f flush
ipfw -f queue flush
ipfw -f pipe flush
ipfw disable one_pass
lan="192.168.0.0/24"
nat="/sbin/natd"
$nat -n tun0 -p 8667 -s -m -dynamic

ipfw pipe 1 config bw 110KB/s
ipfw pipe 2 config bw 500Kbit/s

$cmd 1 deny MAC any ff:ff:ff:ff:ff:ff
$cmd 2 deny MAC ff:ff:ff:ff:ff:ff any

ipfw queue 1 config pipe 1 weight 80 queue 50 mask dst-ip 0xffffffff
ipfw queue 2 config pipe 1 weight 40 queue 50 mask dst-ip 0xffffffff
ipfw queue 3 config pipe 1 weight 2 queue 50 mask dst-ip 0xffffffff

$cmd 100 pass all from any to any via lo0
$cmd 105 deny all from 127.0.0.1/8 to any
$cmd 110 deny all from any to 127.0.0.1/8
$cmd 111 pass all from $lan to me in via sis0
$cmd 112 pass all from me to $lan out via sis0
$cmd 115 deny all from $notlan  to not me
$cmd 116 deny all from not me to $notlan

$cmd 135 divert 8667 all from $users to any out via tun0
$cmd 140 divert 8667 all from any to me in via tun0

$cmd 141 queue 1 all from any to 192.168.0.0/24\{3,101,201,253} in via tun0
$cmd 142 queue 2 all from any to 192.168.0.0/24\{1,2,9,10,13,16,21,24} in via tun0
$cmd 143 queue 3 all from any to 192.168.0.0/24\{7,15,30} in via tun0

$cmd 145 pass all from me to any out via tun0
$cmd 150 pass all from any to me in via tun0
$cmd 155 pass all from any to $lan in via tun0

$cmd 160 pass all from $lan to not me in via sis0
$cmd 165 pass all from not me to $lan out via sis0
$cmd 180 pass all from me to any out via rl0
$cmd 185 pass all from any to me in via rl0
$cmd 190 deny log  all from any to any

Re: PIPE и QUEUE в IPFW

Добавлено: 2009-07-27 9:50:52
hizel
ipfw pipe show

Re: PIPE и QUEUE в IPFW

Добавлено: 2009-07-27 12:50:51
ScoRpuwa

Код: Выделить всё

free# ipfw pipe show
00001: 880.000 Kbit/s    0 ms  24 KB 0 queues (1 buckets) droptail
00002: 500.000 Kbit/s    0 ms   50 sl. 0 queues (1 buckets) droptail
q00001: weight 80 pipe 1   30 sl. 1 queues (64 buckets) droptail
    mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
 53 ip           0.0.0.0/0       192.168.0.101/0      247   146478  0    0   0
q00002: weight 40 pipe 1   30 sl. 1 queues (64 buckets) droptail
    mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
 25 ip           0.0.0.0/0         192.168.0.9/0       17     5375  0    0   0
q00003: weight 2 pipe 1   30 sl. 1 queues (64 buckets) droptail
    mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
 14 ip           0.0.0.0/0        192.168.0.30/0      209   175995  0    0   0

Re: PIPE и QUEUE в IPFW

Добавлено: 2009-07-27 16:20:09
hizel
уменьшить ширину пайпа, исходящий трафик тоже шейпить?

Re: PIPE и QUEUE в IPFW

Добавлено: 2009-07-27 17:22:39
ScoRpuwa
Так канал 1024Кбит/с, исходящий не нужно шейпить ибо нет необходимости