You are not logged in.

#1 2008-09-06 20:44:07

leonardof
Member
Registered: 2008-09-05
Posts: 66

How to create a Network Access Point (NAP) with bluez in Arch Linux?

I'm trying to share my deskop computer's internet connection with a handheld; both have their bluetooth device. My desktop computer is running Arch Linux, with bluez-utils and dependencies installed. It reaches the internet with dhcpcd running as a client of a cable "modem". I searched the web, and found some suggestions about bridge-utils or iptables, but none was easy to apply to Arch Linux.

/etc/rc.conf wrote:

[...]
eth0="dhcp"
INTERFACES=(eth0 )
[...]

/etc/conf.d/bluetooth wrote:

PAND_ENABLE="true"
PAND_OPTIONS="--listen --role NAP --master"

/etc/bluetooth/network.conf if empty.

I also had to hack /etc/rc.d/bluetooth following this suggestion in archlinux's bugtracker, so that pand waits for sdpd to be launched.

Currently the output of "ifconfig" does not report any pan0, pan1 or bnep0 device; and my handheld can not find the NAP.

/var/log/everything.log wrote:

Sep  6 17:35:19 jota hcid[5843]: Bluetooth HCI daemon
Sep  6 17:35:19 jota hcid[5843]: Parsing /etc/bluetooth/main.conf failed: No such file or directory
Sep  6 17:35:19 jota hcid[5843]: HCI dev 0 registered
Sep  6 17:35:19 jota hcid[5843]: HCI dev 0 already up
Sep  6 17:35:19 jota hcid[5843]: Device hci0 has been added
Sep  6 17:35:19 jota hcid[5843]: Starting security manager 0
Sep  6 17:35:19 jota hcid[5843]: Device hci0 has been activated
Sep  6 17:35:19 jota hcid[5843]: Starting SDP server
Sep  6 17:35:19 jota hcid[5843]: Parsing /etc/bluetooth/input.conf failed: No such file or directory
Sep  6 17:35:19 jota hcid[5843]: Registered input manager path:/org/bluez/input
Sep  6 17:35:19 jota hcid[5843]: Unix socket created: 14
Sep  6 17:35:19 jota pan0: Dropping NETIF_F_UFO since no NETIF_F_HW_CSUM feature.
Sep  6 17:35:19 jota hcid[5843]: Registered manager path:/org/bluez/audio
Sep  6 17:35:19 jota hcid[5843]: Registered manager path:/org/bluez/serial
Sep  6 17:35:19 jota hcid[5843]: bridge pan0 created
Sep  6 17:35:19 jota hcid[5843]: Registered manager path:/org/bluez/network
Sep  6 17:35:19 jota hcid[5843]: Registered server path:/org/bluez/network/nap
Sep  6 17:35:19 jota hcid[5843]: Registered server path:/org/bluez/network/gn
Sep  6 17:35:19 jota hcid[5843]: Registered server path:/org/bluez/network/panu
Sep  6 17:35:19 jota hcid[5843]: Default passkey agent (:1.8, /org/bluez/passkey) registered
Sep  6 17:35:19 jota hcid[5843]: Default authorization agent (:1.8, /org/bluez/auth) registered
Sep  6 17:35:19 jota dhcpcd[5060]: pan0: sendto: Network is down
Sep  6 17:35:20 jota pand[5857]: Bluetooth PAN daemon version 3.32
Sep  6 17:35:20 jota pand[5857]: Bind failed. Address already in use(98)

How do I fix my Network Access Point? Thanks in advance!

Last edited by leonardof (2008-09-30 10:24:35)

Offline

#2 2008-09-12 00:02:43

leonardof
Member
Registered: 2008-09-05
Posts: 66

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

66 views so far, and no answer. Changing title from "How do I create a Network Access Point (NAP) with bluez?" to "pand: Bind failed. Address already in use(98)".

Offline

#3 2008-09-25 04:17:57

leonardof
Member
Registered: 2008-09-05
Posts: 66

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

bump for the last time...

Offline

#4 2008-09-30 03:09:21

leonardof
Member
Registered: 2008-09-05
Posts: 66

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

This post is the top Google result if you search for the error message. Maybe we should solve it, shouldn't we?

These pages have very different approaches, and I can't get either to work:
http://www.osnews.com/story/9836
http://bluez.sourceforge.net/contrib/HOWTO-PAN

Offline

