Krannywidlinux

Setup a Dialup connection in linux

Posted on: January 3, 2008

ive found this to be a problem for every new-bie and thought of to share with u guys.Actually i’m using ubuntu 7.04 at present.this post doesnt assume that your Linux distro recognises your modem.

So first connect your modem and start off with lsusb and see the output if you see there your mobile’s manufacture name.
then execute “sudo wvdialconf”This tries to detect the baud rate of your modem and writes it to /etc/wvdial.conf

and also you have to make some manual changes to wvdial.conf,like update the username and password options…so execute the command sudo gedit /etc/wvdial.conf if you are using Gnome
or sudo kate /etc/wvdial.conf if you are using KDE

our wvdial.conf should look like

[Dialer Defaults]
Modem = /dev/ttyUSB1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
stupid mode = 1
Modem Type = Analog Modem
Phone = *99#
ISDN = 0
Username = a
Password = b
Baud = 460800

now if ur using ubuntu then voila ur done with …..coz it automatically updates DNS server in resolv.conf.If u use any other distro open file:/etc/resolv.conf and enter following setting service named start
nameserver 202.56.230.5
nameserver 202.56.250.5
and save it…..

thats it u are done with…..just type wvdial and ur connected to net…….just type ctrl+c to disconnect……or type Killall pppd to kill all active connections……

Some common problems 1. Internet connected successfully but page is not opening

fire up following command
gedit /etc/resolv.conf

and enter this
nameserver 208.67.222.222 nameserver 208.67.220.220
Now u will be able to open web page without any problem.

2 when ever i try to connect internet i get this error (Device or Resource busy)
This is the common problem with dialup connection via dial up.
Possible solution.
1. remove usb cable from the port and reinsert it. If that not help than.
2. run following command
wvdialconf /etc/wvdialconf
it will remap ur usb port to ttyACMO1or 2

Life is much better in ubuntu. ubuntu automatically update the dns server detail in resolv.conf whenever user dial dialup connection. and ubuntu automatically update the wvdial.conf file with dialup/phone setting whenever user fireup this command
sudo wvdialconf
but on other distro user have to enter following command to update wvdial.conf file
wvdialconf /etc/wvdial.conf
as root

Updates for the Comments::::::::::::::::::::

f you use Idea GPRS then your string will be like
init1 = AT+CGDCONT=1,”IP”,”internet”,””,0,0

if you use BSNL gprs in south zone of India then string will be like
init1 = AT+CGDCONT=1,”IP”,””,”portalsouth.cellone.in”,0,0

and use the following username & password if you use bsnl gprs
Username = ppp
Password = ppp123

for hutch use
init1 = AT+CGDCONT=1,”IP”,”www”,””,0,0

If u have ny other problems regarding connecting net then feel free to bug me…..

Advertisements

10 Responses to "Setup a Dialup connection in linux"

Pretty useful post…!!!

gr8 post…was searching for the same for quite long…..But the init lines u’ve written implies airtel gprs…..But im using Idea cellular…cud u please gimme the init lines for the same….

@abhinav

Updated with ur Req…..N say wheter it worked or not

Setup a Dialup connection in linux:
gr8 post….had seen the same post at a few places but its nice to see all at a place(airtel,hutch,bsnl)

Tried all these.. did not work for me.. will drop back when I get it to work

can u give me some details of how you are connecting so that i can be of some help

thanks man…..quite useful post
i think i got my solution…
i’ll reply you as sooon as my GPRS internet starts working..
great work…..cheers

Hi, Its not working for me. I am using BSNL GPRS from Hyderabad(which comes in southzone).

Should I replace the line “Init1 = ATZ” with “init1 = AT+CGDCONT=1,”IP”,””,”portalsouth.cellone.in”,0,0″ ????

When I give WVDIAL in the terminal, the process is never stopping, its going on with the following parameters repeating again and again.

———————————————————–

[root@localhost ~]# wvdial
–> WvDial: Internet dialer version 1.54.0
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Modem initialized.
–> Sending: ATDT*99#
–> Waiting for carrier.
ATDT*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
–> Carrier detected. Starting PPP immediately.
–> Starting pppd at Wed Apr 30 10:36:28 2008
–> pid of pppd: 9245
–> Using interface ppp1
–> pppd: Modem
–> pppd: Modem
–> pppd: Modem
–> pppd: Modem
–> pppd: Modem
–> pppd: Modem
–> Disconnecting at Wed Apr 30 10:36:34 2008
–> The PPP daemon has died: A modem hung up the phone (exit code = 16)
–> man pppd explains pppd error codes in more detail.
–> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
–> Auto Reconnect will be attempted in 5 seconds
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Modem initialized.
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Modem initialized.
–> Sending: ATDT*99#
–> Waiting for carrier.
ATDT*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
–> Carrier detected. Starting PPP immediately.
–> Starting pppd at Wed Apr 30 10:36:45 2008
–> pid of pppd: 9269
–> Using interface ppp1
–> pppd: Modem
–> pppd: Modem
–> pppd: Modem
–> pppd: Modem
–> pppd: Modem
–> pppd: Modem
–> Disconnecting at Wed Apr 30 10:36:52 2008
–> The PPP daemon has died: A modem hung up the phone (exit code = 16)
–> man pppd explains pppd error codes in more detail.
–> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
–> Auto Reconnect will be attempted in 10 seconds
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Modem initialized.

Did u try Sudo wvdialconf…it will generate the wvdial.conf automatically…make some minor changes…(username password)
your wvdial.conf must be like

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Carrier Check = no
New PPPD = yes
Modem Type = Analog Modem
ISDN = 0
Phone = 172222
Modem = /dev/ttySL0
Username =
Password =
Baud = 460800

I have already tried that and I have tried it again. Actually, the phone number is not 172222, its *99# . Coz dialing 172222 from a mobile is saying NUMBER NOT IN USE, coz this is not a landline.

But, my problem is yet there even with the solution you gave above. It did not make any difference. Please. help me.

[root@localhost ~]# wvdial
–> WvDial: Internet dialer version 1.54.0
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Modem initialized.
–> Sending: ATDT*99#
–> Waiting for carrier.
ATDT*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
–> Carrier detected. Waiting for prompt.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
–> PPP negotiation detected.
–> Starting pppd at Fri May 2 10:42:26 2008
–> pid of pppd: 25965
–> Using interface ppp1
–> Disconnecting at Fri May 2 10:42:32 2008
–> The PPP daemon has died: A modem hung up the phone (exit code = 16)
–> man pppd explains pppd error codes in more detail.
–> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
–> Auto Reconnect will be attempted in 5 seconds
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Modem initialized.
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Modem initialized.
–> Sending: ATDT*99#
–> Waiting for carrier.
ATDT*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
–> Carrier detected. Waiting for prompt.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
–> PPP negotiation detected.
–> Starting pppd at Fri May 2 10:42:47 2008
–> pid of pppd: 25989
–> Using interface ppp1
–> Disconnecting at Fri May 2 10:42:53 2008
–> The PPP daemon has died: A modem hung up the phone (exit code = 16)
–> man pppd explains pppd error codes in more detail.
–> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
–> Auto Reconnect will be attempted in 10 seconds
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Modem initialized.
Caught signal #2! Attempting to exit gracefully…
–> Disconnecting at Fri May 2 10:43:00 2008
[root@localhost ~]#

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog Stats

  • 16,980 hits
%d bloggers like this: