Перейти к содержимому
Калькуляторы

Почему дропается трафик?

 

cat /proc/net/stat/ipt_netflow
Flows: active 8945 (peak 12502 reached 0d0h6m ago), mem 489K
Hash: size 8192 (mem 32K), metric 1.6, 1.4, 1.0, 1.0. MemTraf: 2085956 pkt, 1376556 K (pdu 4, 160).
Timeout: active 1800, inactive 15. Maxflows 2000000
Rate: 57779270 bits/sec, 10213 packets/sec; Avg 1 min: 56193596 bps, 9975 pps; 5 min: 55420433 bps, 9905 pps
cpu#  stat: <search found new, trunc frag alloc maxflows>, sock: <ok fail cberr, bytes>, traffic: <pkt, bytes>, drop: <pkt, bytes>
Total stat: 5476313 6254850 350079,    0 11068    0    0, sock:      0 0 0, 0 K, traffic: 6604929, 4352 MB, drop: 4518973, 3080409 K
cpu0  stat: 1378910 1578413  88631,    0 2787    0    0, sock:      0 0 0, 0 K, traffic: 1667044, 1091 MB, drop: 0, 0 K
cpu1  stat: 1380109 1574051  88591,    0 2828    0    0, sock:      0 0 0, 0 K, traffic: 1662642, 1092 MB, drop: 4518973, 3080409 K
cpu2  stat: 1358721 1551263  86169,    0 2685    0    0, sock:      0 0 0, 0 K, traffic: 1637432, 1084 MB, drop: 0, 0 K
cpu3  stat: 1358573 1551123  86688,    0 2768    0    0, sock:      0 0 0, 0 K, traffic: 1637811, 1084 MB, drop: 0, 0 K

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

sysctl выдает такую хрень

 

sysctl -a | grep netflow

error: permission denied on key 'net.ipv4.route.flush'

error: permission denied on key 'net.ipv6.route.flush'

error: "No such file or directory" reading key "net.netflow.sndbuf"

net.netflow.active_timeout = 1800

net.netflow.inactive_timeout = 15

net.netflow.debug = 0

net.netflow.hashsize = 8192

net.netflow.destination = 127.0.0.1:3000

net.netflow.aggregation =

net.netflow.maxflows = 2000000

net.netflow.flush = 0

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

А что показывает ls -l /proc/sys/net/netflow

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

А что показывает ls -l /proc/sys/net/netflow

 

Показывает что нужно:

ls -l /proc/sys/net/netflow

total 0

-rw-r--r-- 1 root root 0 Apr 12 00:27 active_timeout

-rw-r--r-- 1 root root 0 Apr 12 00:27 aggregation

-rw-r--r-- 1 root root 0 Apr 12 00:27 debug

-rw-r--r-- 1 root root 0 Apr 12 00:27 destination

-rw-r--r-- 1 root root 0 Apr 12 00:27 flush

-rw-r--r-- 1 root root 0 Apr 12 00:27 hashsize

-rw-r--r-- 1 root root 0 Apr 12 00:27 inactive_timeout

-rw-r--r-- 1 root root 0 Apr 12 00:57 maxflows

-rw-r--r-- 1 root root 0 Apr 12 00:57 sndbuf

 

Когда я запустил все руками - работало, но после перезагрузки не встало. Сейчас дополнительные интерфейсы поднимаются в файле rc.local, модуль грузится через /etc/modules, но возникает вышеуказанная потеря трафика, а кроме того нет netflow потока.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Пропишите запуск sysctl -p /bla-bla(параметры netflow) в самом конце rc.local, когда все сетевые настройки уже применены.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Сейчас дополнительные интерфейсы поднимаются в файле rc.local, модуль грузится через /etc/modules, но возникает вышеуказанная потеря трафика, а кроме того нет netflow потока.

Модуль должен грузиться после того, как становится доступным коллектор.

Изменено пользователем pppoetest

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Убрал загрузку через /etc/modules и добавил

modprobe ipt_NETFLOW

У меня настройки сконфигурены в /etc/modprobe.d/netflow.conf

 

Трафик пошел, ошибки пропали.

Кажется пришло время писать мануал :)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Модуль должен грузиться после того, как становится доступным коллектор.

 

