# Tethering FreeBSD with Android



## Harry_the_rat (Jul 29, 2012)

Hi all, I've used FreeBSD in the past but struggled with mobile broadband, so I have mainly been using Linux. As anyone had experience with tethering FreeBSD with an Android phone, I've googled around but I haven't found a lot and wondered if FreeBSD supports it.

 Thanks...


----------



## SirDice (Jul 30, 2012)

It shouldn't be difficult but it does take a bit of fiddling. I've done it in the past. 

First you'll need to get a bluetooth connection using RFCOMM. You can then use the 'standard' PPP connection. Usually you need to dial a special phonenumber; *99#.

32.4 Bluetooth
Chapter 28 PPP and SLIP


----------



## Harry_the_rat (Jul 30, 2012)

Thanks for the reply SirDice, when I was using my Android to tether my Linux laptop I used a cable from my Phone to may laptop connected to usb. Which once connected created /dev/usb0, then I used dhcpcd to get an ip and was wondering if the would apply with FreeBSD.


----------



## SirDice (Jul 30, 2012)

I've done it with Bluetooth and a Nokia phone. I haven't tried it yet with my new Android phone though.

The idea would be the same. Instead of a Bluetooth connection, it'll be a (serial) USB connection. Setting up PPP should be the same.

I haven't done this as setting up a temporary Wifi hotspot with my Android phone was a lot easier to do.


----------



## Harry_the_rat (Aug 15, 2012)

I've just installed FreeBSD 9 and tried to plug in usb cable to attempt to tether. Here is some output.

lsub 
http://zlin.dk/p/?MWQwZWRl

dmesg 
http://zlin.dk/p/?MDZiZWNl

I'm not sure if FreeBSD is seeing my phone as a storage device, with linux it creates usb0. Whether I need to load a module manually, kldstat shows kernel and modem.ko modules loaded.


----------



## lme@ (Aug 15, 2012)

It should be very easy. On the phone you need to set the connection sharing method to "Mac OS X" (I don't know if "Windows" would also work) and then connect your phone to the notebook and share the connection.
On FreeBSD you should have a "ue0" network device then and just run `# dhclient ue0`.


----------



## Harry_the_rat (Aug 15, 2012)

Ime@, it doesn't create a device when the cable is plugged in and I can't find any option for sharing method with "Mac OS X" on my phone. I was wondering if I used a USB to Ethernet adapter, which would mean I would be plugging it into a physical device(fxp0)?
Then I could use dhclient, don't know if that would work until I figured this out.


----------



## lme@ (Aug 16, 2012)

Maybe you need to load the if_cdce kernel module first. Does `# kldstat -v | grep cdce` return anything? If not issuse `# kldload if_cdce` and plug in your phone.


----------



## Harry_the_rat (Aug 16, 2012)

Ime@ when i run
`kldstat -v | grep if_cdce`
I get "317 uhub/cdce", so i presume the module is already loaded?


----------



## lme@ (Aug 16, 2012)

Yes, it's loaded. Hmm, and I guess on your phone you chose to share your connection via USB?


----------



## Harry_the_rat (Aug 16, 2012)

Yes, i've chosen USB to tether on my phone. Here is the output from dmesg, I get nothing about ue0 but something of da0?

http://zlin.dk/p/?ZGZhMDFh


----------



## lme@ (Aug 17, 2012)

```
umodem0: <CDC Abstract Control Model ACM> on usbus1
umodem0: data interface 2, has no CM over data, has no break
```
But you have a umodem device.
Can you show the output of ifconfig(8)?


----------



## Harry_the_rat (Aug 17, 2012)

Here is the output of  "ifconfig -a" when my phone is plugged into USB.

http://zlin.dk/p/?YjI4NmUx


----------



## lme@ (Aug 17, 2012)

Hummm.... strange...
What Android phone do you have?


----------



## vermaden (Aug 17, 2012)

@Harry_the_rat

I am using it from time to time, with WiFi Hotspot from Android phone. FreeBSD works/connects to it as to any other Access Point. I haven't tried USB tethering thought.


----------



## lme@ (Aug 17, 2012)

The hotspot method should work, but it sucks a lot more of power of your phone's battery.


----------



## Harry_the_rat (Aug 17, 2012)

Ime@, I have Samsung Galaxy Y phone, I have also tried this on Vodafone 858 Smart this morning with same effect, which are both Android phones.
@vermaden, I haven't tried wifi yet with FreeBSD but have a few wireless cards to try. I'd prefer to use tethering with a cable though.


----------



## vermaden (Aug 17, 2012)

lme@ said:
			
		

> The hotspot method should work, but it sucks a lot more of power of your phone's battery.



Yup, its best to attach the phone to USB (for battery charging) for the time of WiFi Hotspot use


----------



## FBI_Guy (Mar 14, 2013)

Sorry if this thread is considered dead and I shouldn't be reviving it, but I'm having the same problem as described here. I'm wondering if anyone else knows anything about this and would be willing to give some advice.

Thank you.


----------



## mod3777 (Mar 25, 2019)

Use SYNCDHCP instead of DHCP


----------

