goalmarketing / vigor2130

Automatically exported from code.google.com/p/vigor2130
0 stars 0 forks source link

VLANs and IPTV... #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Since i don't know where to get support on this, i've decided to post here...:

My ISP uses 3 vlans so to transport Internet, Voip, IPTV (100,101,105 
respectively) and i've been trying to configure IPTV on this router but i'm 
having a hard time to get the STBs to work.

What i've done so far:

1) created a vlan for iptv (vid=105) on Wan interface and put it up:

root@Vigor2130:/# uci set network.iptvwan=interface
root@Vigor2130:/# uci set network.iptvwan.ifname=eth1.105
root@Vigor2130:/# uci set network.iptvwan.proto=dhcp
root@Vigor2130:/# uci set network.iptvwan.hostname=Vigor2130
root@Vigor2130:/# uci set network.iptvwan.disable=0
root@Vigor2130:/# uci commit network
root@Vigor2130:/# vconfig add eth1 105
root@Vigor2130:/# ifconfig eth1.105 up

2) checked the network

root@Vigor2130:/# uci show network.iptvwan
network.iptvwan=interface
network.iptvwan.ifname=eth1.105
network.iptvwan.proto=dhcp
network.iptvwan.hostname=Vigor2130
network.iptvwan.disable=0

3) Checked if the interface was up and running

root@Vigor2130:/# ifconfig eth1.105

eth1.105  Link encap:Ethernet  HWaddr 00:50:7F:CB:ED:F5  
          inet addr:10.48.47.2  Bcast:10.48.127.255  Mask:255.255.128.0
          inet6 addr: fe80::250:7fff:fecb:edf5/64 Scope:Link
          UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:17567 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23578 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:23861100 (22.7 MiB)  TX bytes:9089025 (8.6 MiB)

4) checked if the interface was getting a complete DHCP lease (ip/mask/gw):

root@Vigor2130:/# uci -P/var/state show network.iptvwan
network.iptvwan=interface
network.iptvwan.ifname=eth1.105
network.iptvwan.proto=dhcp
network.iptvwan.hostname=Vigor2130
network.iptvwan.disable=0
network.iptvwan.device=eth1.105
network.iptvwan.ipaddr=10.48.47.2
network.iptvwan.broadcast=+
network.iptvwan.netmask=255.255.128.0
network.iptvwan.dns=87.103.119.196 213.30.36.212
network.iptvwan.up=1
network.iptvwan.uptime=72891.46
network.iptvwan.lease_gateway=10.48.0.1
network.iptvwan.lease_server=87.103.119.196
network.iptvwan.lease_acquired=1300577025
network.iptvwan.lease_lifetime=3600

5) checked igmpproxy if the upstream was the wan bridge and if the downstream 
was the lan bridge:

##------------------------------------------------------
## Configuration for eth0 (Upstream Interface)
##------------------------------------------------------
phyint br-wan upstream  ratelimit 0  threshold 1
altnet 239.195.7.2/24 #not sure if this is right
altnet 239.196.1.140/24 #not sure if this is right
altnet 239.255.255.250/24 #not sure if this is right

##------------------------------------------------------
## Configuration for eth1 (Downstream Interface)
##------------------------------------------------------
phyint br-lan downstream  ratelimit 0  threshold 1

6) checked if the STB was getting a router DHCP lease

root@Vigor2130:/# cat /tmp/dhcp.leases 
1300618807 00:25:2e:49:55:1a 192.168.1.102 * 01:00:25:2e:49:55:1a

Now...when i plug a STB, has it shows, the stb ges a lease but it cannot get 
IPTV...it stays stuck on the ISP logo...idk what's missing... i've run 
igmpproxy in debug mode and this what i get:

