public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-users] automatic bnep0 configuration
@ 2004-09-22 22:12 Christoph Torens
  2004-09-22 22:38 ` Pavel Ruzicka
  2004-09-23  2:37 ` Alberto Garcia Hierro
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Torens @ 2004-09-22 22:12 UTC (permalink / raw)
  To: bluez-users

Hello List,

I wonder if there is a way to automatically set up and
configure the bnep0 device that comes into existing after
a pand connection was set up. At the moment I create the
connection and do 'ifconfig bnep0 10.10.0.5'.
But when setting up something like a server you normally
can't do this ifconfig by hand.

I tried to configure this with /etc/network/interfaces
but that didn't help. I also tried to set 'auto bnep0'
but this only works at boot time, when the device is
not there yet.
What's the trick?

By the way: thanks for all the previous help, already :-)

-- 
Regards,
Christoph


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bluez-users] automatic bnep0 configuration
  2004-09-22 22:12 [Bluez-users] automatic bnep0 configuration Christoph Torens
@ 2004-09-22 22:38 ` Pavel Ruzicka
  2004-09-23  2:37 ` Alberto Garcia Hierro
  1 sibling, 0 replies; 4+ messages in thread
From: Pavel Ruzicka @ 2004-09-22 22:38 UTC (permalink / raw)
  To: bluez-users; +Cc: Christoph Torens

Hello,

> I tried to configure this with /etc/network/interfaces
> but that didn't help. I also tried to set 'auto bnep0'
> but this only works at boot time, when the device is
> not there yet.
> What's the trick?

This is done automatically by hotplug feature in kernel. I was problems, that
hotplug scripts was for kernel 2.4 and they doesn't correctly work with 2.6
kernel.

I have enabled "DEBUG=yes export DEBUG"
in /etc/hotplug.d/default/default.hotplug in Mandrake10.0 distribution.

Look at mailing list archive, because this was here discussed before
few months.

Best regards,

Pavel Ruzicka


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bluez-users] automatic bnep0 configuration
  2004-09-22 22:12 [Bluez-users] automatic bnep0 configuration Christoph Torens
  2004-09-22 22:38 ` Pavel Ruzicka
@ 2004-09-23  2:37 ` Alberto Garcia Hierro
       [not found]   ` <41528C5F.70508@c-s.fr>
  1 sibling, 1 reply; 4+ messages in thread
From: Alberto Garcia Hierro @ 2004-09-23  2:37 UTC (permalink / raw)
  To: bluez-users

[-- Attachment #1: Type: text/plain, Size: 2264 bytes --]

El Jueves, 23 de Septiembre de 2004 00:12, Christoph Torens escribió:
> Hello List,
>
> I wonder if there is a way to automatically set up and
> configure the bnep0 device that comes into existing after
> a pand connection was set up. At the moment I create the
> connection and do 'ifconfig bnep0 10.10.0.5'.
> But when setting up something like a server you normally
> can't do this ifconfig by hand.
>
> I tried to configure this with /etc/network/interfaces
> but that didn't help. I also tried to set 'auto bnep0'
> but this only works at boot time, when the device is
> not there yet.
> What's the trick?
>
> By the way: thanks for all the previous help, already :-)

 When a pand connection is established, /etc/bluetooth/pan/dev-up is executed, 
passing args "interface baddr" (for example /etc/bluetooth/pan/dev-up bnep0 
00:10:60:A2:3A:0B) . These are the scripts I use, you may find them usefull. 
On the client side:

fiam@americana 100% ~ $ cat /etc/bluetooth/pan/dev-up
#!/bin/bash

if [ "$2" = "00:10:60:A2:3A:0B" ]
then
        ifconfig $1 192.168.3.2
        if ! ifconfig | egrep "eth0|wlan0"
        then
                route add default gw 192.168.3.1
        fi
else
        mesg y
        echo "Pand connection to $2" | write fiam
        mesg n
fi

And on the server side:


fiam@ignition fiam $ cat /etc/bluetooth/pan/dev-up
#!/bin/bash

PAN_IFACE=pan0

if [ -z "$1" ]
then
        exit 1
fi

if ! ifconfig -a |grep ${PAN_IFACE} &> /dev/null
then
        brctl addbr ${PAN_IFACE}
        brctl setfd ${PAN_IFACE} 0
        brctl stp ${PAN_IFACE} disable
        ifconfig ${PAN_IFACE} 192.168.3.1
fi

if ! iptables -t nat -L -v | \
egrep "REDIRECT( )*tcp( )*--( )*${PAN_IFACE}
( )*any( )*anywhere( )*!192.168.232.0/24
( )*tcp( )*dpt:www( )*redir( )*ports( )*3128"
then
        iptables -t nat -A PREROUTING -i ${PAN_IFACE} -p tcp -d ! 
192.168.3.0/24 --dport 80 -j REDIRECT --to-port 3128
fi

brctl addif ${PAN_IFACE} $1
ifconfig $1 0.0.0.0

 Sorry for the ausence of comments, but I wrote these scripts yesterday and I 
hadn't time to comment them. If you need further explanations, just ask :)

Regards,
 Alberto

-- 
/* Alberto García Hierro (Skyhusker) */

[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bluez-users] automatic bnep0 configuration
       [not found]     ` <200409231444.27391.tcpdevil@linuxlover.org>
@ 2004-09-23 13:44       ` GUILLON Gabriel
  0 siblings, 0 replies; 4+ messages in thread
From: GUILLON Gabriel @ 2004-09-23 13:44 UTC (permalink / raw)
  To: bluez-users

Okay, sorry: wrong mail client configuration :)


Alberto Garcia Hierro a =E9crit :
> El Jueves, 23 de Septiembre de 2004 10:42, escribi=F3:
>=20
---- beginning of my answer
>>There is some pand howto, on the net. Basically, you should use bridgin=
g
>>so that all the peer to peer connections seem to come from the same
>>interface.

---- end of my answer

>=20
>=20
>  Please, reply to the list, not to me. I'm not the person who asked for=
 help.
>=20
> Regards,
>  Alberto
>=20

--=20
"http://www.gnu.org/philosophy/no-word-attachments.fr.html"

Gab

"Il faut agir en homme de pensee et
penser en homme d'action."
- Henri Bergson -


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-23 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-22 22:12 [Bluez-users] automatic bnep0 configuration Christoph Torens
2004-09-22 22:38 ` Pavel Ruzicka
2004-09-23  2:37 ` Alberto Garcia Hierro
     [not found]   ` <41528C5F.70508@c-s.fr>
     [not found]     ` <200409231444.27391.tcpdevil@linuxlover.org>
2004-09-23 13:44       ` GUILLON Gabriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox