Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Точность подсчета трафика Lightsquid vs RRD vs биллинг про

    Russian
    3
    12
    2.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      NegoroX
      last edited by

      установи Bandwidthd
      ( привяжи пользователей к конкретным IP

      1 Reply Last reply Reply Quote 0
      • N
        NetWiz
        last edited by

        Пользователи заданы статикой в DHCP. Которые в инет идут, дополнительным алиасом прописаны.

        1 Reply Last reply Reply Quote 0
        • N
          NetWiz
          last edited by

          К сожалению, этот плагин останавливает RRD…

          1 Reply Last reply Reply Quote 0
          • N
            NetWiz
            last edited by

            Посмотрите пожалуйста мой ipcad.conf, может в нем что напутал.

            #
            # Simple configuration file for ipcad.
            # Copyright (c) 2001, 2002, 2003, 2004
            # 	Lev Walkin <vlm@lionet.info>.
            #
            # Please see ipcad.conf.default file or ipcad.conf(5) manual page for
            # complete file format explanation.
            #  /usr/local/etc
            
            capture-ports enable;	# Enable ports capturing for RSH (no effect on NetFlow).
            
            interface "em2_vlan10" filter "ip and dst net 10.0.0.0/24 and not src net 10.0.0.0/24 and not src port 80";
            interface "em2_vlan20" filter "ip and dst net 10.0.1.0/24 and not src net 10.0.1.0/24 and not src port 80";
            
            # Specify interfaces.
            #interface eth0;		# Listen on Ethernet interface...
            #interface eth1;		# ...and another onw.
            #interface ppp*;		# Listen on all PPP interfaces.
            
            # Preserve internal IP ranges, aggregate external ones.
            aggregate 10.0.0.0/24 strip 32; /* Don't aggregate 192.168.0.0 */
            aggregate 10.0.1.0/24 strip 32; /* Don't aggregate 192.168.0.0 */
            #aggregate 10.1.1.0/24 strip 32; /* Don't aggregate 192.168.0.0 */
            aggregate 0.0.0.0/0 strip 32;	/* Drop the last octet of all other IPs */
            
            # Aggregate port numbers.
            #aggregate 1024-65535 into 65535;	/* Aggregate wildly */
            #aggregate 3128-3128 into 3128;	/* Protect these ports */
            #aggregate 150-1023 into 1023;	/* General low range */
            
            rsh enable at 127.0.0.1;
            rsh root@127.0.0.1 admin;	/* Can shutdown ipcad */
            rsh root@127.0.0.1 backup;	/* Can dump/restore/import accounting table */
            rsh root@127.0.0.1;		/* Can view and modify accounting tables */
            rsh 127.0.0.1 view-only;	/* Other users can view current tables */
            
            # Uncomment this to export NetFlow information to specified destination.
            # netflow export destination 127.0.0.1 9996;
            
            chroot=/var/log/ipcad;
            pidfile = ipcad.pid;	# Will be created under /tmp
            
            memory_limit = 10m;
            # Dump file for -r and -s command line options.
            dumpfile = ipcad.dump;</vlm@lionet.info>
            
            1 Reply Last reply Reply Quote 0
            • N
              NetWiz
              last edited by

              Провайдер МТС, тариф Коннект-4, Сахалин. Гигабайт стоит 150 рублей. Вижу входящий трафик WAN на RRD (рублей 200 в час), всё бы ничего, но в LAN он отсутствует… И в логах Lightsquid почти пусто. Приходится оплачивать трафик из своего кармана.

              Есть мысль, что ipcad не справляется с объемом. Увеличил память ему до 80 мегабайт и раскомментировал строки агрегатирования портов, посмотрим...

              Еще, у нас он не пишет ipcad.log никуда, может быть можно его заставить это делать?

              1 Reply Last reply Reply Quote 0
              • R
                rubic
                last edited by

                То, что вам на WAN валится куча трафика, еще не значит, что он должен быть и на LAN. Вас могут банально DDOS-ить, я даже знаю кому это выгодно))
                Смотрите что блокирует Firewall на WAN и не думайте, что заблокированный трафик вы не оплачиваете.
                А Squid установлен?

                1 Reply Last reply Reply Quote 0
                • N
                  NetWiz
                  last edited by

                  squid установлен.

                  1 Reply Last reply Reply Quote 0
                  • R
                    rubic
                    last edited by

                    Тогда ipcad.conf вроде в порядке

                    1 Reply Last reply Reply Quote 0
                    • N
                      NetWiz
                      last edited by

                      Я подозреваю что идет ddos от провайдера, но где смотреть? snort работает, но кучу тревог выдает ненужных в syslog.log.

                      diag_logs_filter.php не вижу заблокированных пакетов с/на wan ни на роутер 4G. Роутер 4G= 192.168.1.1, wan pfSense = 192.168.1.98.

                      1 Reply Last reply Reply Quote 0
                      • R
                        rubic
                        last edited by

                        Ну а другие LAN-интерфейсы, подсети (все, что даже теоретически может не считать ipcad) в системе есть? Торрентами кто-нибудь балуется? Чудес ведь не бывает, ipcad - довольно простая машинка, ее не обманешь, если она действительно натравлена на все, что нужно.

                        1 Reply Last reply Reply Quote 0
                        • N
                          NetWiz
                          last edited by

                          squid и торренты и неправильная настройка фаервола = мегазло. установил на новой машине минимум, ipcad + lightsquid + cron + Open-VM-Tools. установленный заранее squid squidguard снесены, ибо увидел что попаданий в кэш чуть больше 0%. В прошлой реализации моего сквида попадание было под 30-40%, за счет обновлений всяких программ.

                          торренты отловил snort-ом на прошлой машине. (после непонятно чего, перестала идти маршрутизация; откат на бекапы не помог.)

                          Вопрос. ipcad в такой настройке только входящий трафик считает? У отловленных пользователей мной были прибиты торренты со стоящими на раздаче файлами, т.е. актуальноть подсчета всего трафика велика.

                          tolog.sh

                          #!/bin/sh
                          net1="10.0.0"
                          net2="10.0.1"
                          net3="172.31.8"
                          ttime=`/usr/bin/rsh localhost sh ip acco | grep 'Accounting data saved' | awk '{print ($4)}'`
                          rsh localhost clear ip accounting
                          rsh localhost show ip accounting checkpoint | grep $net1 | awk -v vtime=$ttime '{if ($5 != 0) print (vtime".000",1,$2,"TCP_MISS/200",$4,"CONNECT",$1":"$5,"-","DIRECT/"$1,"-")}' >> /var/squid/logs/access.log
                          rsh localhost show ip accounting checkpoint | grep $net2 | awk -v vtime=$ttime '{if ($5 != 0) print (vtime".000",1,$2,"TCP_MISS/200",$4,"CONNECT",$1":"$5,"-","DIRECT/"$1,"-")}' >> /var/squid/logs/access.log
                          rsh localhost show ip accounting checkpoint | grep $net3 | awk -v vtime=$ttime '{if ($5 != 0) print (vtime".000",1,$2,"TCP_MISS/200",$4,"CONNECT",$1":"$5,"-","DIRECT/"$1,"-")}' >> /var/squid/logs/access.log
                          chown proxy:proxy /var/squid/logs/access.log
                          

                          ipcad.conf

                          #
                          # Simple configuration file for ipcad.
                          # Copyright (c) 2001, 2002, 2003, 2004
                          # 	Lev Walkin <vlm@lionet.info>.
                          #
                          # Please see ipcad.conf.default file or ipcad.conf(5) manual page for
                          # complete file format explanation.
                          #  /usr/local/etc
                          
                          capture-ports enable;	# Enable ports capturing for RSH (no effect on NetFlow).
                          
                          interface "em2_vlan10" filter "ip and dst net 10.0.0.0/24 and not src net 10.0.0.0/24";
                          interface "em2_vlan20" filter "ip and dst net 10.0.1.0/24 and not src net 10.0.1.0/24";
                          interface "em2_vlan30" filter "ip and dst net 172.31.8.0/24 and not src net 172.31.8.0/24";
                          
                          # Specify interfaces.
                          #interface eth0;		# Listen on Ethernet interface...
                          #interface eth1;		# ...and another onw.
                          #interface ppp*;		# Listen on all PPP interfaces.
                          
                          # Preserve internal IP ranges, aggregate external ones.
                          aggregate 10.0.0.0/24 strip 32; /* Don't aggregate 192.168.0.0 */
                          aggregate 10.0.1.0/24 strip 32; /* Don't aggregate 192.168.0.0 */
                          aggregate 172.31.8.0/24 strip 32; /* Don't aggregate 192.168.0.0 */
                          aggregate 0.0.0.0/0 strip 32;	/* Drop the last octet of all other IPs */
                          
                          # Aggregate port numbers.
                          #aggregate 1024-65535 into 65535;	/* Aggregate wildly */
                          #aggregate 3128-3128 into 3128;	/* Protect these ports */
                          #aggregate 150-1023 into 1023;	/* General low range */
                          
                          rsh enable at 127.0.0.1;
                          rsh root@127.0.0.1 admin;	/* Can shutdown ipcad */
                          rsh root@127.0.0.1 backup;	/* Can dump/restore/import accounting table */
                          rsh root@127.0.0.1;		/* Can view and modify accounting tables */
                          rsh 127.0.0.1 view-only;	/* Other users can view current tables */
                          
                          # Uncomment this to export NetFlow information to specified destination.
                          # netflow export destination 127.0.0.1 9996;
                          
                          chroot=/var/log/ipcad;
                          pidfile = ipcad.pid;	# Will be created under /tmp
                          
                          memory_limit = 80m;
                          # Dump file for -r and -s command line options.
                          dumpfile = ipcad.dump;</vlm@lionet.info> 
                          
                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.