informatique:nix:linux:linux_reseau:utiliser_un_blackberry_en_mode_modem

On installe les softs quivontbien :

:!: Dans /etc/apt/sources.list décommenter les lignes contenant universe et un petit apt-get update.

sudo apt-get install barry-util

On vérifie que le BlackBerry est bien reconnu :

:!: Il faut également désactiver le password du téléphone, je n'ai pas encore trouvé la commande magique pour le passer dans les fichiers de conf.
:!: Lorsqu'on branche le tél, pas besoin de chosir quoique ce soit (synchro, usb ou charger).

ben@ben-Dell-DXP061:~$ btool -l
Blackberry devices found:
Device ID: 0x16f5a50. PIN: XXXXXXXX, Description: RIM BlackBerry Device

On créé les 2 fichiers de conf nécessaires (fonctionne pour free et orange), pour SFR, voir ici :

/etc/ppp/peers/barry-free

  • Pour orange, mettre orange comme user/password
  • Pour free, copier le fichier tel quel
#
# Some of these options found documented at:
#    http://wiki.colar.net/tethering_with_blackberry_pearl_on_linux
#
# Others are based on the peer file in XmBlackBerry
#
# Please send all working peer files to cdfrey@foursquare.net, so we can
# build a library of peer files for different carriers.
#

connect "/usr/sbin/chat -f /etc/chatscripts/barry-free.chat"

#
# authentication options - no need for ISP to authenticate to us, but
#                          we may need a login here: user/password/name
#
noauth
#user orange
#password orange
#name wapuser

#
# handle the default route and DNS
#
#nodefaultroute
defaultroute
usepeerdns

#
# disable unsupported options
#
noipdefault
nodetach
#novj
nodeflate
nobsdcomp
noaccomp
#default-asyncmap
nocrtscts
nopcomp
nomagic

passive

#nomultilink
ipcp-restart 7
ipcp-accept-local
ipcp-accept-remote
# need lcp-echo turned off, at least for tmobile, otherwise c0onnectin
# disconnects after few mn of inactivity.
# thanks to loon for this info
lcp-echo-interval 0
lcp-echo-failure 999


#
# limit size of packets
#
mtu 1492

#
# operate in debug mode
#
debug
#debug debug debug

#
# call pppob for the USB link
#
pty "/usr/sbin/pppob"


#
# unused options
#

#modem
## refused anyway, no point in trying every time
#novj

/etc/chatscripts/barry-free.chat

  • Pour orange mettre orange.fr à la place de free.
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED ABORT ERROR
OK 'AT+CGDCONT=1,"IP","free"'
OK 'ATDT*99#'

Lors de mes tests j'ai déconnecté toutes les autres connexions (filaires et wifi). A partir de la tout est OK, on lance la commande magique :

sudo pppd call barry-free

Ce qui donne :

ben@ben-Dell-DXP061:~$ sudo pppd call barry-free
Script /usr/sbin/chat -f /etc/chatscripts/barry-free.chat finished (pid 643), status = 0x0
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/pts/0
sent [LCP ConfReq id=0x1 <asyncmap 0x0>]
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth pap>]
sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth pap>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0>]
sent [PAP AuthReq id=0x1 user="ben-Dell-DXP061" password=<hidden>]
rcvd [PAP AuthAck id=0x1]
PAP authentication succeeded
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfReq id=0x1 <addr 169.254.1.1>]
sent [IPCP ConfAck id=0x1 <addr 169.254.1.1>]
rcvd [IPCP ConfNak id=0x1 <compress VJ 0f 01> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfNak id=0x2 <compress VJ 0f 01> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
<---snip---snip---snip---snip---snip---snip---snip---snip---snip---snip---snip---snip---snip---snip---snip---snip--->
Received bad configure-nak:  02 06 00 2d 0f 01 81 06 00 00 00 00 83 06 00 00 00 00
sent [IPCP ConfReq id=0x64 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfRej id=0x64 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x65 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfNak id=0x65 <addr 10.104.22.57> <ms-dns1 212.27.40.240> <ms-dns2 212.27.40.241>]
sent [IPCP ConfReq id=0x66 <addr 10.104.22.57> <ms-dns1 212.27.40.240> <ms-dns2 212.27.40.241>]
rcvd [IPCP ConfAck id=0x66 <addr 10.104.22.57> <ms-dns1 212.27.40.240> <ms-dns2 212.27.40.241>]
local  IP address 10.104.22.57
remote IP address 169.254.1.1
primary   DNS address 212.27.40.240
secondary DNS address 212.27.40.241
Script /etc/ppp/ip-up started (pid 661)
Script /etc/ppp/ip-up finished (pid 661), status = 0x0

Et enfin les sempiternelles commandes réseau :

ben@ben-Dell-DXP061:~$ ifconfig ppp0
ppp0      Link encap:Protocole Point-à-Point  
          inet adr:10.104.22.57  P-t-P:169.254.1.1  Masque:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          Packets reçus:402 erreurs:1 :0 overruns:0 frame:0
          TX packets:452 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:3 
          Octets reçus:79229 (79.2 KB) Octets transmis:108522 (108.5 KB)
ben@ben-Dell-DXP061:~$ netstat -rn
Table de routage IP du noyau
Destination     Passerelle      Genmask         Indic   MSS Fenêtre irtt Iface
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 ppp0
169.254.1.1     0.0.0.0         255.255.255.255 UH        0 0          0 ppp0

Pour arrêter la connexion quoi de mieux qu'un bon CTRL-C qui tâche ? Par la suite il faut killer le process pppob qui tourne toujours (ou alors j'ai pas été assez patient) :

ben@ben-Dell-DXP061:~$ ps aux |grep pppob
root       644  1.8  0.0  29208  1832 ?        Rl   21:21   0:08 /usr/sbin/pppob
ben@ben-Dell-DXP061:~$ sudo kill -9 644
  • informatique/nix/linux/linux_reseau/utiliser_un_blackberry_en_mode_modem.txt
  • Dernière modification : 2012/01/16 23:46
  • de 127.0.0.1