Using wvdial in Linux
For all those who dunno wht wvdial is , its a PPP dialer, which means that it dials a modem and starts PPP in order to connect to the Internet. It takes care of how to dial and log into your server . If u r confused on wht PPP is actually , then i wud suggest u read this.
I never used my dial up modem on my linux machine and i recently gt broad band. But yesterday i was staying in my friends house and he saw linux in my comp and wanted to try it out in his comp. So i did the installation and was happy tht everything worked until he showed me his Reliance Net connect card and asked me how to use it in the newly installed OS. And thts whn i realised how wvdial can come to help.
So the rest of the post will go on describing how wvdial works.So lets tentatively say tht wvdial helps us to use things like our dial-up modem , usb-data card like things in linux.
Actually like all other command utilities , when wvdial starts, it first loads its configuration from /etc/wvdial.conf and ~/.wvdialrc which contains basic information about the modem port, speed, and init string, along with information about your Internet Service Provider (ISP), such as the phone number, your username, and your password.It then initializes the modem and dials the server and waits for a connection and takes care of all cases like phone line busy , no dial tone etc .wvdial has a lots of configuration options by default bt we will see here on how to do the configuration through wvdial.conf.
The configuration file /etc/wvdial.conf has sections named in square brackets and a number of variable = value pairs within each section. A sample file tht i gt from net is as following
[Dialer Defaults]
Modem = /dev/ttyS2
Baud = 57600
Init = ATZ
Init2 = AT S11=50
Phone = 555-4242
Username = apenwarr
Password = my-password[Dialer phone2]
Phone = 555-4243[Dialer shh]
Init3 = ATM0[Dialer pulse]
Dial Command = ATDP
Aa u can see there are four sections in this one. U can define as many as u want . But lets see wht these four sections are .
1)Dialer Defaults 2)Dialer phone 2 3)Dialer ssh 4) Dialer Pulse
Starting with the defaults i picked these defs from the man pages .
- Modem
- The location of the device that wvdial should use as your modem. The default is /dev/modem.
- Baud
- The speed at which wvdial will communicate with your modem. The default is 57600 baud.This is something like synchronisation .. or clock pulse period.
- Init1 … Init9
- wvdial can use up to nine initialization strings to set up your modem. Before dialing, these strings are sent to the modem in numerical order. These are particularly useful when specifying multiple sections. See above for an example that uses Init3 to turn the modem’s speaker off. The default is “ATZ” for Init1.
- Phone
- The phone number you want wvdial to dial. You can add up to 4 other phone numbers that wvdial will dial in order, by adding:
The next few lines contain the user name and password informations.
Next we see another section with a phone number defined . This means tht after loading the defaults these specific sections can be called upon as per the requirement . For example when u type in just wvdial in terminal , it runs with the settings specified in the default section. But say u want to add a new init string and dial a diff phone number ,then the command would be
wvdial phone2 ssh
This command dials the phone number specified in the phone2 section and loads the init3 string which turns off the modem.
The last secion has the following one
- Dial Command
- wvdial will use this string to tell the modem to dial. “ATDT” is the default one.
There are also of lots of other options like stupid mode etc which u can chk out by looking at the man pages. This info i guess shud be enough to start with using wvdial in case u have a modem to connect to internet.
Once the wvdial gets running it assigns ip and all other stuff… but i was still unsuccesful in getting the ip info from ifconfig. I guess wvdial doesnt change cant be monitored using ifconfig . Once i connected my reliance card ,using wvdial i got something like this
# wvdial cdma
–> WvDial: Internet dialer version 1.56
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Modem initialized.
–> Sending: ATDT#777
–> Waiting for carrier.
ATDT#777
CONNECT 230400
–> Carrier detected. Starting PPP immediately.
–> Starting pppd at Sat Mar 3 22:55:20 2007
–> Pid of pppd: 24314
–> Using interface ppp0
–> local IP address 220.226.50.126
–> remote IP address 97.239.2.10
–> primary DNS address 202.138.103.100
–> secondary DNS address 202.138.96.2
And yeah thts it, i started browsing (though it was terribly slow ) . I actually remember reading wvdial earlier in suren’s blog last year.
Well before winding up, if u found this too techhy to do in command line , there is always GNOME PPP to do it the graphical way .It has lots of check boxes and stuff tht u fill in, it writes into the wvdial.conf file .For brad band u just have to plug in the lan cable. Nothing else has to be done.. since ur modem is already connected to the server.
Memorable Sem Exams :)
Sem exams have been memorable and so was the Fifth sem. I remember the first year sem exams whn they were screening this bond movie series.They screened all the bond movies , one or two per day and we were all geared up in agate those days watching them whilst we had sem exams the next day . But at times it would be only me and adi watching sittin before the tv with book in hands and evryone comes around and says how do u guys watch movies at this time . Back then guys were really serious about studying .Some even left hostel because their roomies were not a good company to study with
.
So this sem exams i had to bother about only 3 out of the six exams.. So i started watching Prison Break season 1 , two days before the first exam.
. And i had finished the season 2 by the start of the first exam. And then i was off to the next season before the algo exam . The best was before Networks exam whn i promised i wont start the fourth season . But u see something like prison break can pushe u to wierdity . I started watching the fourth season episodes(1-10) right before the networks exam .But this time i was really afraid i am gonna screw up my networks exam( which finally didnt happen
) . It was a great time ,with u knw guys around u hell bent studying and u happily watch guys breaking out of prison. So i was done with fourth season episode 10 by the start of networks and was free and had no reason to open my comp for the micro processor exams. But then again i found tht the 11th episode had been out just before the OR exam. This time i cudnt just hold my self together. I rushed to emerald got my hands onto the 11th episode and started watching .I did watch the heroes 9th episode too in the mean time
.
So there it is.. I never really felt like i wrote my fifth sem exams.. All i can remember is watching prison break continuously . I had watched 48 episodes continuosly in 72 hours . Some thing i wudnt forget for a very long time . Prison Break totally Rocks ..Thanks to it for making a memorable Sem exams…