Модуль можно грузить когда угодно. А вот назначать параметры надо уже при полностью работающей сети.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Доброго дня. К вопросам NETFLOW-коллекторов Я тут однажды провёл сравнение некоторых из них, вот тут есть результаты в виде небольшой статьи Сенсоры NetFlow , если кому интересно.

На мой взгляд именно ipt_NETFLOW наиболее эффективен. По опыту на них последние несколько лет работают несколько таких сенсоров и ещё ни одного нарекания не было.

 

P.S. чёто ссылки не вставляются...

Изменено пользователем Shiva

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Чистейшая копипаста

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Чистейшая копипаста

Отнюдь, целиком моё. В особенности сам эксперимент.

Изменено пользователем Jubmo

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

ipt_NETFLOW не заполняет поля s_as и d_as netflow потоке, кто как справляется с этим?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Попробовал собрать его для ядра 3.9.2. Не собирается гад. Стал разбирать, там в ядре немного поменяли формат функции hlist_for_each_entry в list.h.

Вот патчик кому нада.

ipt_netflow_patch_for_3.9_kernel.patch.txt

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

У меня с ним и на 3.8 проблемы:

 


# make all install
gcc -O2 -Wall -Wunused -I/lib/modules/3.8.0-23-generic/build/include -DXTABLES   -fPIC -o libipt_NETFLOW_sh.o -c libipt_NETFLOW.cIn file included from /usr/include/linux/posix_types.h:4:0,
            	from /lib/modules/3.8.0-23-generic/build/include/uapi/linux/types.h:13,
            	from /lib/modules/3.8.0-23-generic/build/include/linux/types.h:5,
            	from /usr/include/xtables.h:17,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/stddef.h:11:2: ошибка: expected identifier before numeric constant
In file included from /usr/include/xtables.h:17:0,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:14:26: ошибка: несовместимые типы для «fd_set»
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:219:0,
            	from /usr/include/stdlib.h:314,
            	from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/select.h:75:5: замечание: здесь была предыдущая декларация «fd_set»
In file included from /usr/include/xtables.h:17:0,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:15:25: ошибка: несовместимые типы для «dev_t»
In file included from /usr/include/stdlib.h:314:0,
            	from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:60:17: замечание: здесь была предыдущая декларация «dev_t»
In file included from /usr/include/xtables.h:17:0,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:19:17: ошибка: несовместимые типы для «nlink_t»
In file included from /usr/include/stdlib.h:314:0,
            	from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:75:19: замечание: здесь была предыдущая декларация «nlink_t»
In file included from /usr/include/xtables.h:17:0,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:25:26: ошибка: несовместимые типы для «timer_t»
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:132:0,
            	from /usr/include/stdlib.h:314,
            	from libipt_NETFLOW.c:25:
/usr/include/time.h:103:19: замечание: здесь была предыдущая декларация «timer_t»
In file included from /usr/include/xtables.h:17:0,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:29:17: ошибка: два или более типа в декларации
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:45:26: ошибка: несовместимые типы для «loff_t»
In file included from /usr/include/stdlib.h:314:0,
            	from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:44:18: замечание: здесь была предыдущая декларация «loff_t»
In file included from /usr/include/xtables.h:17:0,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:111:17: ошибка: несовместимые типы для «uint64_t»
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h:3:0,
            	from /usr/include/netinet/in.h:23,
            	from libipt_NETFLOW.c:29:
/usr/include/stdint.h:55:27: замечание: здесь была предыдущая декларация «uint64_t»
In file included from /usr/include/xtables.h:17:0,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:112:17: ошибка: несовместимые типы для «u_int64_t»
In file included from /usr/include/stdlib.h:314:0,
            	from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:203:1: замечание: здесь была предыдущая декларация «u_int64_t»
In file included from /usr/include/xtables.h:17:0,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:113:17: ошибка: несовместимые типы для «int64_t»
In file included from /usr/include/stdlib.h:314:0,
            	from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:197:1: замечание: здесь была предыдущая декларация «int64_t»
In file included from /usr/include/xtables.h:17:0,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/types.h:134:23: ошибка: несовместимые типы для «blkcnt_t»
In file included from /usr/include/stdlib.h:314:0,
            	from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:235:20: замечание: здесь была предыдущая декларация «blkcnt_t»
