How can I access my desktop computer when its tethered to my Android phone?
It turned to out to be quite simple, when tethering the phone behaves like a router (wifi on eth0 and the tethered computer on usb0). I guess that in some way connecting a switch to the phone would allow multiple computers to be connected by cable to a single computer (a ridiculous setup, but still fun :D). I had to use iptables to route the traffic from port 22 of the device to port 22 of the connected device and accept traffic on port 22.
I used ssh (DigiSSHD app) to ssh into my phone, logged in as root and added the following two rules for iptables. (where the connected device is 192.168.42.185)
# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 22 -j DNAT --to 192.168.42.185:22
# iptables -A FORWARD -p tcp -d 192.168.42.185 --dport 22 -j ACCEPT
Using the same technique one could run a webserver on a computer wirelessly connected to the network using an android phone. Just by changing the port to port 80:
# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to 192.168.42.185:80
# iptables -A FORWARD -p tcp -d 192.168.42.185 --dport 80 -j ACCEPT
Please note that iptables is partially supported on android, as far as I know is only the iptables binary available and not iptables-save & iptables-restore, you would need to compile these for your device. I do still have trouble saving my configuration, and the settings tend to reset very often, so I still have to look into it sometimes.
This article was very helpful: http://www.fclose.com/b/linux/816/port-forwarding-using-iptables/