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.

Version 9 (modified by tracdaniel, 12 months ago) (diff)

--

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