#5 2008-09-30 10:25:18

leonardof
Member
Registered: 2008-09-05
Posts: 66

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

Changed title to "How to create a Network Access Point (NAP) with bluez in Arch Linux?"

Offline

#6 2008-10-01 01:24:24

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

not sure if this helps but maybe it has something to do with masquerading and iptables? In a setup with two nic's you would need to route packets from one to the other to share an internet connection. Maybe the same applies in your case?

Offline

#7 2008-10-01 02:46:25

leonardof
Member
Registered: 2008-09-05
Posts: 66

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

Probably. The BlueZ HOW-TO says that in an NAP, pand "acts as proxy, router or bridge". And the OSNews article mentions using iptables (and uses DUN instead of NAP). Honestly, I'd need simpler instructions. I'm almost buying a (probably) needless WiFi router to let me use my N800 to browse the Web and connect to my computer.

Offline

#8 2008-10-02 01:28:49

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

leonardof wrote:

Currently the output of "ifconfig" does not report any pan0, pan1 or bnep0 device; and my handheld can not find the NAP.

Maybe pan0 needs to be in rc.conf as an interface eg eth1.
Also try having a fiddle around with firestarter (frontend to iptables). Might be a little easier to configure.

Last edited by my0pic (2008-10-02 01:36:38)

Offline

#9 2008-10-02 01:40:07

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

Just had a look at the Gentoo wiki on bluetooth http://www.gentoo.org/doc/en/bluetooth-guide.xml. The section towards the end entitled "Setting up a Personal Area Network (PAN)" is well detailed in how to set it up. Hope that helps. smile

Offline

#10 2008-10-25 16:25:38

albinoloverats
Member
From: London
Registered: 2007-12-18
Posts: 29
Website

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

I've just setup a bluetooth network between my desktop and laptop. All I changed in the /etc/bluetooth/hcid.conf was the passkey so that both machines were the same.

Then all I did was run
pand --listen --role NAP --master

on my desktop so it would act as the server, and then
pand --connect [H/W ID] --service NAP
Once both machines were happily connected bnep0 was available as a network device.

Desktop:
ifconfig bnep0 192.168.2.1

Laptop:
ifconfig bnep0 192.168.2.2
route add default gw 192.168.2.1

This mostly works for me - the connection randomly drops and I'm yet to find out why tongue

Offline

#11 2008-10-25 22:26:10

leonardof
Member
Registered: 2008-09-05
Posts: 66

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

Thank you, albinoloverats! (Funny name, by the way.) Were you able to make the desktop part work with a single "/etc/rc.d/bluetooth start" or something like that?

By the way, when you say the "bnep0" device was available after the connection, do you mean after the pairing?

Last edited by leonardof (2008-10-25 22:44:44)

Offline

#12 2008-10-26 11:41:43

albinoloverats
Member
From: London
Registered: 2007-12-18
Posts: 29
Website

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

Yes, on both machines start bluetooth with /etc/rc.d/bluetooth start. Then once you've run pand on each machine the bnep0 device becomes available. It seems that both bluetooth device have to be connected to each other before you can create a usable network between them.

Offline

#13 2008-10-26 13:28:32

leonardof
Member
Registered: 2008-09-05
Posts: 66

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

If you start the bluetooth daemon, then run pand, don't you get the "Bind failed. Address already in use(98)" error in /var/log/everything.log?

Offline

#14 2008-10-26 16:37:52

albinoloverats
Member
From: London
Registered: 2007-12-18
Posts: 29
Website

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

Actually I do - I hadn't noticed that. It may explain why my connections would drop after 10-15 minutes.

Offline

#15 2008-10-26 16:51:01

leonardof
Member
Registered: 2008-09-05
Posts: 66

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

I don't know why, but I don't have bnep0 automatically created

Offline

#16 2009-04-29 18:56:06

stefanwilkens
Member
From: Enschede, the Netherlands
Registered: 2008-12-10
Posts: 624

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

sorry for reviving an old topic, I've been working on this today smile

I've managed to:
* Set-up bluez on the PC
* Setup-up NAP on the PC
* Connect to the NAP from my IPAQ
* Ping the IPAQ from the PC

so the network is working. pan0 /bnep0 is created as soon as I pair, it's all very nice.

However, I seem to be unable to share the internet connection over pan0 and have exactly 0 clue how to go about this. Does anybody have a good place to start smile?

