You are not logged in.
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.
[...]
eth0="dhcp"
INTERFACES=(eth0 )
[...]
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.
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
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
bump for the last time...
Offline
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
Changed title to "How to create a Network Access Point (NAP) with bluez in Arch Linux?"
Offline
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
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
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
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.
Offline
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
Offline
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
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
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
Actually I do - I hadn't noticed that. It may explain why my connections would drop after 10-15 minutes.
Offline
I don't know why, but I don't have bnep0 automatically created
Offline
sorry for reviving an old topic, I've been working on this today
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 ?
Last edited by stefanwilkens (2009-04-30 14:05:52)
Arch i686 on Phenom X4 | GTX760
Offline
managed to get things working
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
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
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
Thanks a whole lot for the indepth explanation, I'll give it a try!
Offline
Not following this thread anymore, since I'm not using my N800 anymore.
Offline