Archive for June, 2011

Reverse tethering for android

Friday, June 17th, 2011

Since I’m on a road-trip and don’t have a SIM-card with data for every country I’m visiting (I’m fine in Germany and Belgium, but did not get a SIM-card for the Czech republic where i’m just for 24 hours) and never connect with my phone to an untrusted wifi network, I thought i’d do the reverse of tethering: connect my phone to my laptop (which has a tunnel to my server-rack in the datacenter) and surf through that. So mostly as a note for myself, here’s what I did:

Connected the USB between phone and laptop, then enabled tethering (this is Cyanogen 2.2 on a G1, rooted). This brings up the usb0 nic on both ends with some default ip’s. Then went into the terminal on the phone (probably can do this with adb shell as well) and checked I could ping:

# ifconfig usb0
usb0: ip 192.168.42.129 mask 255.255.255.0 flags [up broadcast running multicast]
# ping 192.168.42.137
PING 192.168.42.137 (192.168.42.137) 56(84) bytes of data.
64 bytes from 192.168.42.137: icmp_seq=1 ttl=64 time=0.519ms

With that running, it is time to enable forwarding on my linux laptop:

sysctl -w net.ipv4.ip_forward=1

And enable some firewall rules to have traffic from the phone get NATTED on the outgoing tunnel endpoint on my laptop (tap0, remember usb0 is the usb nic that connects to my phone):

iptables -A FORWARD -i tap0 -o usb0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A POSTROUTING -t nat -o tap0 -j MASQUERADE
iptables -A INPUT -i usb0 -j ACCEPT
iptables -A FORWARD -i usb0 -o tap0 -j ACCEPT

Then I set the default route:

route add default gw 192.168.42.137

And finally, I need to tell the android that my nameservers are 194.109.6.66 and 194.109.9.99:

# setprop net.dns1 194.109.6.66
# setprop net.dns2 194.109.9.99

And we’re done!

Flattr this

The Last Ninja Tour is on the road

Tuesday, June 14th, 2011

One of the things I have always wanted to do is visit Vienna and attend Ninjacon (previously known as Plumbercon). So when I learned that this years Ninjacon is actually going to be the last one (it will continue as B-sides Vienna, you know, B-sides, the next hippest thing since sliced bread), I had a crazy idea: let’s just drive down to Vienna, stop at some hackerspaces along the way and attend!

As it is with me and crazy ideas, I then stopped thinking and just did it. So here I am writing from a comfy couch in Das Labor. This hackerspace in Bochum (Germany) is my first stop on the way to Vienna, and I must say: not a bad choice at all. But more on that later.

In about an hour, I will be heading out to Kassel where there is Flipdot. From there on to Weimar (Maschinenraum) and Prague (brmlab). And then I will hit Vienna just in time to unload and set-up the audio gear for Ninjacon. Yes, the audiogear. You know how these things go. You plan a quiet vacation, but before you know it your car is full of equipment or fiber or what-have-you. So in this case, the crew at Ninjacon asked if I could bring some audio gear, since that was one of the things they had not covered yet.

So with all the audio gear of the Signal studio (graciously sponsored by Hxx of course) and some borrowed PA speakers I will do the audio at Ninjacon. Great, I won’t get bored then! Luckily, i’m staying an extra day to leave on Monday again. Of course I want to check out Metalab and the city and whatever else Socialhack is going to show me!

From Vienna, it is on to Munich (I hope, haven’t yet heard back from then) and then Stuttgart, where I will revisit Shackspace. Well, that is, visit their new location because they have moved since my first (and also last) visit there about 6 months ago. And then it’s Luxembourg, for that long-due visit to syn2cat. En passant, I will join celebrations of the duke’s birthday (sort of like queensday back home, but with dukes and duchesses instead of queens and princes).

If that’s not enough, after a day of recovery, I’m heading to Charleroi in Belgium to arrive in time for the opening weekend of a fresh new hackerspace by the name of Wolfplex.

So yeah, quite the trip. I haven’t planned much, just announced my arrival at certain dates in certain cities and hope I will be able to find a place to crash. I mean to spend the days contemplating and reflecting. I’m due for a re-evaluation of all my projects, priorites and life. What better way to do so than lounging at all those hackerspaces!

Looking forward to all of it. And I hope I will find a 74HC125N along the way somewhere to complete my USBTinyISP. Stay tuned for updates.

Flattr this