IPhone USB Tethering to Pfsense ($150)



  • I'd like to use my iPhone 4 to tether to Pfsense 2.0 via USB, then have the iPhone show up in pfsense as a WAN. From there, I could share the iPhone WAN to all my LAN clients as an internet connection.

    Here's how I see it working:

    a) Download iPhone USB Tethering package for Pfsense 2???

    1. Plug the iPhone USB cable into a USB port on the pfsense box
    2. Enable USB tethering on the iPhone
    3. See an iPhone WAN interface show up

    I need a quote as to how much this might cost to develop. I've seen interest in iPhone USB tethering FreeBSD before:

    http://forums.freebsd.org/showthread.php?t=16935

    It's worth it to me because my normal cable connection here is so flaky, while my iPhone's 3G signal is fantastic (like .25 miles away from the tower). I routinely get 400-500KB downloads off my iPhone's 3G connection. I'd love to be able to use it on pfsense as a primary or failover WAN.



  • Yeah it can be done.
    The hours needed are a quite more than you can buy a 3G modem i can say?!



  • You can also try something easier, install a  wifi device compatible with pfsense and start a wifi tethering on iPhone.
    Wifi thetering is native after iOS 4.3.



  • I've tried the wireless tethering route before:

    1. You'd still need to plug the phone into a power source anyway (eats battery fast)
    2. The pfsense box would need a wireless card

    3G modems require separate data plans, and costs are high.

    Can I get an idea how much USB iPhone tethering would cost for pfsense?



  • Bumpity-bump. Still looking for a quote.



  • The issue that I am aware of is that with tethering a phone, verizon and att charge differently once your tether.  Both of those providers give you a little (usually 2 or 4 gigs) of data once tethered.  When you go over that usage, the price per MB sky-rockets.  The unlimited data that they give you is in respect to using your phone to access the web/email/etc, not tethering.
    There are ways around the system, but I don't suggest them since they'll catch on sooner or later and then bill you.



  • Well start from what you are willing to put on it.



  • I've been tethering with the iPhone for two years now on and off. Subscribers do have to watch data usage pretty closely.
    I still have my grandfathered unlimited data plan. With the advent of the iPhone 5, Sprint will be offering the phone with an unlimited data plan. Possibly in the future, data plans may be tweaked more. In a year or two, the iPhone may finally have LTE connectivity, which would be another reason to support it on pfsense.

    Anyway, the idea is to use it as a backup WAN, not the fulltime WAN.

    I'll start at $100.



  • I'd put $50 into this so the community could benefit. I'd just plug in my phone if all my connections are down. Emergency home network wan connection.



  • in .nl a prepaid USB dongle is 20 euros. And you get about 400MB of data on it too.

    I tried a huawei dongle and it just worked for em, needed some fiddling to find the correct serial port but it does work.



  • This might help if you haven't seen it already. http://forums.freebsd.org/showthread.php?t=19995

    This would have some practical applications. I've had a think about how needed it is vs. putting a compatible wireless NIC in place (which I've seen for ~£5 on eBay) and connecting to an iPhone in AP mode (Android user speaking, not sure if iOS offers that) and plugging the phone into a USB port for power also and I am interested in what situation it would be the ideal solution for? This is not to criticize, just to understand.



  • Saw this and thought I would reply…

    I have recently just tried this, as I have tethering available on my iPhone.  Seems the iphone requires ADHOC connection to connect the native IOS Wifi Hotspot.  In Pfsense 2.0.1, if I configure my wireless interface as ADHOC, the machine reboots and I get a kernel panic over and over again upon reboot until I physically remove the card.  I've tried this multiple times, not sure if it's my on WRAP having issues, or maybe my Artheros card.

    Anyone gotten an ADHOC connection working in Pfsense 2.0.1?  This is probably not something that is used/configured all that much.



  • My Android phone connects to at least a few different APs. I have never had to try it in ad hoc mode. :-)

    Some time ago I did try adhoc mode on a number of devices with distinct RALINK chipsets and got kernel panics very quickly after enabling them. I agree with your conclusion that adhoc mode is probably not configured/used very often with FreeBSD.



  • My android phone works without an issue too, not that this helps you, I'm mentioning for anyone else that comes across this post. You can get dirt cheap android devices that support AP mode, could be a cheap work around in the mean time. I may be getting an iPhone for work and I shall give it a go if it happens. What iOS version did you try on by the way?



  • I too have never been able to get the wireless AP mode on the iPhone to connect properly to a wireless adapter used by pfsense. My offer of $100 still stands for a true USB-tethering solution for iPhone to pfsense. This would be especially nice now that the iPhone 5 is coming with LTE support.

    On a side note, I have an iPhone 4S (CDMA Sprint, unlocked outside of US). I'll probably upgrade to an iPhone 5 around the end of this year. If I can get a pfsense developer to commit to giving pfsense users an true USB-iPhone tethering solution solution, I will gladly donate my used (jailbroken) iPhone for that cause.



  • @Strider3000:

    I too have never been able to get the wireless AP mode on the iPhone to connect properly to a wireless adapter used by pfsense. My offer of $100 still stands for a true USB-tethering solution for iPhone to pfsense.

    I wonder what USB device the iPhone pretends to be when it is USB-tethering. Could you enable USB tethering mode on your iPhone then
    1.  connect your iPhone to your pfSense system and post the ouput of the pfSense shell command```

    usbconfig show_ifdrv

    #usbconfig dump_device_desc

    2.  connect your iPhone to a linux system and post the output of the Linux shell command```
    # lsusb 
    # dmesg | tail -10
    # lsusb -v
    

    When I have my Android phone in USB tethering mode and connect it to my Linux netbook the system reports a new cdc-ether interface. OpenBSD appears to have the cdce and cdcef drivers which MIGHT be "relatively" easy to port to FreeBSD.

    Unfortunately, at commercial rates the $150 offered so far wouldn't go very far towards completing the task, even if it does turn out to be "relatively" easy.



  • I have done a bit more research and found there are a couple of interesting devices drivers in the FreeBSD source tree which are undocumented on man pages and don't seem to have been documented in the release notes:

    cdce which looks as if it should talk with my Android phone USB tethered; and
    ipheth which claims to be a driver for iPhone as a USB Ethernet interface.

    I have attached files from the FreeBSD 8.3 release which should work with pfSense 2.1 snapshot builds. Download the files, remove the .png at the end of the name and put them in /boot/kernel Then the appropriate driver can be loaded in the kernel on demand by (for example):```

    kldload if_cdce

    
    I possibly won't be able to check my Android phone with the driver for a few days and I have no iPhone to try the ipheth driver. I have posted the drivers for interested parties to try and report back.
    
    It has been reported elsewhere that pfSense needs some work to deal intelligent with interfaces that aren't connected permanently but that shouldn't stop anyone with suitable gear doing some experimenting.
    
    [if_cdce.ko.png](/public/_imported_attachments_/1/if_cdce.ko.png)
    [if_cdce.ko.symbols.png](/public/_imported_attachments_/1/if_cdce.ko.symbols.png)
    [if_ipheth.ko.png](/public/_imported_attachments_/1/if_ipheth.ko.png)
    [if_ipheth.ko.symbols.png](/public/_imported_attachments_/1/if_ipheth.ko.symbols.png)

  • Netgate Administrator

    There are two fair sized problems here that will need to be overcome.
    1. Assuming that the iPhone can be made to tether successfully, the second link above suggests it can, you would have to work around the fact that pfSense does not handle having an interface removed. You would have to permanently leave your iPhone attached and prevent it ever going into standby.
    2. If you end up using the cdce driver it has a quirk to be aware of. It will use a fake MAC address for the device even if one is provided by it; you can see this in the first link above. This means that even if you have worked around point 1 it will appear as a new interface, with a different Mac, the every time its connected.

    cdce0: <apple 0="" 5="" inc.="" iphone,="" class="" 0,="" rev="" 2.00="" 0.01,="" addr=""> on usbus1
    cdce0: faking MAC address
    ue0: <usb ethernet=""> on cdce0
    ue0: Ethernet address: 2a:ba:b8:d4:02:00
    ....
    cdce0: <apple 0="" 5="" inc.="" iphone,="" class="" 0,="" rev="" 2.00="" 0.01,="" addr=""> on usbus1
    cdce0: faking MAC address
    ue0: <usb ethernet=""> on cdce0
    ue0: Ethernet address: 2a:75:5f:d7:02:00</usb></apple></usb></apple>
    

    I ran into both these issues trying to connect an old PDA. I would think it would be far easier to integrate with pfSense if it's possible to talk to it as a serial modem.

    Steve



  • @wallabybob:

    @Strider3000:

    I too have never been able to get the wireless AP mode on the iPhone to connect properly to a wireless adapter used by pfsense. My offer of $100 still stands for a true USB-tethering solution for iPhone to pfsense.

    I wonder what USB device the iPhone pretends to be when it is USB-tethering. Could you enable USB tethering mode on your iPhone then
    1.   connect your iPhone to your pfSense system and post the ouput of the pfSense shell command```

    usbconfig show_ifdrv

    #usbconfig dump_device_desc

    2.   connect your iPhone to a linux system and post the output of the Linux shell command```
    # lsusb 
    # dmesg | tail -10
    # lsusb -v
    

    When I have my Android phone in USB tethering mode and connect it to my Linux netbook the system reports a new cdc-ether interface. OpenBSD appears to have the cdce and cdcef drivers which MIGHT be "relatively" easy to port to FreeBSD.

    Unfortunately, at commercial rates the $150 offered so far wouldn't go very far towards completing the task, even if it does turn out to be "relatively" easy.

    From Pfsense:

    No iPhone connected:

    [2.0.1-RELEASE][admin@pfsense.strider.local]/root(7): usbconfig show_ifdrv
    ugen0.1: <uhci root="" hub="" intel="">at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen0.1.0: uhub0: <intel 1="" 9="" uhci="" root="" hub,="" class="" 0,="" rev="" 1.00="" 1.00,="" addr="">ugen1.1: <uhci root="" hub="" intel="">at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen1.1.0: uhub1: <intel 1="" 9="" uhci="" root="" hub,="" class="" 0,="" rev="" 1.00="" 1.00,="" addr="">ugen2.1: <uhci root="" hub="" intel="">at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen2.1.0: uhub2: <intel 1="" 9="" uhci="" root="" hub,="" class="" 0,="" rev="" 1.00="" 1.00,="" addr="">ugen3.1: <uhci root="" hub="" intel="">at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen3.1.0: uhub3: <intel 1="" 9="" uhci="" root="" hub,="" class="" 0,="" rev="" 1.00="" 1.00,="" addr="">ugen4.1: <ehci root="" hub="" intel="">at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
    ugen4.1.0: uhub4: <intel 1="" 9="" ehci="" root="" hub,="" class="" 0,="" rev="" 2.00="" 1.00,="" addr="">ugen4.2: <usb2.0 hub="" vendor="" 0x05e3="">at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
    ugen4.2.0: uhub5:</usb2.0></intel></ehci></intel></uhci></intel></uhci></intel></uhci></intel></uhci> 
    

    From Pfsense, iPhone connected:

    [2.0.1-RELEASE][admin@pfsense.strider.local]/root(8): usbconfig show_ifdrv
    ugen0.1: <uhci root="" hub="" intel=""> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen0.1.0: uhub0: <intel 1="" 9="" uhci="" root="" hub,="" class="" 0,="" rev="" 1.00="" 1.00,="" addr="">
    ugen1.1: <uhci root="" hub="" intel=""> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen1.1.0: uhub1: <intel 1="" 9="" uhci="" root="" hub,="" class="" 0,="" rev="" 1.00="" 1.00,="" addr="">
    ugen2.1: <uhci root="" hub="" intel=""> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen2.1.0: uhub2: <intel 1="" 9="" uhci="" root="" hub,="" class="" 0,="" rev="" 1.00="" 1.00,="" addr="">
    ugen3.1: <uhci root="" hub="" intel=""> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen3.1.0: uhub3: <intel 1="" 9="" uhci="" root="" hub,="" class="" 0,="" rev="" 1.00="" 1.00,="" addr="">
    ugen4.1: <ehci root="" hub="" intel=""> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
    ugen4.1.0: uhub4: <intel 1="" 9="" ehci="" root="" hub,="" class="" 0,="" rev="" 2.00="" 1.00,="" addr="">
    ugen4.2: <usb2.0 hub="" vendor="" 0x05e3=""> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
    ugen4.2.0: uhub5: <vendor 2="" 9="" 0x05e3="" usb2.0="" hub,="" class="" 0,="" rev="" 2.00="" 77.63,="" addr="">
    ugen4.3: <iphone vendor="" 0x05ac=""> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
    [2.0.1-RELEASE][admin@pfsense.strider.local]/root(9):</iphone></vendor></usb2.0></intel></ehci></intel></uhci></intel></uhci></intel></uhci></intel></uhci>
    


  • [quote]
    From Pfsense, iPhone connected:
    ugen4.3: <iphone vendor="" 0x05ac="">at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
    [2.0.1-RELEASE][admin@pfsense.strider.local]/root(9):
    [/quote]
    Unfortunately, this is incomplete - it shows the vendor code but not the device code. I found the ipheth driver after I requested the device codes. I suggest you try the driver with your phone then we work on getting more USB information about your iphone if it seems necessary.</iphone> 
    

Locked