Connecting to BSNL dial-up Internet Server using wvdial

November 08, 2004
Bharat Sanchar Nigam Limited (BSNL) is India's largest telecom company. It is owned by the Govt. of India. BSNL provides Internet dial-up access packages (Sancharnet) which are the best deal when compared to those provided by other ISPs in the country. Here I will explain how to dial in to the BSNL server in linux using wvdial utility. It is assumed that you already have a BSNL dial-up internet account. If not then get one and come back to this page :) .
If this is the first time you are connecting to the internet, then you have to 'su' to root and execute the command :
$ su -
# wvdialconf
wvdialconf script, builds 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.Now if you check the /etc/wvdial.conf file, you will see that wvdialconf has written the necessary data regarding your modem there. Now you have to open the /etc/wvdial.conf file and enter the BSNL dial-up access phone number, your username and password as follows:
; /etc/wvdial.conf file
Phone = 172222
Username = "your login name"
Password = "your password"
Also make sure that the line -
New PPPD = yes
exists in the /etc/wvdial.conf file in the [Dialer Defaults] section. If it is not there, then include that too.
Next you have to modify your /etc/resolv.conf file and enter the primary and secondary DNS servers of BSNL for name resolution. If you do not do this then, you will be able to login to the BSNL server, but will not be able to browse the web. My /etc/resolv.conf file is as follows:
nameserver #Primary BSNL DNS Server
nameserver #Secondary BSNL DNS server
nameserver # Tertiary BSNL DNS server
Now to connect to the internet, just run wvdial command in the console as follows:
# wvdial
By default only root can run wvdial. To let other users execute wvdial utility, I did the following:
First I created a group called 'modem'.
# groupadd -g 503 modem
I Made sure that the group id 503 is not used by any other group; If not then you could use any other unique number greater than 500.Then I included all users who are allowed to connect to the internet to this newly created group.
# usermod -G modem ravi
# usermod -G modem sada
Then I permitted the modem group to connect to the internet by editing the sudo configuration file /etc/sudoers as follows:
# visudo
//Now you are in /etc/sudoers file
%modem localhost=/usr/bin/wvdial
From here onwards, those who are in the modem group can execute the following command to connect to the internet.
$ sudo wvdial
password: ******
My complete /etc/wvdial.conf file is as follows:
[Dialer Defaults]
New PPPD = yes ;Don't forget to include this line
Modem = /dev/modem
Baud = 14000 ;I use the linuxant driver so speed is less
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem

;BSNL phone no:,username and password settings
Phone = 172222
Username = "My login name"
Password = "My Password"


  • Hi there !!! thanx for such a useful wrteup. I did as per your suggestion but when I executed wvdial, it gave me "Phone number incorrect" message. Can you help me out....? thanx in advance

  • There are a few phone numbers reserved for dial-up users in BSNL. I have only listed one of them which is (was ??) 172222. Please check the number in your area. If you are in a remote location like a town or village, you might need to add the STD code along with the number too.

    I think the number has changed to 172233 .
    Check Sancharnet