Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Netsystem works with Linux



Hi all,
one week ago, after enormous problems and paranoias, I got Netsystem
working under Linux.
There are some point to keep on mind:

1-) There must be a multicast entry in /etc/dvbd.conf like that:
"filter_1 64 MAC" to receive Multicast data. Usually you have to set the
"filter_0 451 MAC" for Unicast. But Multicast is necessary for receiving
Unicast packets.

2-) You need to modify dvbd.c, adding that:

    Under readcfg() function you need to change "filter_0" area in that:

    if (strcmp (v, "filter_0") == 0)
    {
      if (s != NULL)
      {
        unsigned char ip[4];

        dvbcfg[0].status = ON ;

        dvbcfg[0].filter.data[0] = 0x3eff ;

        dvbcfg[0].filter.pid     = (__u16) atoi (s) ;

        dvbcfg[0].filter.mode    = 0x0c ;

        if (ipget (ip, network_device))
        {
          fprintf(stderr,"Can't get local ip address. Stop.\n") ;
          return -1 ;
        }

        syslog (LOG_NOTICE, "Local ip is %u:%u:%u:%u\n",
                             ip[0], ip[1], ip[2], ip[3]);

        dvbcfg[0].filter.data[1] = (0xM6 << 8) | 0x0000 ;
        dvbcfg[0].filter.data[2] = (0xM5 << 8) | 0x00f0 ;
        dvbcfg[0].filter.data[6] = (0xM4 << 8) | 0x00ff ;
        dvbcfg[0].filter.data[7] = (0xM3 << 8) | 0x00ff ;
        dvbcfg[0].filter.data[8] = (0xM2 << 8) | 0x00ff ;
        dvbcfg[0].filter.data[9] = (0xM1 << 8) | 0x00ff ;

        setmac (ip) ;
      }

      else
      {
        dvbcfg[1].status = OFF ;
      }
    }

where M1:M2:M3:M4:M5:M6 is MAC address of a Netsystem registration.

Note: In filter mask I specify a filter like this: FF : FF : FF : FF :
F0 : 00
If I used a 48 bit filter mask my card would give me packets only for
few seconds, while using a larger bit filter mask it, costantly, gives
me packets. I don't know why, Maybe someone could help me understand.
I didn't attach a diff file cause you need to change MAC address as your
own and cause modifies are very few ones.

3-) After that you can receive packets costantly from dvb card. So now
we need to manage VPN service downloading it (you can search at yahoo
the so called "PPTP client linux"), but we also need to PATCH our pppd
to support VPN communication with Netsystem server (Microsoft) (you can
find info at PPTP pages or doc...). Personally I use PPTP-LINUX-1.0.2
with pppd 2.3.8 patched and with kernel 2.2.16 on RedHat 6.2. At the end
you need to add am entry like:
"login" * "password" *
in /etc/ppp/chap-secrets and /etc/ppp/pap-secrets files, where login and
password are same as from Netsystem registration.

4-) After get VPN working you have to block ACK packets that Linux send
to Netsystem answering to all packets you can sniff from dvb0. This
cause, in point 2-), we set bit filter mask to ff:ff:ff:ff:f0:00, so
Linux has to answer to all packets it receives.
I use a little script that, when I created the VPN, add a rule to
firewall (with ipchains command) to allowing enter Linux TCP/IP stack
(from dvb0 interface) ONLY right packets, which ones I asked for.
Also it is necessary to create a default route to VPN interface to be
able to ask ALL Internet to Netsystem. Following scripts I used:

****  /root/bin/vpn ****
ifconfig ppp1 down
rm --force /var/lock/LCK.ttya0
kill -9 `cat /var/run/ppp1.pid`
rm --force /var/run/ppp1.pid
route del default
route add default ppp0
killall -9 pptp
rm --force /var/run/pptp/*
/bin/sleep 3

/root/bin/vpn1
/bin/sleep 7
/root/bin/vpn2
********************

**** /root/bin/vpn1 ****
/sbin/pptp vpn.netsystem.com debug user USER
********************

**** /root/bin/vpn2 ****
GATEWAY=`route|grep "ppp1"|cut -c 1-16`
/sbin/route del 212.31.242.97
/sbin/route del 212.31.242.98
/sbin/route del 212.31.242.99
route add $GATEWAY dev ppp0
/bin/sleep 1

/sbin/route add DNSSERVER1 dev ppp0
/sbin/route add DNSSERVER2 dev ppp0

/sbin/route del default
/sbin/route add default dev ppp1

/sbin/ipchains -F
/sbin/ipchains -X
IP=`/root/bin/getip`
/sbin/ipchains -A input -i dvb0 -d ! $IP -j DENY
*********************

Where:

-) I intended to use ppp0 as Internet modem interface and ppp1 as VPN
interface
-) You can call "vpn" only cause it shutdown the service (if needed) and
it restarts it calling vpn1 and vpn2
-) I usually insert my DNSSERVER1 and DNSSERVER2 in ppp0 interface cause
I don't want to use VPN to solve names, it is stupid!! Anyway, you can
delete them from vpn scripts and you can add them once at ppp0
startup...
-) USER is the user from Netsystem registration form
-) You need to control that VPN is properly working, making a "ping" and
controlling in ppp0 interface (by sniffing with Ethereal or Tcpdump)
that VPN is sending the incapsulate data packets for EACH PING,
otherwise you need to restart VPN.


My system is:
AMD ATHLON 600 MHz, CHIPSET VIA686
196 MB RAM
HDD 13 GB
WinTV Hauppage dvb card with Siemens 0.8.1 drivers
Linux kernel 2.2.16 on RedHat 6.2
PPTP-Linux 1.0.2 with pppd 2.3.8 (patched)

I think I have no other info to add.
Hoping it could be useful....

Bye
Roberto Arcomano




--- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index