after much agony trying to get my Huawei modem to work with the pineapple, I managed it with a slightly unconventional approach.
newer Huawei modems don't support usb modeswitch, but instead wait for the kernel to work out what it is and use the correct kernel module on it.
the first step is to make sure that you have the serial interface enabled. you can check this by issuing:
ls /dev/ttyUSB*
if you get
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3
then your modem is currently in the correct mode; but if not, you need to insert the correct kernel module.
first, find the ID of your USB modem by issuing
lsusb
and find your modem. for me, it was the fourth one.
root@Pineapple:~/sslstrip-0.9# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0409:0059 NEC Corp. HighSpeed Hub
Bus 001 Device 004: ID 0781:5170 SanDisk Corp.
Bus 001 Device 007: ID 12d1:140c Huawei Technologies Co., Ltd.
with the above, the vendor ID is 12d1 and the product is 140c.
for the command to insert the correct module with these options, we need to issue
insmod usbserial vendor=0x12d1 product=0x140c
(note that we inserted "0x" before each section of the IDs)
now we should have the serial interfaces in /dev/USB*.
I completely gutted my configuration script in testing (which isn't the best idea; for a better solution read down to the next post to see what Whistle Master did) but my solution works reliably. it simply contains
rmmod usbserial
sleep 3; insmod usbserial vendor=0x12d1 product=0x140c
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT
ifup wan2
the pineapple needs to know what wan2 is, which we set above. I changed my /etc/config/network file to have:
config interface wan2
option ifname ppp0
option device /dev/ttyUSB0
option apn yesinternet
option service umts
option proto 3g
if you use multiple 3G cards and switch between them, you should simply add Whistle Master's section of script to the default one.
note that you'll have to change that apn to be your carrier's; my apn is "yesinternet" because i'm using the prepaid mobile package provided by Optus in Australia.
please note that it may take a large amount of tweaking to get this to work correctly for you. It's designed to be a starting point to work out how to configure a Huawei modem for the pineapple, and is almost guaranteed to fail for you because of differences with your 3G network provider.