имеем сконфигуренный пайп на 300Кбит, но максимум он выдает 286 Кбит.
имеем сконфигуренный пайп на 1024Кбит, но максимум выдает 980 Кбит. Скорость мерил по http и ftp.
Система:
Код: Выделить всё
CPU: Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz (2000.01-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0x6fd Stepping = 13
Features=0xbfebfbff<FPU, VME, DE, PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,
CMOV, PAT, PSE36, CLFLUSH, DTS,ACPI, MMX, XSR, SSE, SSE2, S, HTT, TM, PBE>
Features2=0xe39d<SSE3,DTES64,MON,DS_CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM>
AMD Features=0x20100000<NX,LM>
AMD Features2=0x1<LAHF>
Cores per package: 2
real memory = 1072562176 (1022 MB)
avail memory = 1040203776 (992 MB)
ACPI APIC Table: <GBT GBTUACPI>
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
Код: Выделить всё
#!/usr/local/bin/zsh
fw=/sbin/ipfw
localnet="192.168.0.0/16"
out_if="rl0"
int_if="re0"
# Flushing rules
${fw} -f flush
${fw} -f pipe flush
${fw} -f queue flush
${fw} table 1 flush
# Unlimited users
${fw} table 1 add 10.0.0.1/32 300
# Allow outbound traffic from me
${fw} add 10 allow ip from any to any via lo0
${fw} add 10 check-state
${fw} add 10 allow ip from me to any setup keep-state
${fw} add 10 allow icmp from me to any keep-state
${fw} add 10 allow udp from me to any 53 keep-state
# Configuring nat from me via rl0
${fw} nat 100 config if ${out_if} ip 192.168.250.25
# Bandwidth limitation 300 Kbit/s users
${fw} pipe 300 config bw 300Kbit/s
${fw} pipe 301 config bw 300Kbit/s
# Pipes priority
${fw} queue 300 config pipe 300 weight 60
${fw} queue 301 config pipe 301 weight 60
# Shape out users
${fw} add 200 queue 300 ip from "table(1)" to any in via ${int_if}
# Put unlimited users table into our nat
${fw} add 300 nat 100 ip4 from "table(1)" to any
${fw} add 300 nat 100 ip4 from any to me
# Shape in users traffic
${fw} add 400 queue 301 ip from any to "table(1)" out via ${int_if}
Код: Выделить всё
net.inet.ip.fw.one_pass=0
kern.ipc.maxsockbuf=16777216
net.inet.tcp.delayed_ack=0
net.inet.ip.dummynet.io_fast=1
HZ=1000