wiki:CcubeReftek
Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
Last modified 12 months ago Last modified on 19.09.2016 10:53:59

You can combine a Reftek 130 and a C-Cube for sending Data home via UMTS, using the C-Cube just as an router. The Reftek 130 and the C-cube are connected via ethernet and should be in the same subnet.

Reftek IP 192.168.0.100
ccube ethernet IP eth0 192.168.0.106
ccube UMTS IP usb0 DHCP from provider

Reftek RT130

Reftek 130 parameters

IP 192.168.0.100
Mask 255.255.255.0
RTPD 141.89.111.227
gateway 192.168.0.106
line down toss
toss after 0 min
Enet Ctrl ON

For setup forwarding and NAT(Network address translation):

iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
iptables -A FORWARD -i eth0 -j ACCEPT
vi /etc/sysctl.conf 
net.ipv4.ip_forward=1

The rules of iptables are lost after a reboot, here a script (iptables_reftek.sh):

#!/bin/bash
#
# This script is to start the routing from Reftek130 ethernet over the C-Cube to
# the rtpd at a remote computer. Started by /etc/networks/interfaces post
# needs /etc/sysctl.conf  net.ipv4.ip_forward=1
# in /usr/local/bin/

iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
iptables -A FORWARD -i eth0 -j ACCEPT

And start the script in /etc/network/currend_usb0

# UMTSMODE=1,2 or 3 - UMTS turned on!
auto usb0
iface usb0 inet dhcp
        pre-up /usr/local/bin/umts_on.py
        pre-up /usr/local/bin/connect_umts_manual.sh internet.t-d1.de
        post-up service ddclient start
        post-up /usr/local/bin/iptables_reftek.sh
        pre-down service ddclient stop
        post-down /usr/local/bin/disconnect_umts_manual.sh
        post-down /usr/local/bin/umts_off.py

Snippet from CCUBE-MASTER-CONFIG.TXT

...
#############################################################
# Communication settings - specification of operation for
# all network devices: eth0 / wlan0 and usb0
ETHERMODE       1       # one of 0, 1, 2 - add as u need ...
ETHERIP         192.168.0.106   # derived from device eeprom
WLANMODE        0       # one of 0, 1, 2 - add as u need ...
WLANIP          172.16.0.106    # derived from device eeprom
WLANCHAN        1       # one of 1, 6, 12
UMTSMODE        2       # one of 0, 1, 2, 3, 4 -->
#                       0G means OFF, 1G means AUTO, 2G, 3G, 4G
UMTSAPN         internet.t-d1.de #
SIMPIN          xxxx    # pin in fulltext!
#############################################################
...