Страница 1 из 1

Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-03 10:27:02
BECHA
Провайдер начал вещать IPTV:

Код: Выделить всё

21:05:00.338592 IP 10.90.91.254 > PIM-ROUTERS.MCAST.NET: PIMv2, Hello, length: 38

обновил порты, появился igmpproxy, поставил его.

в сеть провайдера смотрит fxp0, в домашнюю сеть fxp1. конфиг igmpproxy:

Код: Выделить всё

quickleave
phyint fxp0 upstream  ratelimit 0  threshold 1
        altnet 10.90.91.0/24
        altnet 77.94.170.0/24
phyint fxp1 downstream  ratelimit 0  threshold 1
phyint lo0 disabled
phyint fxp2 disabled
для работы igmpproxy необходимо загрузить ip_mroute.ko:

Код: Выделить всё

kldload /boot/kernel/ip_mroute.ko
добавляю правила в фаер PF:

Код: Выделить всё

pass quick on {fxp0 fxp1} proto udp from any to any allow-opts
pass quick on {fxp0 fxp1} proto igmp from any to any
и запускаю igmpproxy - естественно ничего не работает!
Вот лог ipmpproxy:

Код: Выделить всё

igmpproxy -d -c /usr/local/etc/igmpproxy.conf
igmpproxy, Version 0.1 beta2, Build 090829
Copyright 2005 by Johnny Egeland <johnny@rlo.org>
Distributed under the GNU GENERAL PUBLIC LICENSE, Version 2 - check GPL.txt