In file included from /lib/modules/3.8.0-23-generic/build/include/linux/netfilter.h:4:0,
            	from /usr/include/xtables.h:18,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/init.h:255:13: ошибка: expected «=», «,», «;», «asm» or «__attribute__» before «parse_early_param»
/lib/modules/3.8.0-23-generic/build/include/linux/init.h:256:13: ошибка: expected «=», «,», «;», «asm» or «__attribute__» before «parse_early_options»
In file included from /lib/modules/3.8.0-23-generic/build/include/linux/kernel.h:6:0,
            	from /lib/modules/3.8.0-23-generic/build/include/linux/skbuff.h:17,
            	from /lib/modules/3.8.0-23-generic/build/include/linux/netfilter.h:5,
            	from /usr/include/xtables.h:18,
            	from libipt_NETFLOW.c:34:
/lib/modules/3.8.0-23-generic/build/include/linux/linkage.h:5:25: фатальная ошибка: asm/linkage.h: Нет такого файла или каталога
компиляция прервана.
make: *** [libipt_NETFLOW.so] Ошибка 1
# uname -a
Linux garlem 3.8.0-23-generic #34-Ubuntu SMP Wed May 29 20:22:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
:/tmp/ipt-netflow#

Изменено пользователем Dyr

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

/lib/modules/3.8.0-23-generic/build/include/linux/linkage.h:5:25: фатальная ошибка: asm/linkage.h: Нет такого файла или каталога

 

Я у себя по создавал пустые не хватающие файлы - всё заработало. 3.7.10-gentoo

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Dyr

аналогичная проблема, не собирается на 3.9.6, точнее ipt_NETFLOW собирается, а libipt_NETFLOW - нет

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

У кого-нибудь получилось собрать для 3.9.6?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Этот патч я пробовал. После него получается такое:

/usr/src/ipt-netflow# make all
gcc -O2 -Wall -Wunused -I/lib/modules/3.9.6-custom/build/include -DIPTABLES_VERSION=\"1.4.14\" -I../iptables-1.4.14/include -fPIC -o libipt_NETFLOW_sh.o -c libipt_NETFLOW.c
In file included from /usr/include/linux/posix_types.h:4:0,
                from /lib/modules/3.9.6-custom/build/include/uapi/linux/types.h:13,
                from /lib/modules/3.9.6-custom/build/include/linux/types.h:5,
                from ../iptables-1.4.14/include/xtables.h:17,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/stddef.h:11:2: error: expected identifier before numeric constant
In file included from ../iptables-1.4.14/include/xtables.h:17:0,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/types.h:14:26: error: conflicting types for ‘fd_set’
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:220:0,
                from /usr/include/stdlib.h:320,
                from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/select.h:78:5: note: previous declaration of ‘fd_set’ was here
In file included from ../iptables-1.4.14/include/xtables.h:17:0,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/types.h:15:25: error: conflicting types for ‘dev_t’
In file included from /usr/include/stdlib.h:320:0,
                from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:61:17: note: previous declaration of ‘dev_t’ was here
In file included from ../iptables-1.4.14/include/xtables.h:17:0,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/types.h:19:17: error: conflicting types for ‘nlink_t’
In file included from /usr/include/stdlib.h:320:0,
                from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:76:19: note: previous declaration of ‘nlink_t’ was here
In file included from ../iptables-1.4.14/include/xtables.h:17:0,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/types.h:25:26: error: conflicting types for ‘timer_t’
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:133:0,
                from /usr/include/stdlib.h:320,
                from libipt_NETFLOW.c:25:
/usr/include/time.h:104:19: note: previous declaration of ‘timer_t’ was here
In file included from ../iptables-1.4.14/include/xtables.h:17:0,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/types.h:29:17: error: two or more data types in declaration specifiers
/lib/modules/3.9.6-custom/build/include/linux/types.h:29:1: warning: useless type name in empty declaration [enabled by default]
/lib/modules/3.9.6-custom/build/include/linux/types.h:45:26: error: conflicting types for ‘loff_t’
In file included from /usr/include/stdlib.h:320:0,
                from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:45:18: note: previous declaration of ‘loff_t’ was here
