Thursday, October 9, 2014

Configure wvdial.conf in Ubuntu 14.04

I wanted to configure my Etisalat broadband connection with Ubuntu 14.04. Network Manager has already been uninstalled.

In order to connect to the broadband network, I followed the below listed proceedure.

Wvdial, the software I used to connect, is  an  intelligent  PPP  dialer, which means that it dials a modem and starts PPP in order to connect to the Internet.  It is something like the chat(8) program, except that it uses heuristics to guess how to dial and log into your server rather  than  forcing  you to write a login script.

To install wvdial
$sudo apt-get install wvdial

As the next step the modem was connected to my PC.

To configure wvdial at the very first time, below command was used.
$sudo wvdialconf

I edited the /etc/wvdial.conf as shown below.
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","etisalat3g"
Modem Type = Analog Modem
Baud = 9600
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Phone = *99#
Password = " "
Username = " "


Since I don't have any credentials to connect to the network, I kept the username and password field as blank.

The APN was specified as an initialization parameter
Init3 = AT+CGDCONT=1,"IP","etisalat3g"

As the final step, I was able to successfully connect to the broadband network with the command.
$sudo wvdial

Configure Wireless Network: Edit /etc/network/interfeces of Ubuntu 14.04

To discover the available wireless interfaces
$sudo lspci |grep Wireless
$sudo lspci |grep Network


To discover the available wireless networks
$sudo iwlist wlan0 scan

To ask the wireless interface to associate with an identified access point
$sudo iwconfig wlan0 essid

If there is an encryption to supply the secret key [Assume WEP]
$sudo iwconfig wlan0 key

Now to ask for an ip address
$sudo dhclient wlan0

Or else to manualy configure the interface
$vi /etc/network/interfeces

The configuration for wireless interface with a dynamic IP address File: /etc/network/interfeces
----------
----------
auto wlan0
iface wlan0 inet dhcp
     wpa-ssid
     wpa-psk


The configuration for wireless interface with a static IP address File: /etc/network/interfeces
----------
----------
auto wlan0
iface wlan0 inet static
        address 192.168.2.185
        netmask 255.255.255.0
        gateway 192.168.2.1
        network 192.168.2.0
     broadcast 192.168.2.255
     dns-nameserver 8.8.8.8
     wpa-ssid

     wpa-psk


Note: Auto tag is to automatically start and connect to the wireless network.

To stop and start the wireless interface
$sudo ifdown wlan0
$sudo ifup -v wlan0