Friday, 9 March 2012

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.




6 comments:

  1. I want to configure Olsrd in ubuntu 14.04, can I use the same configuration?
    Thank you

    ReplyDelete
    Replies
    1. Sure you can, now im not sure how much the configuration file for OLSRD has been updated, but if they are following the same pattern this should work.

      Delete
    2. You can keep me posted here how you go along, if you run into errors just let me know and I'll help you out :)

      Delete
  2. when i run these command http://127.0.0.1:8001
    i got unable to connect "Firefox can't establish a connection to the server at 127.0.0.1:8001."

    ReplyDelete