Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.


  Search this Thread
Old 09-22-2006, 07:08 AM   #1
Registered: May 2005
Distribution: redhat 9 , fedora 5,6,7,DSL,Debian 3, mandrake 9.2 , knoppix 3.8, red hat 7.3
Posts: 38

Rep: Reputation: 15
GPRS USB modem and Apache

Hello everyone,

i finally managed to connect to internet via usb gprs data modem. I use pppd with wvdial .
- It connects to gprs without any problem.

- I get my ip adress like 85.123.xx.xx
and pppd creates one remote and one local IP address
and i get a new one at any new connection.
Thats ok.

- I can browse the internet also without any errors.

The question is
I cannot connect from my other machine which is connected also to the internet via wifi.

Apache is running on my linux machine so i need to access my linux box thorough IP address :

in browser i type : 85.123.xx.xx i should get my web page from linux box.BUT I DONT GET MY PAGE ?

Also i cannot ping my gprs IP adress (85.123.xx.xx) from my other machine .

I can ping this gprs IP address from the linux box(locally)

Where is the problem ?

(note: the apache i working corretly it serves this page without problem via ethernet connection)
Old 09-25-2006, 12:55 AM   #2
LQ Newbie
Registered: Sep 2006
Posts: 5

Rep: Reputation: 0
I assume that you have your Bluetooth device up and running successfully. This can be any kind of Bluetooth transceiver.

You can check if Bluetooth is working try the following:

hciconfig -a

If you see output you have an USB device. If it says "DOWN" then the hcid is probably not running.

Now we will try to find the phone. Set your phone to be visible by everybody for now. Then execute hcitool, this should look somewhat similar to this:

[root@evilgenius ~]# hcitool scan
Scanning ...
00:E0:03:3E:4E:19 Nokia 6230 TN

This is good news. We found the phone. Now we are going to inquire the device and ask it for dialup networking (DUN). This will bring up the pairing process that you have to do once. If your system is configured well (like FC3) you will be asked for the communication PIN that you have to enter the same on the machine and on the phone.

[root@evilgenius ~]# sdptool search DUN
Inquiring ...
Searching for DUN on 00:E0:03:3E:4E:19 ...
Service Name: Dial-up networking
Service RecHandle: 0x10002
Service Class ID List:
"Dialup Networking" (0x1103)
"Generic Networking" (0x1201)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

Write down the channel you see. You will need it soon. You can now ping the device to see if communication is working:

[root@evilgenius ~]# l2ping 00:E0:03:3E:4E:19
Ping: 00:E0:03:3E:4E:19 from 00:20:E0:7A:15:6F (data size 20) ...
0 bytes from 00:E0:03:3E:4E:19 id 200 time 47.65ms
0 bytes from 00:E0:03:3E:4E:19 id 201 time 36.47ms
0 bytes from 00:E0:03:3E:4E:19 id 202 time 37.44ms
3 sent, 3 received, 0% loss

If that works your are fine. the GRPS connection later.

[root@evilgenius ~]# rfcomm bind 0 00:E0:03:3E:4E:19 1

The 1 at the very end of the line is the channel we noted earlier. You can verify the result with

[root@evilgenius ~]# rfcomm show
rfcomm0: 00:E0:03:3E:4E:19 channel 1 clean

Now you can use minicom or something similar to talk to the phone. Use /dev/rfcomm0 as the device (if you bound to 0 above) you talk to. With my phone 57600 bits/sec and 8-N-1 worked fine. Try typing "at[ENTER]" which should return "OK".

GPRS connection
First we try it the low-tech style. Try a serial minicom session like the following:


This should establish the GRPS connection. Note that you have to replace "" by whatever the access point name (GPRS) is for your service provider.

If this worked you are ready for a more formal way. I will describe this here for Fedora Core 3.

Nice way on Fedora Core 3
First edit /etc/wvdial.conf. Add two sections like the following:

Modem = /dev/rfcomm0
Baud = 57600
SetVolume = 0
Dial Command = ATDT
Init1 = ATE1
Init2 = AT+CGDCONT=1,"IP","","",0,0
FlowControl = CRTSCTS

[Dialer GPRS]
Phone = *99#
Stupid Mode = 1
Inherits = BluetoothMobile

Replace the APN appropriately as you did above. The number should be the same on all networks. The settings given are for a Nokia 6230 but should also apply to other mobiles.

Now we will create the PPP peers file /etc/ppp/peers/GPRS with the following content:

connect "/usr/bin/wvdial --remotename GPRS --chat 'GPRS'"

The name given here is the name from the dialer section above. Now we create the configuration file so that we can easily establish the connection. Create the file /etc/sysconfig/network-scripts/ifcfg-GPRS with the following content:


A little tweak is needed to get bluetooth and rfcomm started up when it is needed right before the device initialization. The init parameter of pppd cannot be used (pppd won't start if the devcice is not already present). So what we do is create the file /sbin/ifup-pre-local which gets executed before ifup-ppp. This script may look similar to this one:


case "$1" in
/etc/init.d/bluetooth start
/usr/bin/rfcomm bind 0 00:E0:03:3E:4E:19 1

This will do what we want. Replace the address and channel appropriately. Not that on some older versions it may be just "GPRS" instead of "ifcfg-GPRS". You can check this by outputting $1 into a file (add echo $1 > /tmp/GPRS for example).

Now you can establish the connection (the USERCTL=yes will allow you to do this as a normal user) as easy as

/sbin/ifup GPRS

works for me
Old 09-27-2006, 09:47 AM   #3
Registered: May 2005
Distribution: redhat 9 , fedora 5,6,7,DSL,Debian 3, mandrake 9.2 , knoppix 3.8, red hat 7.3
Posts: 38

Original Poster
Rep: Reputation: 15
i think you totally missed the topic here!!!!!!

the bluetooth is no mater here! the firewall on the mobile side is in question!
Old 10-01-2006, 10:48 PM   #4
LQ Newbie
Registered: Sep 2006
Posts: 5

Rep: Reputation: 0
ooops missd the topic

Last edited by anonymusneo; 10-01-2006 at 10:51 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Solomon GPRS USB modem tw7ug Linux - Hardware 1 01-23-2008 07:52 AM
Remote dialin using a ssh and a GPRS modem ? mjrich Linux - Networking 1 07-13-2005 04:06 PM
USB GPRS modem dongle for linux? wilho Linux - Wireless Networking 0 04-12-2005 01:23 AM
Using my Gprs motorola cell phone as a modem cwahoyes Linux - Networking 4 12-15-2004 03:02 AM
Anyone used a gprs modem under redhat paulb2244 Linux - Hardware 1 04-25-2004 06:31 PM > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 11:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration