Aug 5th, 2009
Setup wvdial to dial your ISP
Setup wvdial to dial your ISP
If you are using a dial-up internet connection, then you may configure your linux box to connect to the internet as discussed below.
Before you attempt to get dial-on-demand working, you need to make sure that you can dial up your ISP.
If this is the first time you are connecting to the internet, then you have to ’su’ to root and execute the ‘wvdialconf’ script. This would build a configuration file for wvdial. It detects your modem, its maximum baud rate, and a good initialization string and generates or updates the wvdial configuration file based on this information.
Scanning your serial ports for a modem.
ttyS0: ATQ0 V1 E1 — failed with 2400 baud, next try: 4800 baud
ttyS0: ATQ0 V1 E1 — OK
ttyS0: ATQ0 V1 E1 Z — OK
ttyS0: ATQ0 V1 E1 S0=0 — OK
ttyS0: ATQ0 V1 E1 S0=0 &C1 — OK
ttyS0: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
ttyS0: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — ERROR
ttyS0: Modem Identifier: ATI — 128K
ttyS0: Speed 9600: AT — OK
ttyS0: Speed 19200: AT — OK
ttyS0: Speed 38400: AT — OK
ttyS0: Speed 57600: AT — OK
ttyS0: Speed 115200: AT — OK
ttyS0: Max speed is 115200; that should be safe.
ttyS0: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
Found a modem on /dev/ttyS0.
/etc/wvdial.conf: Can’t read config file /etc/wvdial.conf:
No such file or directory
Modem configuration written to /etc/wvdial.conf.
ttyS0: Speed 115200; init “ATQ0 V1 E1 S0=0 &C1 &D2″
This will produce the configuration file /etc/wvdial.conf having entries such as:-
Modem = /dev/ttyS0
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
ISDN = 0
Modem Type = Analog Modem
; Phone =
; Username =
; Password =
You can now fill in your ISP’s phone number, your username and password. You should now be able to run wvdial and connect to the Internet. Type wvdial and you should see several lines scroll past and will stop after starting pppd. To stop the connection, press - C.
You may re-arrange your wvdial.conf to separate the modem configuration from any ISP account details.
Init1 = ATZ
Init2 = AT+CRM = 1
ISDN = 0
Modem = /dev/ttyACM0
Baud = 460800
Flow control = Hardware (CRTSCTS)
Carrier check = no
Dial command = ATDT
SetVolume = 0
[Dialer ABC]
Phone = #12345
Username = xxxxx
Password = xxxxx
Suppose your service provider is ABC, you may configure the username and password to dial the phone number 12345 as shown above.
Now, you may execute the following command to connect to the internet:-
You may find output such as:-
WvDial: Internet dialer version 1.56 (abuild@mandelbrot)
Cannot get information for serial port.
Initializing modem.
Sending: ATZ
ATZ
OK
Sending: AT+CRM = 1
AT+CRM = 1
OK
Modem initialized.
Sending: ATDT#12345
Waiting for carrier.
ATDT#12345
CONNECT
Carrier detected. Waiting for prompt.
Don’t know what to do! Starting pppd and hoping for the best.
Starting pppd at Sat Apr 5 23:35:36 2008
Pid of pppd: 5037
Using interface ppp0
The above method should work fine for other Linux distros with slight modification.