Bluetooth network PAN

No replies
Joined: 2019/01/10

One day i was talking to my friend about a hacking with raspberry i wanted do, but i found a problem, how could i connect to raspberry ssh through bluetooth. At the first, i thought existed already app for this. But i discovered it's not so easy as i thought.

For make this connection, we need make a PAN(Personal Area Network) with Berry bluetooth.

So, lets go, baby.


First, we have make our Network Interface. This process is very simple, is just follow these following commands. If you are newbie in Linux, keep calm, i assure you these commands will not remove your HD. Or maybe will.

Our network interface will be named pan0.

pan0 -

$ brctl addbr pan0  
$ brctl setfd pan0 0
$ brctl stp pan0 off
$ ifconfig pan0 netmask

Or if you are lazy, you can copy this and paste in your "/etc/network/interfaces".

auto pan0
iface pan0 inet static
        bridge_ports none
        bridge_fd 0
        bridge_stp off

Now we've created our interface, we need two python scripts. - this will do the magic. -this will create the pin for the pairing.

The script have two mode, the client mode and the server mode. But we'll use only the server mode. The script will also the network interface. In this case, pan0.

I put "&" in the end because i don't wanna open a new terminal.

$ python2 server pan0 &

Now we'll start the our other script, blueagent5, it will do the pairing..

$ python2 --pin 6666 &

Maybe your mobile i'snt discovering the berry bluetooth. If this is happening, allow the discovery mode with this following command.

$ hciconfig hci0 pisca

hci0, in this case, is our bluetooth interface, if your is different, just change there.

Done, bitch! we finished. Now is just connect the network, with your mobile, and connect the Berry ssh.

In my case, i use the terminal emulator Termux in my mobile.


YEAH!! i'm connected to the network! Now, i'll try connect to the berry ssh.


Yeah, we got, throught the bluetooth, make a ssh connection to the our raspberry.

Some mobiles don't allow you connect to the wifi and bluetooth at same time.

Good byte. ... s/40579423