wiregr Posted May 27, 2012 Share Posted May 27, 2012 I managed to get my MK4 pineapple to successfully connect to the internet through my Android phone and thought I would share the steps for anyone who's interested. I've tested this on a fresh MK4 Pineapple (firmware 2.0) using a Google Nexus running CyanogenMod9. I'm not sure if this will work with other tethering software like PDAnet. After looking around on google, it seems that in order to get an openwrt router to connect via android tether, the only real packages we need that aren't already installed on the Pineapple are: kmod-usb-net kmod-usb-net-cdc-ether (depends on kmod-usb-net) kmod-usb-net-rndis (depends on kmod-usb-net, kmod-usb-net-cdc-ether) The official openwrt package repo has these, but they're all built against kernel 3.3.7 which is too new (pineapple firmware 2.0 went out with 3.2.14), so I checked out an older revision of the openwrt source tree and packages (revision 31222 which used the correct kernel version) and built what was missing. After copying them over to the pineapple and installing using opkg, the pineapple detected my phone just fine and was able to pull down an ip and connect to the internet. So here's a step-by-step: Download the missing packages and copy them over to your pineapple (/tmp in this example) Run the following commands in this order:opkg --nodeps install /tmp/kmod-usb-net_3.2.14-1_ar71xx.ipk opkg --nodeps install /tmp/kmod-usb-net-cdc-ether_3.2.14-1_ar71xx.ipk opkg --nodeps install /tmp/kmod-usb-net-rndis_3.2.14-1_ar71xx.ipk Reboot the pineapple (not sure if this is necessary) Connect your android phone to the pineapple via USB Turn on USB tethering On the pineapple, run dmesg and verify that usb0 shows up Add the following to /etc/config/network (This ensures that usb0 will obtain an ip via dhcp):config interface usb option ifname usb0 option proto dhcp Restart pineapple again, enable tethering in android again. At this point, ifconfig usb0 should show that usb0 has automatically obtained a valid ip address and you should be able to ping out to the internet. Now that it's working, you'll still need to setup ip forwarding to properly forward traffic from clients to/from the usb: iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o usb0 -j MASQUERADE iptables -A FORWARD -s 172.16.42.0/24 -o usb0 -j ACCEPT iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i usb0 -j ACCEPT At this point, you should be able to connect to the pineapple and browse the internet as usual. Tested with urlsnarf and everything seemed to be working properly :) If anyone's interested, I can post a step-by-step so you can build everything yourself. Here are the package files I used: kmod-usb-net_3.2.14-1_ar71xx.ipk kmod-usb-net-cdc-ether_3.2.14-1_ar71xx.ipk kmod-usb-net-rndis_3.2.14-1_ar71xx.ipk Anyways, let me know if you have any questions. I've been a lurker for a while and I wanted to try and contribute for once :D Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.