Debu: Searching for config file at '/usr/local/etc/igmpproxy.conf'
Debu: Config: Quick leave mode enabled.
Debu: Config: Got a phyint token.
Debu: Config: IF: Config for interface fxp0.
Debu: Config: IF: Got upstream token.
Debu: Config: IF: Got ratelimit token '0'.
Debu: Config: IF: Got threshold token '1'.
Debu: Config: IF: Got altnet token 10.90.91.0/24.
Debu: Config: IF: Altnet: Parsed altnet to 10.90.91/24.
Debu: Config: IF: Got altnet token 77.94.170.0/24.
Debu: Config: IF: Altnet: Parsed altnet to 77.94.170/24.
Debu: IF name : fxp0
Debu: Next ptr : 0
Debu: Ratelimit : 0
Debu: Threshold : 1
Debu: State : 1
Debu: Allowednet ptr : 8053030
Debu: Config: Got a phyint token.
Debu: Config: IF: Config for interface fxp1.
Debu: Config: IF: Got downstream token.
Debu: Config: IF: Got ratelimit token '0'.
Debu: Config: IF: Got threshold token '1'.
Debu: IF name : fxp1
Debu: Next ptr : 0
Debu: Ratelimit : 0
Debu: Threshold : 1
Debu: State : 2
Debu: Allowednet ptr : 0
Debu: Config: Got a phyint token.
Debu: Config: IF: Config for interface lo0.
Debu: Config: IF: Got disabled token.
Debu: IF name : lo0
Debu: Next ptr : 0
Debu: Ratelimit : 0
Debu: Threshold : 1
Debu: State : 0
Debu: Allowednet ptr : 0
Debu: Config: Got a phyint token.
Debu: Config: IF: Config for interface fxp2.
Debu: Config: IF: Got disabled token.
Debu: IF name : fxp2
Debu: Next ptr : 0
Debu: Ratelimit : 0
Debu: Threshold : 1
Debu: State : 0
Debu: Allowednet ptr : 0
Debu: Adding Physical Index value of IF 'fxp0' is 1
Debu: buildIfVc: Interface fxp0 Addr: 192.168.102.166, Flags: 0xffff8843, Network: 192.168.102/24
Debu: Adding Physical Index value of IF 'fxp1' is 2
Debu: buildIfVc: Interface fxp1 Addr: 192.168.111.111, Flags: 0xffff8843, Network: 192.168.111/24
Debu: Adding Physical Index value of IF 'fxp2' is 3
Debu: buildIfVc: Interface fxp2 Addr: 192.168.1.122, Flags: 0xffff8843, Network: 192.168.0/22
Debu: Adding Physical Index value of IF 'lo0' is 5
Debu: buildIfVc: Interface lo0 Addr: 127.0.0.1, Flags: 0xffff8049, Network: 127/8
Debu: Found config for fxp0
Debu: Found config for fxp1
Debu: Found config for fxp2
Note: adding VIF, Ix 0 Fl 0x0 IP 0xa666a8c0 fxp0, Threshold: 1, Ratelimit: 0
Debu:         Network for [fxp0] : 192.168.102/24
Debu:         Network for [fxp0] : 10.90.91/24
Debu:         Network for [fxp0] : 77.94.170/24
Note: adding VIF, Ix 1 Fl 0x0 IP 0x6f6fa8c0 fxp1, Threshold: 1, Ratelimit: 0
Debu:         Network for [fxp1] : 192.168.111/24
Note: adding VIF, Ix 2 Fl 0x0 IP 0x7a01a8c0 fxp2, Threshold: 1, Ratelimit: 0
Debu:         Network for [fxp2] : 192.168.0/22
Debu: Got 232448 byte buffer size in 8 iterations
Debu: Joining all-routers group 224.0.0.2 on vif 192.168.111.111
Note: joinMcGroup: 224.0.0.2 on fxp1
Debu: SENT Membership query   from 192.168.111.111 to 224.0.0.1
Debu: Sent membership query from 192.168.111.111 to 224.0.0.1. Delay: 10
Debu: Created timeout 1 (#0) - delay 10 secs
Debu: (Id:1, Time:10)
Debu: Created timeout 2 (#1) - delay 21 secs
Debu: (Id:1, Time:10)
Debu: (Id:2, Time:21)
Debu: Packet from 10.90.91.254: proto: 2 hdrlen: 20 iplen: 8 or 2048
Note: RECV Membership query   from 10.90.91.254    to 224.0.0.1 (ip_hl 20, data 8)
Debu: About to call timeout 1 (#0)
Debu: Aging routes in table.
Debu:
Current routing table (Age active routes);
-----------------------------------------------------

Debu: No routes in table...
Debu:
-----------------------------------------------------

Debu: About to call timeout 2 (#0)
Debu: SENT Membership query   from 192.168.111.111 to 224.0.0.1
Debu: Sent membership query from 192.168.111.111 to 224.0.0.1. Delay: 10
Debu: Created timeout 3 (#0) - delay 10 secs
Debu: (Id:3, Time:10)
Debu: Created timeout 4 (#1) - delay 21 secs
Debu: (Id:3, Time:10)
Debu: (Id:4, Time:21)
Debu: About to call timeout 3 (#0)
Debu: Aging routes in table.
Debu:
Current routing table (Age active routes);
-----------------------------------------------------

Debu: No routes in table...
Debu:
-----------------------------------------------------

Debu: Packet from 192.168.94.160: proto: 2 hdrlen: 20 iplen: 8 or 2048
Note: RECV Membership query   from 192.168.94.160  to 224.0.0.1 (ip_hl 20, data 8)
Debu: About to call timeout 4 (#0)
Debu: SENT Membership query   from 192.168.111.111 to 224.0.0.1
Debu: Sent membership query from 192.168.111.111 to 224.0.0.1. Delay: 10
Debu: Created timeout 5 (#0) - delay 10 secs
Debu: (Id:5, Time:10)
Debu: Created timeout 6 (#1) - delay 115 secs
Debu: (Id:5, Time:10)
Debu: (Id:6, Time:115)
Debu: About to call timeout 5 (#0)
Debu: Aging routes in table.
Debu:
Current routing table (Age active routes);
-----------------------------------------------------

Debu: No routes in table...
Debu:
-----------------------------------------------------

Debu: Packet from 10.90.91.254: proto: 2 hdrlen: 20 iplen: 8 or 2048
Note: RECV Membership query   from 10.90.91.254    to 224.0.0.1 (ip_hl 20, data 8)
Debu: Packet from 192.168.94.160: proto: 2 hdrlen: 20 iplen: 8 or 2048
Note: RECV Membership query   from 192.168.94.160  to 224.0.0.1 (ip_hl 20, data 8)
Debu: About to call timeout 6 (#0)
Debu: SENT Membership query   from 192.168.111.111 to 224.0.0.1
Debu: Sent membership query from 192.168.111.111 to 224.0.0.1. Delay: 10
Debu: Created timeout 7 (#0) - delay 10 secs
Debu: (Id:7, Time:10)
Debu: Created timeout 8 (#1) - delay 115 secs
Debu: (Id:7, Time:10)
Debu: (Id:8, Time:115)
Debu: About to call timeout 7 (#0)
Debu: Aging routes in table.
Debu:
Current routing table (Age active routes);
-----------------------------------------------------

Debu: No routes in table...
Debu:
-----------------------------------------------------

Debu: Packet from 10.90.91.254: proto: 2 hdrlen: 20 iplen: 8 or 2048
Note: RECV Membership query   from 10.90.91.254    to 224.0.0.1 (ip_hl 20, data 8)
^CWarn: select() failure; Errno(4): Interrupted system call
Note: Got a interupt signal. Exiting.
Debu: clean handler called
Note: All routes removed. Routing table is empty.
Info: Shutdown complete....
при помощи tcpdump выяснил, что во внутренней сети пакеты от программы IP-TV player бегают и им даже иногда отвечает сервер (111.1 - адрес виндовой машины, 111.111 - FreeBSD):

Код: Выделить всё

22:07:05.812767 IP 10.90.91.254 > 224.0.0.13: PIMv2, Hello, length: 38
22:07:19.495771 IP 10.90.91.254 > 224.0.0.13: PIMv2, Bootstrap, length: 58
22:07:23.296123 IP 10.204.74.94 > 224.0.0.22: igmp v3 report, 1 group record(s)
22:07:24.021065 IP 10.204.74.94 > 224.0.0.22: igmp v3 report, 1 group record(s)
22:07:35.711430 IP 10.90.91.254 > 224.0.0.13: PIMv2, Hello, length: 38
22:07:44.463563 IP 192.168.94.160 > 224.0.0.1: igmp query v2
22:08:05.102400 IP 10.90.91.254 > 224.0.0.13: PIMv2, Hello, length: 38
22:08:19.669869 IP 10.90.91.254 > 224.0.0.13: PIMv2, Bootstrap, length: 58
но в тоже время на внешнем интерфейсе ни одного моего пакета нет! Почему? Какие опции ядра неодходимы?

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-03 14:03:06
tyler56
С 6 фрей у меня тоже были грабли.
Рекомендую обновиться до 7.2.
Пересобираешь ядро с

Код: Выделить всё

options         MROUTING
И все работает. Причем с 6 вроде тоже работало но регулярно падал сервер.
На время тестов рекомендую в pf закоментировать block all пока не заработает.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-03 14:43:01
BECHA
а в случае с 6х

Код: Выделить всё

options        PIM
необязательна?

P.S. как можно "симитировать" провайдерский IPTV средствами Win или FreeBSD ? а то мне не всегда удобно находится в том месте где нужно настроить проброс.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-03 15:03:46
tyler56
getstream (unix) или vlc (win, unix)
В 7 PIM уже есть для 6 нужно компилировать.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-05 13:49:08
BECHA
ошибся с опциями фаера. изменил, заработало.

Код: Выделить всё

pass quick proto igmp all allow-opts
pass in quick on fxp0 proto udp from any to any port = 20000
другая проблема возникла. маршрутизатор получает и раздает интеренет посредством mpd. так вот при работающем igmpproxy подключение пользователя вызывает завис системы, в /var/log/messages пусто.... от чего такое может быть и как искать причину?

PS mpd 3.18 опция ядра для него никаких нет - он сам все загружает.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-05 17:30:39
tyler56
Причина возможно кроется в кривой обработке igmp пакетов 6 фрей.
В 7 такого не наблюдал.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-05 20:30:34
BECHA
а может добавить в ядро все возможные опции для mpd ?

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-05 22:32:53
tyler56
А причем тут mpd.
Когда была 6 ветка работал у меня и mpd4 и igmpproxy. Сервант регулярно зависал.
Сейчас софт тот же, опции ядра те же, только версия 7.2. Рекомендую обновиться, сложностей при переходе с 6.3 на 7.2 никаких.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-06 9:55:59
BECHA
tyler56 писал(а):А причем тут mpd.
Когда была 6 ветка работал у меня и mpd4 и igmpproxy. Сервант регулярно зависал.
Сейчас софт тот же, опции ядра те же, только версия 7.2. Рекомендую обновиться, сложностей при переходе с 6.3 на 7.2 никаких.
mpd при том, что четко виснет при подключении пользователя. а обновится с 6.1 на 7.2 теоретически конечно можно, правда никогда не делал.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-06 10:54:13
tyler56
Так что именно виснет
так вот при работающем igmpproxy подключение пользователя вызывает завис системы
mpd при том, что четко виснет при подключении пользователя

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-06 22:08:44
BECHA
виснет все при подключении пользователя к mpd. без mpd все работает.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-07 17:28:41
tyler56
Порекомендую протестировать на виртуальной машине 6 и 7 версии.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-07 17:34:03
LMik
Помнится было что то про ignore ng0 и т.п

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-07 22:15:33
tyler56
Возможно поможет.
В конфиге igmpproxy нужно указывать на какие интерфейсы не вещать мутьтикаст. У меня это выгледит так.

Код: Выделить всё

phyint rl0 disabled
phyint ng0 disabled
phyint ng1 disabled
phyint ng2 disabled
phyint ng3 disabled
phyint ng4 disabled
phyint ng5 disabled
phyint ng6 disabled
phyint ng7 disabled
phyint ng8 disabled
phyint ng9 disabled
phyint ng10 disabled
где ng0 и др интерфесы подымаемые mpd

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-08 18:30:58
BECHA
так и сделано:

Код: Выделить всё

quickleave
phyint fxp0 upstream  ratelimit 0  threshold 1
        altnet 10.90.91.254/24
        altnet 77.94.170.0/24
        altnet 224.0.0.0/4
phyint fxp1 downstream  ratelimit 0  threshold 1
phyint fxp2 disabled
phyint ng0 disabled
phyint ng1 disabled
phyint ng2 disabled
phyint ng3 disabled
phyint ng4 disabled
phyint ng5 disabled
phyint ng6 disabled
phyint ng7 disabled
phyint ng8 disabled
phyint ng9 disabled
phyint lo0 disabled
сейчас хочу сделать "тестовый" сервер с тойже ОС, симитировать проблему там и уже искать пути выхода.

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+igmpp

Добавлено: 2009-09-08 21:42:59
tyler56
Ставь на тестовом 7.2

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+i

Добавлено: 2012-10-13 21:54:46
квертя
а как пробросить пакеты с помощью ipfilter в ipnat.rules
он умеет?
пока там одно правило...

Код: Выделить всё

# cat /etc/ipnat.rules
map tun0 10.10.0.0/16 -> 83.219.130.96/32
rdr tun0 0.0.0.0/0 port 24043 -> 10.10.220.7 port 24043
rdr tun0 0.0.0.0/0 port 41938 -> 10.10.225.7 port 41938
конфиг igmpproxy

Код: Выделить всё

quickleave
phyint vr0 upstream  ratelimit 0  threshold 1
<------>altnet 239.192.1.0/26
<------>altnet 192.168.252.14/32
phyint rl0 downstream  ratelimit 0  threshold 1
phyint rl1 downstream  ratelimit 0  threshold 1
phyint lo0 disabled
phyint ng0 disabled
phyint tun0 disabled
ось

Код: Выделить всё

# uname -rpsi
FreeBSD 8.3-RELEASE i386 GENERIC

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+i

Добавлено: 2012-10-13 22:48:24
квертя
при запуске igmpproxy в логах

Код: Выделить всё

igmpproxy[4490]: MRT_INIT failed; Errno(45): Operation not supported

Re: Помогите настроить "проброс" IPTV через FreeBSD 6.1+pf+i

Добавлено: 2012-10-14 0:54:12
QweЯty
igmp запустил надо было модуль ядра подгрузить.

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

Код: Выделить всё

 igmpproxy[1737]: The source address 10.2.0.34 for group 239.192.3.4, is not in any valid net for upstream VIF.
 igmpproxy[1737]: The source address 10.2.0.34 for group 239.192.3.3, is not in any valid net for upstream VIF.
 igmpproxy[1737]: The source address 10.2.0.34 for group 239.192.3.4, is not in any valid net for upstream VIF.
 igmpproxy[1737]: The source address 10.2.0.34 for group 239.192.3.4, is not in any valid net for upstream VIF.
 igmpproxy[1737]: No interfaces found for source 169.254.98.91
больше пока ничего не делал...
как разрешить траф в ipnat пока не нашел :(