Главная страница


ru.unix.bsd

 
 - RU.UNIX.BSD ------------------------------------------------------------------
 From : Alexey Sopov                         2:5020/400     18 Oct 2005  22:32:01
 To : All
 Subject : setifindex не догоняю
 -------------------------------------------------------------------------------- 
 
 
 День добрый!
 
 Есть роутер, отданный под mpd4(pptp)
 Создано 700 бандлов.
 Hадо с каждого снимать статистику с помощью ng_netflow.
 Запускаю mpd с ключиком -t, чтоб он повставлял ng_tee ноды.
 Делаю так:
 
 ng_netflow.sh:
 #!/bin/sh
 
 case "$1" in
 start)
         /usr/sbin/ngctl -f- <<-ENDNETFLOWSTART
         mkpeer ng0:inet netflow right2left iface0
         name ng0:inet.right2left netflow
         connect ng0:inet netflow: left2right iface700
         msg netflow: setdlt { iface=0 dlt=12 }
         msg netflow: setdlt { iface=700 dlt=12 }
         connect ng1:inet netflow: right2left iface1
         connect ng1:inet netflow: left2right iface701
         msg netflow: setdlt { iface=1 dlt=12 }
         msg netflow: setdlt { iface=701 dlt=12 }
         connect ng2:inet netflow: right2left iface2
         connect ng2:inet netflow: left2right iface702
         msg netflow: setdlt { iface=2 dlt=12 }
         msg netflow: setdlt { iface=702 dlt=12 }
         connect ng3:inet netflow: right2left iface3
         connect ng3:inet netflow: left2right iface703
         msg netflow: setdlt { iface=3 dlt=12 }
         msg netflow: setdlt { iface=703 dlt=12 }
 ............
         msg netflow: setdlt { iface=697 dlt=12 }
         msg netflow: setdlt { iface=1397 dlt=12 }
         connect ng698:inet netflow: right2left iface698
         connect ng698:inet netflow: left2right iface1398
         msg netflow: setdlt { iface=698 dlt=12 }
         msg netflow: setdlt { iface=1398 dlt=12 }
         connect ng699:inet netflow: right2left iface699
         connect ng699:inet netflow: left2right iface1399
         msg netflow: setdlt { iface=699 dlt=12 }
         msg netflow: setdlt { iface=1399 dlt=12 }
         mkpeer netflow: ksocket export inet/dgram/udp
         msg netflow:export connect inet/a.b.c.d:4444
 ENDNETFLOWSTART
 
 В итоге все создается. Читаю ман ng_netflow:
 
      NGM_NETFLOW_SETIFINDEX
              In some cases, ng_netflow may be unable to determine the input
              interface index of a packet.  This can happen if traffic enters
              the ng_netflow node before it comes to the system interface's
              input queue.  An example of such a setup is capturing a traffic
              between synchronous data line and ng_iface(4).  In this case,
 the
              input index should be associated with a given hook.  The inter-
              face's index can be determined via if_nametoindex(3) from user-
              land.
 
 читаю примеры:
            /usr/sbin/ngctl -f- <<-SEQ
                    # connect ng0's tee to iface0 hook
                    mkpeer ng0:inet netflow right2left iface0
                    name ng0:inet.right2left netflow
                    # set DLT to raw mode
                    msg netflow: setdlt { iface=0 dlt=12 }
                    # set interface index (5 in this example)
                    msg netflow: setifindex { iface=0 index=5 }
 
 Вот здесь для ng0 указывается индекс.
 Вопрос: Могу ли я не указывать индекс интерфейса, и если не могу, то как мне
 его получить?
 В мануале по if_nametoindex(3) ничего не нашел.
 
 Спасибо.
 -- 
 Отправлено через сервер Форумы@mail.ru - http://talk.mail.ru
 --- ifmail v.2.15dev5.3
  * Origin: Talk.Mail.Ru (2:5020/400)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 setifindex не догоняю   Alexey Sopov   18 Oct 2005 22:32:01 
 Re: setifindex не догоняю   Gleb Smirnoff   19 Oct 2005 01:32:23 
 Re: setifindex не догоняю   Alexey Sopov   19 Oct 2005 15:31:13 
 Re: setifindex не догоняю   Gleb Smirnoff   19 Oct 2005 15:52:24 
 Re: setifindex не догоняю   Alexey Sopov   19 Oct 2005 17:38:49 
Архивное /ru.unix.bsd/6488cca803b6.html, оценка 2 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional