Sunday 1 April 2012

Installing WICD on ubuntu 10.04 ( kernel 2.6.32-40 )

This tutorial is for those who are fed up with there UI network manager and want to try something more smarter and better!
WICD is an application i found to be extremly light and better then the usual NM - the default networking application.
to get started download the WICD source tarball frrom its legit website, the link is provided as follows!

https://launchpad.net/wicd/1.7/1.7.1/+download/wicd-1.7.1.tar.gz

This is the latest tarball till date.

Now im assuming to be in the Download folder, go there and untar it right away!
now lets get to work

Open the terminal and do this

#sudo su
#apt-get update
#cd Downloads
#cd wicd-1.7.1~b3
#python setup.py update_translations_py
#python setup.py get_translations
#python setup.py configure
#python setup.py install

Thats it - go to application and u will see WICD listed click on it let it have root priviliges and it will be working!


Configuring Tp-Link WN722N into Adhoc Mode On Ubuntu and running of OLSR

I start with this tutorial because i utterly felt that there has been lot of misconception about switching wireless adapters into ad hoc mode, On windows its very easy but on Ubuntu it  gets very tricky. When i started with this i came across lot of issue and mostly didn't find much help looking around so i figured out my own work around for this, i guess working on Ubuntu means being highly intuitive and offcourse your own ideas to play around with.
Anyways i will get to work, Now assume u must have installed Tp-Link WN722N on ubunbtu if not, im again listing  down the entire procedure which will work on ubuntu and its cross checked multiple times.
now i assume u must have inserted your USB device into the machine,still just to double check write this command in terminal,

#lsusb


as you can see there is device listed by the name of Atheros Communication,
thats your deal !

now to get this started i want you to go and download its drivers which can be found at a link listed below

http://www.orbit-lab.org/kernel/compat-wireless-2.6/2011/12/

now i assume you are working over kernel 2.6.32-40.

download the last tarball, which i will assume it is 

http://www.orbit-lab.org/kernel/compat-wireless-2.6/2011/12/compat-wireless-2011-12-31.tar.bz2

into the default Download folder.

go into that folder and untar it.

once done go back to the terminal and start hitting these commands

#sudo su
#cd Downloads
#cd compat-wireless-2011-12-31
#./scripts/driver-select ath9k_htc
#make 
#make install
#make unload

all this is done, i want to download the firmware file, i mean the latest one which has the link as below,

 http://linuxwireless.org/download/htc_fw/1.3/

get the file htc_9271.fw

now again assuming it to be in the download folder

in the terminal do this,

#sudo su
#cd Downloads
#cp htc_9271.fw /lib/firmware
#exit

now head towards the earlier terminal window im assuming u have not closed it,even if so thats arite ! 

now just load your new shiny driver by doing this

#sudo modprobe ath9k_htc

cross check if its properly loaded

#lsmod | grep ath9k

check its functioning by doing

#dmesg | grep ath9k

see if its listed into the hardware and is it working by doing this 

#ifconfig -a ( Or you can do this by - )
#iwconfig

it will list down it as wlan0

even if its not working then dont worry just hit a reboot

come back! log in back into your terminal hit the commands in terminal as sated earlier - your device would be working,

if not u have done something wrong. ( note : during compiling of drivers some warnings are ok - dont worry about it )

now gettin it into the adhoc mode is the most tricky part of the story!

if you try to put it in adhoc mode by the terminal even with root privileges, it wont let you. It will start throwing up errors as like device busy or unavailable and stuff like that. Dont worry here comes the inituitve part of the entire work !

After doing lot of research i figured out that it wont let u get into it because of  UI network manager locking it all up.

this can get nasty cause uptil now your network manager was handling your connectivity now its about time to go down to the basic!

now go to the terminal and enter this command ( be careful coz now you are about to lose your internet connectivity even if u r hard wired by eth0 )

#sudo apt-get remove --purge network-man*
#sudo reboot

once you come back to the screen, start hitting this in terminal

#sudo su
#gedit /etc/network/interfaces

it will open up a text file which you will have to edit like this

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
allow-hot plug wlan0
iface wlan0 inet static
address 10.10.10.11
netmask 255.255.255.0
wireless-mode ad-hoc
wireless-channel 1
wireless-essid Dark1

keep it like this im assuming it your wireless card to be wlan0 and your Ethernet card to be eth0

now do this,

#sudo su
#/etc/init.d/networking restart

bingo! your are back on the Internet and you have your device on the adhoc mode aswell
( point to note - to achieve connectivity between two pc wireless in ad hoc mode assign the different ip on the other computer but keep the same subnet mask plus give it the same essid don't change the name and keep the channel same as well )

if u feel your device not working give yourself a reboot, when you come back in you wud have internet connectivity via your hard wire and your device wud be on adhoc mode which can be crossed checked by doing this in terminal

#iwconfig

it wills show your device being in adhoc mode. to run olsr refer to my manual earlier i have written in the same blog and you wud achieve the said task !
Hope this help someone out there doing this work !
running thru issues?
comment below and await replies :D
tc adios !

need a UI to check around your connectivity?
install wicd on ubuntu from ubuntu software manager....let it access your card
voila! a UI beside NM - better aswell ! or you can do it manually by visiting there website and downloading its source code tarball, i will write about its manual installing in the next blog !

Friday 23 March 2012

Installing TPLINK TL-WN722N on ubuntu 10.04 ( kernel 2.6.32-40 )

This tutorial is for those who are trying to make a wirelss usb adapter of the above said origin work over ubuntu. When i started this i thought it will be easy work but as it turned out to be making the ubuntu recognize the adapter was one hell of a task. ( dont forget to plugin in your device right at the beginning and donot disconnect )
Plus to check that if its working
Open terminal and put this command

#lsusb

This will list down that your device is recognized or not,
If recognized it will show something like this


As you can see its listed at Bus 001 Device 002: Atheros Communication
Once this is confirmed lets move further.

I will straight get to work.
Once booted and inside the gnome i want you to follow these steps to get to work.
Open your browser up and paste in the following link

http://www.orbit-lab.org/kernel/compat-wireless-2.6/2011/05/

Now i downloaded the latest one which was > compat-wireless-2011-05-31.tar.bz2
I have no idea for the other version they might be compatible aswell, if someone else do this dont forget to comment below.

The testing link is provided below and try to work with this aswell

http://linuxwireless.org/en/users/Download/stable#compat-wireless_2.6.39_stable_releases

Now i assume u downloaded it to  /home/user/Downloads

Now open terminal up and start putting in these commands

#sudo su
#cd Downloads
#tar xvf compat-wireless-2011-05-31.tar.bz2
#cd compat-wireless-2011-05-31
#./scripts/driver-select ath9k_htc
#make
#make install

Once this is all done download these four files

Very Important : google these files up and save them to your download folder.

ar7010.fw
ar9271.fw
htc_7010.fw ( Version 1.3 )
htc_9271.fw ( Version 1.3 )

Or get the 4 files from here :

http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=tree

And once done go back to terminal and do this

#sudo su
#cd Downlaods
#cp ar7010.fw /lib/firmware
#cp ar9271.fw /lib/firmware
#cp htc_7010.fw /lib/firmware
#cp htc_9271.fw /lib/firmware

When all this is done

Run this command in the terminal

ifconfig -a

Note down the mac address of your wireless usb adapter

Now do this

#gedit /etc/udev/rules.d/70-persistent-net.rules

And add these lines underneath which are already there in the file that opens up

# USB device 0x0cf3:0x9271 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="54:e6:fc:94:91:35", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

Remember to keep them in 2 lines, i have shortened them so to keep the format in the blog,
Dont forget to alter the mac address according to your own which i pointed you to note down earlier, i.e. paste down your own.

Now back to the terminal and run this,

#sudo modprobe ath9k_htc
#sudo reboot

When you will log back do the #ifconfig and you will see your wlan0 listed and working.

Troubleshooting Tips : if it doesnt show up in the interfaces run this in the terminal

#dmesg | grep ath9k

It will list down any problem faced by the adapter to load.

This completes the tutorial to make TL-WN722N work with ubuntu 10.04

I hope i have explained the steps well and it will be useful for anybody out there reading this.

Comments and Feedback will be appreciated.

Saturday 10 March 2012

Installing And Configuring OSPF protocol on Ubuntu 10.04

This tutorial is for those who are interested in installing and configuring OSPF protocol on Ubuntu 10.04
I will try to make this tutorial as easy as possible.
To move on I will put them down as steps that should be followed one by one in successful accomplishment of the above said task.
To begin with I will assume you have installed Ubuntu 10.04 which is completely updated.
Now goto your Ubuntu software center and search for ospf , you will see something like this


As you can see I have installed the ospf routing deamon.
Now open Terminal , and start putting in these commands, which are as follows:

#sudo su
#nano /etc/quagga/daemons

Edit it like this,

zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no 

Save it and close it, and keep going!

#cp /usr/share/doc/quagga/examples/zebra.conf.sample /etc/quagga/zebra.conf
#cp /usr/share/doc/quagga/examples/ospfd.conf.sample /etc/quagga/ospfd.conf
#cp /usr/share/doc/quagga/examples/vtysh.conf.sample /etc/quagga/vtysh.conf
#nano /etc/quagga/debian.conf

Edit it like this,

# If this option is set the /etc/init.d/quagga script automatically loads 
# the config via "vtysh -b" when the servers are started. 
# Check /etc/pam.d/quagga if you intend to use "vtysh"! 
vtysh_enable=yes 
zebra_options=" --daemon -A " 
bgpd_options=" --daemon -A " 
ospfd_options=" --daemon -A " 
ospf6d_options="--daemon -A " 
ripd_options=" --daemon -A " 
ripngd_options="--daemon -A " 
isisd_options=" --daemon -A " 

Save it - Exit, and keep moving forward,

#nano /etc/quagga/vtysh.conf

Edit it like this,

!
! Sample
!
! service integrated-vtysh-config
hostname quagga-router
username root nopassword
!

Save it,Exit - Keep moving !

#nano /etc/quagga/ospfd.conf

Edit it like this,

! Zebra configuration saved from vty
!   2012/03/10 05:06:34
!
hostname ospf
password zebra
enable password zebra
!
!
!
interface eth0
!
interface eth1
!
interface lo
!
router ospf
network 192.168.10.101/24 area 0.0.0.0 /* This was IP Address on eth1 - You should put your own*/
!
line vty
!

Save,Exit - Move on bro !

#echo VTYSH_PAGER=more > /etc/environment
#echo "1" > /proc/sys/net/ipv4/ip_forward
#echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf

Log out and log back in !
Open the terminal and get to work !

#sudo su
#chown quagga.quaggavty /etc/quagga/*.conf
#chmod 640 /etc/quagga/*.conf
#/etc/init.d/quagga restart
#vtysh - c "write" ( save all your configuration )
#vtysh - c "show ip forwarding" ( this should indicate as being on if its correctly done )
#vtysh - c "show ip route" ( this should tell you that your ospf is working via ethX )
#vtysh - c "show ip opsf neighbor" ( shows the neighbor if any )
#vtysh - c "show ip ospf database" ( shows the entire activity )

Thats ends my tutorial of how to configure and install and run the OSPF protocol on ubuntu 10.04 LTS. I hope i have explained all the step as in detail and as easy as possible. If you are running through problems comment below and i will try to answer back your queries as early as possible, i hope it helps anybody out there !!!

Friday 9 March 2012

Installing And Configuring AODV protocol on Ubuntu 10.04

This tutorial is for those who are interested in installing and configuring AODV protocol on Ubuntu 10.04
I will try to make this tutorial as easy as possible.
To move on I will put them down as steps that should be followed one by one in successful accomplishment of the above said task.
To begin with I will assume you have installed Ubuntu 10.04 which is completely updated.
Before moving further with the installation of AODV protocol we first need to install its dependency.
This can be easily one by going into the terminal and putting the following commands,

#sudo apt-get install build-essential

Now moving on you would need the AODV source tarball.
I have found the tarball which is compatible with our kernel module.
The link is below,


Moving on i assume you have saved the AODV source files (tarball) to the directory home/user/Downloads

Go the directory Downloads and double click on the GNU tarball and extract it in the same folder,

But before proceeding you need to make your IP static,
To do that you need to do work,
Open terminal and start putting down these command,

#sudo su  /* to gain root privileges*/

Note: Now im assuming you have root access 

#cd\  ( to go to root directory )
#cd /etc/network
#gedit interfaces

This should open a file which will be something like this,

auto lo
iface eth0 inet loopback

Do-not touch these lines, rather just below them add these lines,
Note: dont forget to check your interface and your ip before inserting these lines to interfaces file, to do this simple open terminal and run command #ifconfig , this will show your interface and your current IP.

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Which will end up as the file looking like this,

auto lo
iface eth0 inet loopback
auto eth0 
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Save the file and close it.

Now go back to the terminal and enter these commands,

#cd\
#cd /etc/init.d
#./networking restart

After this is done now go back to the folder where you extracted the GNU tarball of AODV.
Now im expecting it to be by the name of the folder - aodv-uu-0.9.6
Now open terminal and start putting these commands,

#sudo su
#cd /Downloads/aodv-uu-0.9.6
#make
#make install

Now load the kaodv module on Ubuntu, using:

#modprobe kaodv

Now its time to run the protocol, In the Terminal use these commands,

#sudo su
#aodv -i eth0 -l -r 3

-l ( is for logging the aodv activity located inside /var/log/aodvd.log )
-r ( save neighbor table after every 3 seconds inside /var/log/aodvd.log )
-i ( the desired interface on which the protocol is to run )

Thats ends my tutorial of how to configure and install and run the AODV protocol on ubuntu 10.04 LTS. I hope i have explained all the step as in detail and as easy as possible. If you are running through problems comment below and i will try to answer back your queries as early as possible, i hope it helps anybody out there !!!


Configuring OLSR protocol on Ubuntu 10.04


This tutorial is for those who are interested in installing and configuring olsrd protocol on Ubuntu 10.04
I will try to make this tutorial as easy as possible.
To move on I will put them down as steps that should be followed one by one in successful accomplishment of the above said task.
To begin with I will assume you have installed Ubuntu 10.04 which is completely updated.
Now goto your Ubuntu software center and search for olsrd,you will see something like this


As you can see I have installed the olsrd and olsrd PlugIns both.
To make sure you don't run through errors don't forget to install its dependencies which are
1. flex
2. bison
3. libc6

This can be easily one by going into the terminal and putting the following commands,

#sudo apt-get install libc6 flex bison

Now assume your good and ready to go,
to check if its properly installed go to root folder and move to etc/olsrd you will find it filled with lots of files.

Now to move on the steps that are required are again to be done on terminal, input the following commands

#sudo su
#cd\
#cp /etc/olsrd/olsrd.conf /etc/olsrd/olsrd.conf.orignal

This is step is not necessary to do as this is just to make the backup of the original configuration file in case you mess in something or you need to modify it according to your own needs.

Now go back to terminal and start editing your olsrd.conf file

#gedit /etc/olsrd/olsrd.conf
It will open up a file which would have some text, remove it,modify to according to your own needs, im puttin down the type of custom configuration I have built in order to run my olsrd protocol, which is as follows,

DebugLevel 2
LinkQualityFishEye 1
IpVersion 4
Hna4
{
}
AllowNoInt yes
TosValue 16
Willingness 4
IpcConnect
{
MaxConnections 0
Host 127.0.0.1
}
UseHysteresis no
LinkQualityLevel 2
LinkQualityWinSize 20
Pollrate 0.1
TcRedundancy 2
MprCoverage 3
LoadPlugin "olsrd_httpinfo.so.0.1"
{
PlParam "port" "8888"
PlParam "Host" "127.0.0.1"
}
Interface "eth0"
{
HelloInterval 2.0
HelloValidityTime 20.0
TcInterval 1.0
TcValidityTime 80.0
MidInterval 4.0
MidValidityTime 80.0
HnaInterval 4.0
HnaValidityTime 80.0
# LinkQualityMult 192.168.0.1 0.10
}

Remember this is my custom built configuration, you can modify it according to your own requirements.

Save it and close it.

Now its time to initiate the interface or adjust it to work with olsrd.

Open terminal and start putting down these command,

#sudo su /* to gain root privileges*/

Note: Now im assuming you have root access 

#cd\ ( to go to root directory )
#cd /etc/network
#gedit interfaces

This should open a file which will be something like this,

auto lo
iface eth0 inet loopback

Do-not touch these lines, rather just below them add these lines,
Note: dont forget to check your interface and your ip before inserting these lines to interfaces file, to do this simple open terminal and run command #ifconfig , this will show your interface and your current IP.

auto wlan0
allow-hot plug wlan0
iface wlan0 inet static
address 192.168.1.200
netmask 255.255.255.0
wireless-mode ad-hoc
wireless-channel 1
wireless-key s:12345
wireless-essid MESH
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Which will end up as the file looking like this,

auto lo
iface eth0 inet loopback
auto wlan0
allow-hot plug wlan0
iface wlan0 inet static
address 192.168.1.200
netmask 255.255.255.0
wireless-mode ad-hoc
wireless-channel 1
wireless-key s:12345
wireless-essid MESH
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Save the file and close it.

Now go back to the terminal and enter these commands,

#cd\
#cd /etc/init.d
#./networking restart

If your run across error while restarting the the network service I will advice of using a USB wireless adapter as your pci card doesn't support wireless ad-hoc mode.

Go back to terminal and enter these command to execute the olsrd protocol,

#sudo su
#/etc/init.d/olsrd -d 2 start

Your olsrd will be up and running, to verify the service running, open up your browser and enter this in the address bar


This will show you all the stats of the olsrd.

I hope by the help of this tutorial you will be able to successfully accomplish the above said task.

Comments will be appreciated.




Installing And Configuring DSR protocol on Ubuntu 10.04

NOTE: Before start installing and configuring DSR protocol over Ubuntu 10.04 what i want my reader is to clearly follow my steps as the way Im putting then down.
When i started working on this as usual i was expecting lot of help from the Google but as the way it turns out, there was no help on the Google at all.
Thats why i took the initiative to write this tutorial for the people out there who want to install it and configure DSR.
Now i presume that you must have Ubuntu 10.04 installed (Completely Updated) .
At the time of writing this it was running with kernel module 2.6.32-39,
It wont work on this,
So in order to install it what we need is an older kernel module, what we be needing is kernel module 2.6.32 (plain) nothing else.
This can be very hectic work as in order a kernel module (custom one) lot of people suggest about building it from scratch.
What i found was a shortcut.
Just download the three files from Ubuntu mainline


Keep them in the same order,
Do-not mess up the order,
As you can see they are deb files so just double click on them will start the installation.
Double click on first,let it finish, then on second, and go on till third one,
I Repeat do-not mess up the order, keep it the way i have pasted down the links

Once you finish with that it will ask for a reboot,

Now assume when come back to this page you will be on your own installed kernel that is 2.6.32, if you want to check which kernel version are you on then just do this,

Open terminal and execute #sudo uname -r

It will show you the kernel version you are on.
If you find you are not in the version which you desired, then restart your machine and hold shift till a screen appears which gives you the option of booting into desired kernel version, select 2.6.32 and hit enter.

I assume now you are on the kernel version 2.6.32, now moving on you would need the DSR source tarball.

I have found the tarball which is compatible with our kernel module.
The link is below,


Moving on i assume you have saved the DSR source files (tarball) to the directory home/user/Downloads

Go the directory Downloads and double click on the GNU tarball and extract it in the same folder,

But before proceeding you need to make your IP static,
To do that you need to do work,
Open terminal and start putting down these command,

#sudo su  /* to gain root privileges*/

Note: Now im assuming you have root access 

#cd\  ( to go to root directory )
#cd /etc/network
#gedit interfaces

This should open a file which will be something like this,

auto lo
iface eth0 inet loopback

Do-not touch these lines, rather just below them add these lines,
Note: dont forget to check your interface and your ip before inserting these lines to interfaces file, to do this simple open terminal and run command #ifconfig , this will show your interface and your current IP.

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Which will end up as the file looking like this,

auto lo
iface eth0 inet loopback
auto eth0 
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Save the file and close it.

Now go back to the terminal and enter these commands,

#cd\
#cd /etc/init.d
#./networking restart

After this is done now go back to the folder where you extracted the GNU tarball of DSR.
Now im expecting it to be by the name of the folder - trunk.
Now open terminal and start putting these commands,

#sudo su
#cd /Downloads/trunk
#make ignore the warnings and keep moving ahead )
#make install

Now to go the trunk folder which is located inside the Downloads folder & open dsr-uu.sh and you will find a line like this right in the beginning of it,

IFNAME=eth1 

Change it to the interface you are working upon,
I assume eth0 , if not sure then again in terminal do #ifconfig and look for the interface that has the your IP, note the interface and change that in the dsr-uu.sh file,it should look like this,

IFNAME=eth0

Now look down in the file and you will find a place like this,

$IFNAME 92.168.45.$host_nr up

And a little below,

dsr0 192.168.45.$host_nr up

Change the ip address to the one which you have, i changed it to mine like this,

$IFNAME 192.168.1.$host_nr up

And the other line as-well,

dsr0 192.168.1.$host_nr up

Notice the change that i did, you should alter it according to your ip address.
Now close the terminal and open it back again and start putting in the command as below,

#sudo su
#cd /Downloads/trunk
#chmod 755 dsr-uu.sh
#./dsr-uu.sh start eth0

In my case it was eth0 you should put down the interface which you want it to get attached to,the DSR will be running.
To stop it simply do,

#./dsr-uu.sh stop

Thats ends my tutorial of how to configure and install and run the DSR protocol on ubuntu 10.04 LTS. I hope i have explained all the step as in detail and as easy as possible. If you are running through problems comment below and i will try to answer back your queries as early as possible, i hope it helps anybody out there !!!