Hari
2007-09-26 05:19:55 UTC
Hi all,
I am trying to connect gprs over a mobile phone using linux. The pppd
version I am using is 2.4.4.
The service provider which I am using need chap authentication and so
I included require-chap in gprs script. The other modifications I did
is adding the following line in the chap-secrets
------------------
"<user name>" * "<password>" *
------------------
When I try start pppd, the following messages are printed and it
fails.
----------------------------------------------------
Press CTRL-C to close the connection at any stage!
defining PDP context...
AT
OK
ATH
OK
ATE1
OK
AT+CGDCONT=1, "IP","net","",0,0
OK
waiting for connect...
ATD*99***1#
CONNECT
Connected.
If the following ppp negotiations fail,
try restarting the phone.
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB2
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <auth chap MD5> <magic
0xc9622e1f> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <auth chap MD5> <magic
0x786b80b1> <pcomp> <accomp>]
sent [LCP ConfAck id=0x2 <asyncmap 0x0> <auth chap MD5> <magic
0x786b80b1> <pcomp> <accomp>]
rcvd [LCP ConfRej id=0x1 <auth chap MD5>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0> <magic 0xc9622e1f> <pcomp>
<accomp>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0> <magic 0xc9622e1f> <pcomp>
<accomp>]
peer refused to authenticate: terminating link
sent [LCP TermReq id=0x3 "peer refused to authenticate"]
rcvd [LCP DiscReq id=0x3 magic=0x786b80b1]
rcvd [CHAP Challenge id=0x1 <c0db5e9c746aad17d0f1277a56cd74d4>, name =
"UMTS_CHAP_SRVR"]
Discarded non-LCP packet when LCP not open
ff 3 c0 21 6 3 0 4
rcvd [LCP TermAck id=0x3]
Connection terminated.
-----------------------------------------------------------------
I am able to use same username and password in windows and able to
connect.
In the dump I am able to see some conflict in the id=1 and id=2, since
the peer have rejected <auth chap MD5> for id=1, but the other end
took it for id=2 and removed it from the next request.
I am not that good in analysing this protocal even then I am just
puting some ideas to make it more clear.
For more referance I have attached the gprs file with this mail which
is used by pppd.
Please let me know I missed any configuration or do I need to used any
advanced version of pppd.
I got stuck up badly with this problem, please help me.
Thanks and Regards,
Hari
=====================================================
gprs file follows:
------------------------------
# $Id: gprs,v 1.4 2007/09/17 09:11:40 shalinin Exp $
#
# File:
# gprs
#
# Description:
# Serial cable, IrDA, Bluetooth and USB pppd options for GPRS phones.
# See 'man pppd' for detailed option descriptions.
# Most GPRS phones don't reply to LCP echo's
lcp-echo-failure 0
lcp-echo-interval 0
# Keep pppd attached to the terminal:
# Comment this to get daemon mode pppd
nodetach
# Debug info from pppd:
# Comment this off, if you don't need more info
debug
kdebug 1
# Show password in debug messages
show-password
# Connect script:
# scripts to initialize the GPRS modem and start the connection,
# wvdial command is for Orange SPV while other phones should work with
chat
connect /etc/ppp/peers/gprs-connect-chat
#connect "/usr/bin/wvdial --chat --config /etc/ppp/peers/gprs-
wvdial.conf radiolinja_usb_orange_spv"
# Disconnect script:
# AT commands used to 'hangup' the GPRS connection.
disconnect /etc/ppp/peers/gprs-disconnect-chat
# Serial device to which the GPRS phone is connected:
# /dev/ttyS0 for serial port (COM1 in Windows),
# /dev/ircomm0 for IrDA,
# /dev/ttyUB0 for Bluetooth (Bluez with rfcomm running) and
# /dev/ttyUSB0 for USB
#/dev/ttyS0 # serial port one
#/dev/ttyS1 # serial port two
#/dev/ircomm0 # IrDA serial port one
#/dev/rfcomm0 # Bluetooth serial port one
/dev/ttyUSB2 # USB serial device, for example Orange SPV
#/dev/ttyACM0 # USB serial device, for example Orange SPV
# Serial port line speed
115200 # fast enough
#57600 # perhaps usefull with IrDA as some phones don't like
# speeds higher than this
# Hardware flow control:
# Use hardware flow control with cable, Bluetooth and USB but not with
IrDA.
crtscts # serial cable, Bluetooth and USB, on some occations with
IrDA too
#nocrtscts # IrDA
# Ignore carrier detect signal from the modem:
local
# IP addresses:
# - accept peers idea of our local address and set address peer as
10.0.0.1
# (any address would do, since IPCP gives 0.0.0.0 to it)
# - if you use the 10. network at home or something and pppd rejects
it,
# change the address to something else
#:10.0.0.1
# pppd must not propose any IP address to the peer!
#noipdefault
# Accept peers idea of our local address
ipcp-accept-local
ipcp-accept-remote
# Add the ppp interface as default route to the IP routing table
#defaultroute
# Newer pppd's also support replacing the default route, if one is
# already present, when the GPRS connetion should be set as the
default route
# to the network
#replacedefaultroute
# DNS servers from the phone:
# some phones support this, some don't.
usepeerdns
# ppp compression:
# ppp compression may be used between the phone and the pppd, but the
# serial connection is usually not the bottleneck in GPRS, so the
# compression is useless (and with some phones need to disabled
before
# the LCP negotiations succeed).
novj
nobsdcomp
novjccomp
#nopcomp
#noaccomp
# The phone is not required to authenticate:
noauth
# Username and password:
# If username and password are required by the APN, put here the
username
# and put the username-password combination to the secrets file:
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP
# authentication. See pppd man pages for details.
# Example, Radiolinja operator pap-secrets:
# "rlnet" * "internet" *
user "<username>"
# The persist tries to reopen the connection if it is dropped. This
# is usefull for example with a Nokia 7650 which only manages to
# 'dial' with every second attempt or when the network likes to drop
the
# connection every now and then. It's not fun when the over-night
# 'apt-get dist-upgrade -d -y' fails constantly...
#persist
#maxfail 99
# Asyncmap:
# some phones may require this option.
#asyncmap 0xa0000
# No magic:
# some phones may require this option.
#nomagic
# Require PAP authentication:
# some phones may require this option.
#require-pap
# Require CHAP authentication:
# some phones may require this option.
require-chap
I am trying to connect gprs over a mobile phone using linux. The pppd
version I am using is 2.4.4.
The service provider which I am using need chap authentication and so
I included require-chap in gprs script. The other modifications I did
is adding the following line in the chap-secrets
------------------
"<user name>" * "<password>" *
------------------
When I try start pppd, the following messages are printed and it
fails.
----------------------------------------------------
Press CTRL-C to close the connection at any stage!
defining PDP context...
AT
OK
ATH
OK
ATE1
OK
AT+CGDCONT=1, "IP","net","",0,0
OK
waiting for connect...
ATD*99***1#
CONNECT
Connected.
If the following ppp negotiations fail,
try restarting the phone.
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB2
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <auth chap MD5> <magic
0xc9622e1f> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <auth chap MD5> <magic
0x786b80b1> <pcomp> <accomp>]
sent [LCP ConfAck id=0x2 <asyncmap 0x0> <auth chap MD5> <magic
0x786b80b1> <pcomp> <accomp>]
rcvd [LCP ConfRej id=0x1 <auth chap MD5>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0> <magic 0xc9622e1f> <pcomp>
<accomp>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0> <magic 0xc9622e1f> <pcomp>
<accomp>]
peer refused to authenticate: terminating link
sent [LCP TermReq id=0x3 "peer refused to authenticate"]
rcvd [LCP DiscReq id=0x3 magic=0x786b80b1]
rcvd [CHAP Challenge id=0x1 <c0db5e9c746aad17d0f1277a56cd74d4>, name =
"UMTS_CHAP_SRVR"]
Discarded non-LCP packet when LCP not open
ff 3 c0 21 6 3 0 4
rcvd [LCP TermAck id=0x3]
Connection terminated.
-----------------------------------------------------------------
I am able to use same username and password in windows and able to
connect.
In the dump I am able to see some conflict in the id=1 and id=2, since
the peer have rejected <auth chap MD5> for id=1, but the other end
took it for id=2 and removed it from the next request.
I am not that good in analysing this protocal even then I am just
puting some ideas to make it more clear.
For more referance I have attached the gprs file with this mail which
is used by pppd.
Please let me know I missed any configuration or do I need to used any
advanced version of pppd.
I got stuck up badly with this problem, please help me.
Thanks and Regards,
Hari
=====================================================
gprs file follows:
------------------------------
# $Id: gprs,v 1.4 2007/09/17 09:11:40 shalinin Exp $
#
# File:
# gprs
#
# Description:
# Serial cable, IrDA, Bluetooth and USB pppd options for GPRS phones.
# See 'man pppd' for detailed option descriptions.
# Most GPRS phones don't reply to LCP echo's
lcp-echo-failure 0
lcp-echo-interval 0
# Keep pppd attached to the terminal:
# Comment this to get daemon mode pppd
nodetach
# Debug info from pppd:
# Comment this off, if you don't need more info
debug
kdebug 1
# Show password in debug messages
show-password
# Connect script:
# scripts to initialize the GPRS modem and start the connection,
# wvdial command is for Orange SPV while other phones should work with
chat
connect /etc/ppp/peers/gprs-connect-chat
#connect "/usr/bin/wvdial --chat --config /etc/ppp/peers/gprs-
wvdial.conf radiolinja_usb_orange_spv"
# Disconnect script:
# AT commands used to 'hangup' the GPRS connection.
disconnect /etc/ppp/peers/gprs-disconnect-chat
# Serial device to which the GPRS phone is connected:
# /dev/ttyS0 for serial port (COM1 in Windows),
# /dev/ircomm0 for IrDA,
# /dev/ttyUB0 for Bluetooth (Bluez with rfcomm running) and
# /dev/ttyUSB0 for USB
#/dev/ttyS0 # serial port one
#/dev/ttyS1 # serial port two
#/dev/ircomm0 # IrDA serial port one
#/dev/rfcomm0 # Bluetooth serial port one
/dev/ttyUSB2 # USB serial device, for example Orange SPV
#/dev/ttyACM0 # USB serial device, for example Orange SPV
# Serial port line speed
115200 # fast enough
#57600 # perhaps usefull with IrDA as some phones don't like
# speeds higher than this
# Hardware flow control:
# Use hardware flow control with cable, Bluetooth and USB but not with
IrDA.
crtscts # serial cable, Bluetooth and USB, on some occations with
IrDA too
#nocrtscts # IrDA
# Ignore carrier detect signal from the modem:
local
# IP addresses:
# - accept peers idea of our local address and set address peer as
10.0.0.1
# (any address would do, since IPCP gives 0.0.0.0 to it)
# - if you use the 10. network at home or something and pppd rejects
it,
# change the address to something else
#:10.0.0.1
# pppd must not propose any IP address to the peer!
#noipdefault
# Accept peers idea of our local address
ipcp-accept-local
ipcp-accept-remote
# Add the ppp interface as default route to the IP routing table
#defaultroute
# Newer pppd's also support replacing the default route, if one is
# already present, when the GPRS connetion should be set as the
default route
# to the network
#replacedefaultroute
# DNS servers from the phone:
# some phones support this, some don't.
usepeerdns
# ppp compression:
# ppp compression may be used between the phone and the pppd, but the
# serial connection is usually not the bottleneck in GPRS, so the
# compression is useless (and with some phones need to disabled
before
# the LCP negotiations succeed).
novj
nobsdcomp
novjccomp
#nopcomp
#noaccomp
# The phone is not required to authenticate:
noauth
# Username and password:
# If username and password are required by the APN, put here the
username
# and put the username-password combination to the secrets file:
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP
# authentication. See pppd man pages for details.
# Example, Radiolinja operator pap-secrets:
# "rlnet" * "internet" *
user "<username>"
# The persist tries to reopen the connection if it is dropped. This
# is usefull for example with a Nokia 7650 which only manages to
# 'dial' with every second attempt or when the network likes to drop
the
# connection every now and then. It's not fun when the over-night
# 'apt-get dist-upgrade -d -y' fails constantly...
#persist
#maxfail 99
# Asyncmap:
# some phones may require this option.
#asyncmap 0xa0000
# No magic:
# some phones may require this option.
#nomagic
# Require PAP authentication:
# some phones may require this option.
#require-pap
# Require CHAP authentication:
# some phones may require this option.
require-chap