Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 278472 - [es] update: bluetooth-guide.xml (1.10) -> (1.11)
Summary: [es] update: bluetooth-guide.xml (1.10) -> (1.11)
Status: RESOLVED FIXED
Alias: None
Product: Doc Translations
Classification: Unclassified
Component: [ES] (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: John Christian Stoddart (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-20 14:07 UTC by Chema Alonso Josa (RETIRED)
Modified: 2009-07-28 14:47 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
bluetooth-guide.xml.patch (bluetooth-guide.xml.patch,7.25 KB, patch)
2009-07-20 14:08 UTC, Chema Alonso Josa (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chema Alonso Josa (RETIRED) gentoo-dev 2009-07-20 14:07:12 UTC
updated bluetooth guide, emergency fixes, bug 266690. we now no longer have a chapter on setting up a PAN, since nobody knows how the hell to do this.
Comment 1 Chema Alonso Josa (RETIRED) gentoo-dev 2009-07-20 14:08:05 UTC
Created attachment 198614 [details, diff]
bluetooth-guide.xml.patch
Comment 2 Denis Loginov 2009-07-20 23:30:01 UTC
(In reply to comment #0)
> updated bluetooth guide, emergency fixes, bug 266690. we now no longer have a
> chapter on setting up a PAN, since nobody knows how the hell to do this.
> 
Here's the guide from on how to easily set up PAN:
---------
The solution is quite simple: you have to 
    emerge net-misc/dhcp
After installation of dhcp, you just have to write a correct dhcpd.conf file. 
For example,
    #dhcpd.conf
    ddns-update-style none;
    authoritative;

    default-lease-time 600;
    max-lease-time 7200;

    subnet 192.168.3.0 netmask 255.255.255.0 {
        range 192.168.3.2 192.168.3.2; # ip which should be lent to clients (in my case 1 ip for 1 phone)
        option domain-name-servers 192.168.1.1; #your dns server(s) (see /etc/resolv.conf)
        option routers 192.168.3.1;
    }

Then just type
    ifconfig bnep0 192.168.3.1 ,
i.e. the ip of the access point installed on the current machine (a bluetooth dongle in my case).
At last, fire up the dhcp3-server:
    /etc/init.d/dhcpd start
In several seconds you should be able to
    ping 192.168.3.2
or whatever IPs you chose for you devices :)

To be able to access the Internet via another interface on the current machine (e.g. eth0), you can use iptables. Consult an according manual. In the simplest case you could use the following script:
    iptables -F
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    echo 1 > /proc/sys/net/ipv4/ip_forward
Now you should be able to access the Internet via computer on your mobile (provided you installed bluetooth profile as ISP on it :) ).
Comment 3 Chema Alonso Josa (RETIRED) gentoo-dev 2009-07-21 11:43:47 UTC
This bug is to update the Spanish bluetooth guide due to recent changes in the English one:

http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/bluetooth-guide.xml?rev=1.16&view=markup

If you have some ideas to write the PAN part of the guide, I think you should file a Documentation bug. 

Cheers!
Comment 4 Denis Loginov 2009-07-21 13:20:18 UTC
Sorry, I forgot to mention: this way only works when you want to set up PAN between your computer and a mobile phone. That's because you HAVE to query for connection from the phone, then the device bnep0 will appear on the computer. 

This works even without "old-daemons" USE flag for net-wireless/bluez.

Unfortunately, in case of PAN between two computers, I couldn't test it (don't have a second bluetooth dongle :)) But it seems you have to enable "old-daemons" and then use the guide from 
http://www.linuxquestions.org/questions/linux-networking-3/bluez-4.x-pan-access-point-on-gentoo-733183/

It seems the crucial point that prevented the author of that post from setting up PAN is that you SHOULD RUN DHCP SERVER. 

Comment 5 Denis Loginov 2009-07-21 14:25:14 UTC
(few additions to comments #2 & #4)
1) first and foremost before all settings you should enable page & inquiry scan on all devices, which under linux is now done by
    hciconfig hci0 piscan #etc. for hci1,2,...

2) Of course, to automate the configuration of the "master" device (which hands out IP addresses), you can
    ln -s /etc/init.d/net.lo /etc/init.d/net.bnep0 # or pan0 in case of two computers (?)
and add the following in /etc/conf.d/net :
    config_bnep0="192.168.3.1/24"
    postup(){
            if [ "${IFACE}" = "bnep0" ]; then
                /etc/init.d/dhcpd start 
            fi
    }
May be it's improper to start one init script from another, but works:). Of course, if you already use dhcp for another network, then you can just use rc-update add dhcpd ; but if you don't, then you can't add it to rc since it will fail when discovers that interface with the IP 192.168.3.1 (as in the primer) doesn't exist.

3) for those who want to connect to computers this way, apart from the way discribed on linuxquestions (see above), i.e. 
    hciconfig hci0 lm master,accept
    hciconfig hci1 lm slave,accept
    ...
    ifconfig  pan0 192.168.3.1 netmask 255.255.255.0 up
    /etc/init.d/dhpcd start
    ifconfig pan1 up
    ...
you can also try the old pand-way (with USE="old-daemons")
    pand -s -M -r NAP # on the "master" device
    pand -c MA:ST:ER:AD:DR:ES -d NAP -n
Comment 6 Denis Loginov 2009-07-21 14:48:30 UTC
And last, but may be not least:) is that before the connection you should pair the devices. The current version (as of bluez-4.x) of pairing agent is 
   simple-agent
Comment 7 Chema Alonso Josa (RETIRED) gentoo-dev 2009-07-21 15:55:15 UTC
(In reply to comment #6)
> And last, but may be not least:) is that before the connection you should pair
> the devices. The current version (as of bluez-4.x) of pairing agent is 
>    simple-agent
> 

Please, read comment #3.
Comment 8 Mirko Ebbers 2009-07-27 11:27:11 UTC
I have written an article on http://en.gentoo-wiki.com/wiki/Set_up_a_bluetooth_NAP to at least cover the NAP (Server) part. I took me a whole weekend to figure out, so I hope this will save you some time.
Comment 9 Denis Loginov 2009-07-27 11:46:47 UTC
(In reply to comment #8)
Thank you. Please, consider the "Edit:" part, which describes a much simpler way to do pairing.
An alternative way to connect the phone to the Internet is to avoid using a bridge and instead to use iptables.
Comment 10 John Christian Stoddart (RETIRED) gentoo-dev 2009-07-28 14:47:01 UTC
Listo, gracias Chema/nimiux.