adding VIF, Ix 0 Fl 0x0 IP 0x0d63a80a eth1.101, Threshold: 1, Ratelimit: 0
adding VIF, Ix 1 Fl 0x0 IP 0xfe01a8c0 br-lan, Threshold: 1, Ratelimit: 0
adding VIF, Ix 2 Fl 0x0 IP 0x022f300a eth1.105, Threshold: 1, Ratelimit: 0
adding VIF, Ix 3 Fl 0x0 IP 0xc241885f br-wan, Threshold: 1, Ratelimit: 0
joinMcGroup: 224.0.0.2 on eth1.101
joinMcGroup: 224.0.0.2 on br-lan
joinMcGroup: 224.0.0.2 on eth1.105
RECV V2 member report   from 10.168.99.13    to 224.0.0.2
The IGMP message was from myself. Ignoring.
RECV Membership query   from 10.168.99.13    to 224.0.0.1
RECV Membership query   from 192.168.1.254   to 224.0.0.1
RECV Membership query   from 10.48.47.2      to 224.0.0.1
RECV V2 member report   from 192.168.1.254   to 224.0.0.2
The IGMP message was from myself. Ignoring.
RECV V2 member report   from 10.48.47.2      to 224.0.0.2
The IGMP message was from myself. Ignoring.
RECV V2 member report   from 10.168.99.13    to 224.0.0.2
The IGMP message was from myself. Ignoring.
RECV V2 member report   from 192.168.1.102   to 239.195.7.2
Inserted route table entry for 239.195.7.2 on VIF #1
joinMcGroup: 239.195.7.2 on br-wan
RECV V2 member report   from 192.168.1.102   to 239.196.1.140
Inserted route table entry for 239.196.1.140 on VIF #1
joinMcGroup: 239.196.1.140 on br-wan
RECV Leave message      from 192.168.1.102   to 224.0.0.2
RECV V2 member report   from 192.168.1.102   to 239.196.1.140
Updated route entry for 239.196.1.140 on VIF #1
joinMcGroup: 239.196.1.140 on br-wan
MRT_ADD_MEMBERSHIP failed; Errno(98): Address already in use
RECV Membership query   from 192.168.1.254   to 239.196.1.140
...
...
...
RECV V2 member report   from 10.168.99.13    to 224.0.0.2
The IGMP message was from myself. Ignoring.
RECV V2 member report   from 10.48.47.2      to 224.0.0.2
The IGMP message was from myself. Ignoring.
RECV V2 member report   from 192.168.1.102   to 239.196.1.140
Updated route entry for 239.196.1.140 on VIF #1
RECV V2 member report   from 192.168.1.254   to 224.0.0.2
The IGMP message was from myself. Ignoring.
RECV Leave message      from 192.168.1.102   to 224.0.0.2
RECV Membership query   from 192.168.1.254   to 239.196.1.140
RECV V2 member report   from 192.168.1.102   to 239.196.1.140
Updated route entry for 239.196.1.140 on VIF #1
joinMcGroup: 239.196.1.140 on br-wan
MRT_ADD_MEMBERSHIP failed; Errno(98): Address already in use
RECV V2 member report   from 192.168.1.102   to 239.196.1.140
Updated route entry for 239.196.1.140 on VIF #1
RECV V2 member report   from 192.168.1.102   to 239.196.1.140
Updated route entry for 239.196.1.140 on VIF #1
...
...
...
Select() failure; Errno(4): Interrupted system call
Got a interupt signal. Exiting.
Route is not active. No kernel updates done.
leaveMcGroup: 239.195.7.2 on br-wan
Route is not active. No kernel updates done.
leaveMcGroup: 239.196.1.140 on br-wan
All routes removed. Routing table is empty.
Shutdown complete....
root@Vigor2130:/etc# 

What am i missing? why aren't the STBs getting TV ? Can someone please help ?

Thank you

Original issue reported on code.google.com by Keepe...@gmail.com on 20 Mar 2011 at 12:02

GoogleCodeExporter commented 8 years ago
You want to use IGMP Proxy to handle iptv streaming. It is more complicate and 
maybe the igmpproxy have some settings or IOP issue.