In file included from ../iptables-1.4.14/include/xtables.h:17:0,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/types.h:111:17: error: conflicting types for ‘uint64_t’
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h:3:0,
                from /usr/include/netinet/in.h:24,
                from libipt_NETFLOW.c:29:
/usr/include/stdint.h:56:27: note: previous declaration of ‘uint64_t’ was here
In file included from ../iptables-1.4.14/include/xtables.h:17:0,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/types.h:112:17: error: conflicting types for ‘u_int64_t’
In file included from /usr/include/stdlib.h:320:0,
                from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:204:1: note: previous declaration of ‘u_int64_t’ was here
In file included from ../iptables-1.4.14/include/xtables.h:17:0,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/types.h:113:17: error: conflicting types for ‘int64_t’
In file included from /usr/include/stdlib.h:320:0,
                from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:198:1: note: previous declaration of ‘int64_t’ was here
In file included from ../iptables-1.4.14/include/xtables.h:17:0,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/types.h:134:23: error: conflicting types for ‘blkcnt_t’
In file included from /usr/include/stdlib.h:320:0,
                from libipt_NETFLOW.c:25:
/usr/include/x86_64-linux-gnu/sys/types.h:236:20: note: previous declaration of ‘blkcnt_t’ was here
In file included from /lib/modules/3.9.6-custom/build/include/linux/netfilter.h:4:0,
                from ../iptables-1.4.14/include/xtables.h:18,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/init.h:156:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘load_default_modules’
/lib/modules/3.9.6-custom/build/include/linux/init.h:256:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parse_early_param’
/lib/modules/3.9.6-custom/build/include/linux/init.h:257:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parse_early_options’
In file included from /lib/modules/3.9.6-custom/build/include/linux/kernel.h:6:0,
                from /lib/modules/3.9.6-custom/build/include/linux/skbuff.h:17,
                from /lib/modules/3.9.6-custom/build/include/linux/netfilter.h:5,
                from ../iptables-1.4.14/include/xtables.h:18,
                from ../iptables-1.4.14/include/iptables.h:5,
                from libipt_NETFLOW.c:36:
/lib/modules/3.9.6-custom/build/include/linux/linkage.h:5:25: fatal error: asm/linkage.h: No such file or directory
compilation terminated.
make: *** [libipt_NETFLOW.so] Error 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Хм... Перед сборкой модуля, из этих же исходников само ядро собиралось? То есть весь набор Makefile и .config в наличии? На первый взгляд похоже, что вы собираете модуль распаковав голые сырцы ядра.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Да, ядро собиралось. Debian 7.

fakeroot make-kpkg --initrd kernel-image kernel-headers

Файлика asm/linkage.h действительно нет, но в стоковом ядре его тоже нет, а модуль собирается без проблем.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

В порядке горячечного бреда, у вас симлинк /lib/modules/3.9.6-custom/build вообще живой? Пробовали вручную задать путь к исходникам через

 

./configure --kdir=/usr/src/bla-bla-bla ?

 

за одно и по другим параметрам пройтись

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

В порядке горячечного бреда, у вас симлинк /lib/modules/3.9.6-custom/build вообще живой? Пробовали вручную задать путь к исходникам через

 

./configure --kdir=/usr/src/bla-bla-bla ?

 

за одно и по другим параметрам пройтись

Линки есть, пути задавал, не помогает.

Что-то я делаю не так. Обновился до testing, там ядро 3.9 помоему 8. Модуль собирается.

Делаю:

apt-get install linux-source-3.9
cd /usr/src/linux-source-3.9
make mrproper
cp /boot/config-3.9-1-amd64 /usr/src/linux-source-3.9/.config
make oldconfig
make-kpkg clean
make-kpkg --initrd --revision="123" kernel-image kernel-headers
dpkg -i linux-image-3.9.8_123_amd64.deb linux-headers-3.9.8_123_amd64.deb

Перезагружаюсь - модуль не собирается.

Может кто-нибудь подскажет что я могу делать не так?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

У кого-нибудь получилось собрать для 3.9.6?

С указанными выше в теме патчами отлично собирается для 3.9.11

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

×   Вставлено в виде отформатированного текста.   Вставить в виде обычного текста

  Разрешено не более 75 смайлов.

×   Ваша ссылка была автоматически встроена.   Отобразить как ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.