Все работает отлично. Но непонятно с шейпингом.
Пайпы создаются динамически, согласно записи other_params в базе:
Код: Выделить всё
Acct-Interim-Interval = 60, mpd-pipe += "1=bw 1Kbyte/s", mpd-pipe += "5=bw 1Kbyte/s", mpd-rule += "1=pipe %p1 all from any to any in", mpd-rule += "2=pipe %p5 all from any to any out"
кусок лога mpd.log
Код: Выделить всё
Sep 20 12:13:51 khailino mpd: [pptp0] setting interface ng0 MTU to 1396 bytes
Sep 20 12:13:51 khailino mpd: [pptp0] exec: /sbin/ifconfig ng0 172.32.10.1 172.32.10.10 netmask 0xffffffff -link0
Sep 20 12:13:51 khailino mpd: [pptp0] exec: /sbin/route add 172.32.10.1 -iface lo0
Sep 20 12:13:51 khailino mpd: [pptp0] IFACE: using RADIUS ACLs
Sep 20 12:13:51 khailino mpd: [pptp0] exec: /sbin/ipfw pipe 10000 config bw 1Kbyte/s
Sep 20 12:13:51 khailino mpd: [pptp0] exec: /sbin/ipfw pipe 10001 config bw 1Kbyte/s
Sep 20 12:13:51 khailino mpd: [pptp0] exec: /sbin/ipfw add 10000 pipe 10000 all from any to any in via ng0
Sep 20 12:13:51 khailino mpd: [pptp0] exec: /sbin/ipfw add 10001 pipe 10001 all from any to any out via ng0
Sep 20 12:13:51 khailino mpd: [pptp0] exec: /sbin/ipfw add 10002 allow all from any to any via ng0
Sep 20 12:13:51 khailino mpd: [pptp0] IFACE: Up event
Код: Выделить всё
00100 0 0 check-state
00200 8880 1141418 allow ip from any to any via lo0
00300 0 0 deny ip from any to 127.0.0.0/8
00400 0 0 deny ip from 127.0.0.0/8 to any
00500 0 0 deny ip from any to 172.16.0.0/12 in via bge0
00600 0 0 deny ip from any to 192.168.0.0/16 in via bge0
00700 0 0 deny ip from any to 0.0.0.0/8 in via bge0
00800 0 0 deny ip from any to 169.254.0.0/16 in via bge0
00900 0 0 deny ip from any to 240.0.0.0/4 in via bge0
01000 0 0 deny icmp from any to any frag
01100 0 0 deny icmp from any to 255.255.255.255 in via bge0
01200 0 0 deny icmp from any to 255.255.255.255 out via bge0
01300 185595 18147576 divert 8668 ip from 172.32.10.0/24 to any out via bge0
01400 0 0 divert 8668 ip from 192.168.100.2 to any out via bge0
01500 181563 144150394 divert 8668 ip from any to 10.180.176.2 in via bge0
01600 0 0 deny ip from 172.16.0.0/12 to any out via bge0
01700 1037 58499 deny ip from 192.168.0.0/16 to any out via bge0
01800 0 0 deny ip from 0.0.0.0/8 to any out via bge0
01900 0 0 deny ip from 169.254.0.0/16 to any out via bge0
02000 0 0 deny ip from 240.0.0.0/4 to any out via bge0
02100 1891728 475618957 allow tcp from any to any established
02200 28867 1671589 allow ip from 10.180.176.2 to any xmit bge0
02300 6589 651626 allow udp from any 53 to any via bge0
02400 1 76 allow udp from any to any dst-port 123 via bge0
02500 1604 108528 allow icmp from any to any icmptypes 0,8,11
02600 641675 190284458 allow ip from any to any via bge1
10000 36 4493 pipe 10000 ip from any to any in via ng0
10001 2 156 pipe 10001 ip from any to any out via ng0
10004 832 47885 pipe 10004 ip from any to any in via ng2
10005 271 25085 pipe 10005 ip from any to any out via ng2
10006 1650 93448 pipe 10006 ip from any to any in via ng3
10007 438 48379 pipe 10007 ip from any to any out via ng3
65500 888 58342 deny ip from any to any
65535 0 0 allow ip from any to any
Код: Выделить всё
10006: 8.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 igmp 172.32.10.27/0 224.0.0.22/0 1650 93448 0 0 0
10007: 8.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 udp 80.92.200.252/53 172.32.10.27/50402 438 48379 0 0 0
10004: 8.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 udp 172.32.10.24/68 255.255.255.255/67 832 47885 0 0 0
10005: 8.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 udp 80.92.200.252/53 172.32.10.24/1028 271 25085 0 0 0
10000: 8.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 igmp 172.32.10.13/0 224.0.0.22/0 36 4493 0 0 0
10001: 8.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 udp 80.92.200.252/53 172.32.10.13/1480 2 156 0 0 0
где грабли? не пойму.