Can you try to use bridge mode first? (in multi-vlan menu, bridge direct from 
WAN to a specified LAN port)

The bridge mode should be work. Get the LAN packet by monitor port.

Then do again by igmp proxy and monitor the LAN packet again.
Compare the packet you should know what the igmp proxy loss.
Then we can know if it is the issue about igmp proxy or firewall (iptables).

Original comment by jht...@gmail.com on 20 Mar 2011 at 12:35

GoogleCodeExporter commented 8 years ago
Well, i've figured out partially what is needed to make IPTV work with my ISP: 
I need to use the following dhcp options on the client:

Option 5: dhcp-requested-address
Option 6: domain-name-servers
Option 121: Classless Static Routes

...and what i would like to have is a network/dnsmasq conf files similar to 
this:

/etc/config/network:

network.iptvwan=interface
network.iptvwan.ifname=eth1.105
network.iptvwan.proto=dhcp
network.iptvwan.reqopts= staticroutes
network.iptvwan.dhcp-requested-address=10.xx.xx.xx

/etc/dnsmasq.conf:

dhcp-option=6,ipaddress1,ipaddress2

Now, the 1st two dhcp options i believe that will not be a problem (haven't 
tested yet), but the CSR (option 121) i believe will be because of this:

I've checked the Vigor2130_GPL_V1.5.0.1.tar.bz2.tar.bz2 source code, and in: 

/2130_gpl_release/package/busybox/patches/

...there's a patch called:

905-udhcp_option_121_33.patch

... which i believe is being applied to udhcpc, but comparing with the patch 
shown in:

https://dev.openwrt.org/ticket/6435#comment:22

...it seems to me that draytek's implementation is different and/or is 
incomplete.
 I say this because that from my limited programming/linux knowledge, it seems to me that it's not possible to set that option on the "/etc/config/network" configuration file, since some code is missing in:

/package/base-files/files/usr/share/udhcpc/default.script

and also in:

/package/base-files/files/lib/network/config.sh

So, if someone could please give me a already patched default.script and 
config.sh so to make CSR work, it would make my life easier...

Thank you for your support!

Original comment by Keepe...@gmail.com on 1 Apr 2011 at 1:39

GoogleCodeExporter commented 8 years ago
default.script is in
/usr/share/udhcpc/
You can check this file. 

Original comment by jht...@gmail.com on 1 Apr 2011 at 6:38

GoogleCodeExporter commented 8 years ago
Well, yes... /usr/share/udhcpc/default.script has this:

    #STATIC ROUTES (rfc3442)

    if [ -n "$staticroutes" ] ; then
        DEST=""
        LOOP=0
        for i in $staticroutes ; do
            if [ $LOOP == "0" ] ; then
                DEST=$i
                LOOP=1
            elif [ $LOOP == "1" ] ; then
                echo "adding route" $DEST "gw" $i
                route add -net $DEST gw $i dev $interface
                LOOP=0
            fi
           done
    fi

...which i beleive will allow me to start udhcpc CSR, by doing something like:

root@OpenWrt:~# udhcpc -i eth1.105 -O staticroute

...but this will require me to do it manually each time that i reboot the 
router, i think. 

Is there a way to setup this automatically?

I'm sorry for all the trouble but i'm not an experienced linux/programmer user, 
neither do i know busybox/openwrt well, so i really need help here...

Original comment by Keepe...@gmail.com on 1 Apr 2011 at 8:29

GoogleCodeExporter commented 8 years ago
ps: typo. i meant: root@OpenWrt:~# udhcpc -i eth1.105 -O staticroutes

Original comment by Keepe...@gmail.com on 1 Apr 2011 at 8:32

GoogleCodeExporter commented 8 years ago
You can try to modify the config in  /etc/igmpproxy.conf 

phyint eth1.105 upstream ratelimit 0 threshold 1

A good reference for IPTV application:

http://www.projectiwear.org/~plasmahh/t_home.html

Original comment by jht...@gmail.com on 8 Apr 2011 at 1:36