Re: DUND pre-pppd script

Aras Vaichas <[email protected]> Wed, 04 Jun 2008 17:08:31 +1000
Newsgroups gmane.linux.bluez.user
Message-ID <[email protected]>
Brad Midgley wrote:
> Aras
>
>   
>> I need to determine my ppp IP address pair before I run pppd.
>>     
>
> I ran into this when setting up a bluetooth AP for use with a couple
> of nokia devices. They are using dun not pan, and I wanted to assign
> different addresses to each device. I had to hardcode the ip addresses
> in the nokias' dialup config which wasn't very satisfying.
>
>   

Thanks for the replies and ideas. What I've done is this:

#!/bin/sh
IP_PAIR=`safeip -p`
pppd $1 $2 ${IP_PAIR} $3 $4 $5 $6 $7 $8 $9


safeip is a Python script I wrote which finds a private subnet of size 2
that is not in use anywhere on the system. Option -p returns the data
like so: IP1:IP2

I just pass this IP pair on to pppd as well as all the other information
that dund passes on from itself and the /etc/default/bluetooth file.

Works quite well regardless of the state of (almost) any other possible
network configuration. I can also connect from multiple devices and it
just dishes out a new IP pair every time.

my /etc/default/bluetooth file has:
DUND_OPTIONS="--listen --persist --channel 3 --msdun --pppd pppd_pre.sh
crtscts 115200 ms-dns 10.0.0.1

I haven't fixed the ms-dns entry yet, but that is easily done

Aras

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php