Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-users] PAN and DHCP
@ 2005-09-24  7:20 liang liping
  2005-09-25 10:30 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: liang liping @ 2005-09-24  7:20 UTC (permalink / raw)
  To: bluez-users

Hi

I have three usb adapters and three linux pc.
Now one pc is a pan server, the other two are clients.

At the server side I allocate ip with a DHCP server.
using the following command to start pan server:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
sdpd
pand -s -M --role=3DNAP -n

echo '1' > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i bnep0 -j ACCEPT
iptables -A FORWARD -i bnep1 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
and the /etc/bluetooth/pan/dev-up file is:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
#!/bin/sh
echo "dev-up working ,interface is $1!!!"
ifconfig $1 10.0.0.1

/etc/init.d/dhcp3-server restart 2>&1 > /dev/null
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
restart the DHCP server when a bnep interface is created.


and at the two client sides using the following command to start
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
sdpd
pand --role PANU --search --persist -n
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
and the /etc/bluetooth/pan/dev-up file is
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
#!/bin/sh
dhclient bnep0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D

/etc/dhcpd.conf is
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
subnet 10.0.0.0 netmask 255.255.255.0 {
=09option routers 10.0.0.1;
=09option subnet-mask 255.255.255.0;

=09option domain-name "example.com";
=09option domain-name-servers 202.112.17.33;

=09option time-offset -18000; # Eastern Standard Time

=09range 10.0.0.3 10.0.0.100;
}

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D

the question is two client can get their ip address for the DHCP server
but only the first one connected to the servercan ping the server, the
later one can not.
I don't know why?
I try to modify the /etc/bluetooth/pan/dev-up at the server side
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
#!/bin/sh
echo "dev-up working ,interface is $1!!!"
ifconfig bnep0 10.0.0.1
ifconfig bnep1 10.0.0.2

/etc/init.d/dhcp3-server restart 2>&1 > /dev/null
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
the result is the same.
How can I get multi pan client online?
thank you !


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

* Re: [Bluez-users] PAN and DHCP
  2005-09-24  7:20 [Bluez-users] PAN and DHCP liang liping
@ 2005-09-25 10:30 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2005-09-25 10:30 UTC (permalink / raw)
  To: bluez-users

Hi,

> I have three usb adapters and three linux pc.
> Now one pc is a pan server, the other two are clients.
> 
> At the server side I allocate ip with a DHCP server.
> using the following command to start pan server:
> =============================
> sdpd
> pand -s -M --role=NAP -n
> 
> echo '1' > /proc/sys/net/ipv4/ip_forward
> 
> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
> iptables -A FORWARD -i bnep0 -j ACCEPT
> iptables -A FORWARD -i bnep1 -j ACCEPT
> iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
> =============================
> and the /etc/bluetooth/pan/dev-up file is:
> =============================
> #!/bin/sh
> echo "dev-up working ,interface is $1!!!"
> ifconfig $1 10.0.0.1
> 
> /etc/init.d/dhcp3-server restart 2>&1 > /dev/null
> =============================
> restart the DHCP server when a bnep interface is created.
> 
> 
> and at the two client sides using the following command to start
> =============================
> sdpd
> pand --role PANU --search --persist -n
> =============================
> and the /etc/bluetooth/pan/dev-up file is
> =============================
> #!/bin/sh
> dhclient bnep0
> =============================
> 
> /etc/dhcpd.conf is
> =============================
> subnet 10.0.0.0 netmask 255.255.255.0 {
> 	option routers 10.0.0.1;
> 	option subnet-mask 255.255.255.0;
> 
> 	option domain-name "example.com";
> 	option domain-name-servers 202.112.17.33;
> 
> 	option time-offset -18000; # Eastern Standard Time
> 
> 	range 10.0.0.3 10.0.0.100;
> }
> 
> =============================
> 
> the question is two client can get their ip address for the DHCP server
> but only the first one connected to the servercan ping the server, the
> later one can not.
> I don't know why?
> I try to modify the /etc/bluetooth/pan/dev-up at the server side
> =============================
> #!/bin/sh
> echo "dev-up working ,interface is $1!!!"
> ifconfig bnep0 10.0.0.1
> ifconfig bnep1 10.0.0.2
> 
> /etc/init.d/dhcp3-server restart 2>&1 > /dev/null
> =============================
> the result is the same.
> How can I get multi pan client online?

use a bridge over the bnepX devices.

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

end of thread, other threads:[~2005-09-25 10:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-24  7:20 [Bluez-users] PAN and DHCP liang liping
2005-09-25 10:30 ` Marcel Holtmann

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