Surfing with the Greenphone

Published Friday December 8th, 2006
2 Comments on Surfing with the Greenphone
Posted in Qt

To test some Software on the Greenphone, it might be handy to connect to the internet using the USB cable. To achieve this, connect the Greenphone to your machine and run the following script on the Greenphone SDK (as root user):

#!/bin/sh

# the external interface
EXTIF=eth0
# the Greenphone interface
GREENIF=eth1

# enable forwarding
echo “1” > /proc/sys/net/ipv4/ip_forward

# forward packets from the outside if they belong to an existing connection
iptables -A FORWARD -i $EXTIF -o $GREENIF -m state –state ESTABLISHED,RELATED -j ACCEPT
# forward everything from the Greenphone
iptables -A FORWARD -i $GREENIF -o $EXTIF -j ACCEPT
# Masquerade all packages coming from the Greenphone
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

Then, open a shell on your Greenphone (by running gph -console, for example) and run the following commands:

ifconfig eth0 netmask 255.255.255.0
route add default gw 10.10.10.21

Voila – now you should be able to connect to any host on the internet.

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Qt

2 comments

Dark Apostrophe says:

Hey. This is actually off topic, but is it possible to get a Greenphone without the dev kit? I just want a cool free software phone. I live in Norway, so shipping and such shouldn’t be a problem.

harald says:

Nope, sorry. The Greenphone is not intended to be used as a phone, it’s intended to be used as a device to make GUIs for other phones.

Commenting closed.

Get started today with Qt Download now