Last edited by stefanwilkens (2009-04-30 14:05:52)


Arch i686 on Phenom X4 | GTX760

Offline

#17 2009-04-30 18:37:44

stefanwilkens
Member
From: Enschede, the Netherlands
Registered: 2008-12-10
Posts: 624

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

managed to get things working big_smile

the magic is in forwarding through IPTables:
http://lindesk.com/2007/04/internet-con … -iptables/

Note that this is assuming you have a working network between the PDA and the NAP server running on your system with the internet connection.


Arch i686 on Phenom X4 | GTX760

Offline

#18 2013-01-26 21:48:49

doragasu
Member
Registered: 2012-03-03
Posts: 152

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

I'm resurrecting this ancient post, since I have the same problem. I have an Arch computer I want to set as an AP. Then  I want to connect to it using a hacked Parrot DF3120 picture frame. Unfortunately, I cannot get it to work. This is what I try:

1.- With Bluetooth working on my Arch machine (dbus and bluetooth services are running), I try to start the access point:

$ pand --listen --role NAP --master

2.- Then on the photo frame, I try to connect to the AP

$ pand --connect [AP_BT_ADDR] --service NAP

I don't know if at this point, the AP or the photo frame should show some kind of connect/error message, but they both show nothing. Both pand commands return silently, but ifconfig shows no pan0/bnep0 interface is created.

I'm suspecting this might be because the photo frame requires the AP to disable PIN authentication, and unfortunately, I can't find how to do it in Arch. Google searches return instructions that do not suit Arch config files.

Any suggestions?

Offline

#19 2013-01-28 10:01:07

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

I use PPP over an encrypted DUN connection to provide an Internet connection to my N900

BlueTooth PAN networks can not be encrypted, so that is why I don't see it as an option.

Warning, you will need a weekend to get this working. BlueTooth is super cool but it is kind of finicky, and you will need to spend some real time learning how it all works to debug it.

First you will need the MAC addresses of both your laptop's and N800's bluetooth device. You will also need to setup all the iptables stuff to NAT for your N800.

Then on the Arch Box PPPD Server edit this file to include these two lines.

/etc/conf.d/bluetooth

...
DUND_ENABLE="true"
...
DUND_OPTIONS="--listen --channel 1 --persist -A -E -S -i AA:BB:CC:11:22:33 --pppd /usr/sbin/pppd call dun"
...

Next you need to install and setup PPPD on your Archlinux box.
Replace all of the ip-down, ip-up, ipv6-down, and ipv6-up scripts with empty scripts that do nothing.

Then here are my PPP config files...

PPPD server
/etc/ppp/peers/dun

/dev/rfcomm0
115200
10.1.3.254:10.1.3.253
ipcp-accept-remote
linkname n900
-detach
crtscts
local
lock
noipdefault
ktune
noauth
nodefaultroute
noipx
novj
novjccomp
noaccomp
nobsdcomp
nodeflate
ms-dns 8.8.8.8
netmask 255.255.255.0
idle 0

PPP Client
/etc/ppp/peers/dun

/dev/rfcomm0
115200
crtscts
noipdefault
linkname crosstalk
lcp-echo-failure 0
lcp-echo-interval 0
ipcp-accept-local
ipcp-accept-remote
10.1.3.253:10.1.3.254
netmask 255.255.255.0
-detach
ktune
noauth
lock
local
defaultroute
noipx
novj
novjccomp
noaccomp
nobsdcomp
nodeflate
ms-dns 8.8.8.8
idle 0

Now these are the scripts I run on my N900 to connect to my Arch Laptop...
Owe, and yes you need to install PPPD on your N800 as well as your Arch Box

/usr/local/bin/dunup

exec dund -c 11:22:33:AA:BB:CC call dun

/usr/local/bin/dundown

exec killall -HUP pppd

Last edited by hunterthomson (2013-01-28 10:03:47)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#20 2013-01-28 10:42:33

doragasu
Member
Registered: 2012-03-03
Posts: 152

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

Thanks a whole lot for the indepth explanation, I'll give it a try!

Offline

#21 2013-03-09 21:21:49

leonardof
Member
Registered: 2008-09-05
Posts: 66

Re: How to create a Network Access Point (NAP) with bluez in Arch Linux?

Not following this thread anymore, since I'm not using my N800 anymore.

Offline

Board footer

Powered by FluxBB