Есть два интерфейса eth0 - локальный (линк eth0:48 на 55ую подсеть 192.168.55.0/255.255.255.0) и ppp0 - Интернет.
Маскарадинг даёт доступ всем из 55ой в Интернет. Требуется ограничить скорость всем, кто получает таким способом Интернет. trickled -u 10 -d 10 не помогает.
Установил shaperd из репозитариев. Сделал вот такой конфиг /etc/shaperd/shaperd.conf:
# shape masq'd hosts
# send a SIGHUP to reload this file with the command killall -HUP shaperd
# this is an "internal" log level (all logs are sent with facility daemon,
# priority info; see the syslog manpage for more information).
# valid levels are:
# alert (1)
# error (2)
# warning (3)
# info (4)
# debug1 (5)
# debug2 (6)
# log levels beggining from warning (3) will log unmatched packets
log level = warning
# this is a required option. note that shaperd must have been built with
# the correct forwarding mechanism(s) in order for these to work
# see the README for further details
# packet forwarding = ipq
# packet forwarding = divert
packet forwarding = ipq
# this is useful for debugging
# shaperd will run detached if set to "yes"
daemon = yes
# full path to shaperd's pidfile
# it will be generated in daemon mode only
pidfile = /var/run/shaperd.pid
class all_up {
bandwidth = 6 kbit/s
ipv4 classifier out_if=ppp0 saddr=192.168.55.0/255.255.255.0
queue limits = 0 kb 150 packets
}
class all_down {
bandwidth = 10 kbit/s
ipv4 classifier inp_if=ppp0 daddr=192.168.55.0/255.255.255.0
queue limits = 0 kb 150 packets
}
upload на 6 download на 10.
Сегодня убедился, что не работает (мониторил соединения).
Что я делаю не правильно и как ещё можно проверить?
В мануале:
As it runs as a normal daemon
process, packet forwarding to/from the kernel can be done by the BSD divert sockets layer (available as a patch
for the linux kernel) or by the ipq packet forwarding library that comes with kernel 2.4
есть ли ipq в моём 2.6.22-14-generic? где это посмотреть