Tuesday, May 25, 2010

Peer to Peer Wireless Networking with Linux

I was just thinking of setting up peer to peer networking in Linux. My Laptop is installed with debian lenny.
As First step towards this i started configuring my wireless adapter in my laptop which has intel iwl3945 adapter. I googled around and got some clues from forum and discussions in mailing lists.

To configure intel wireless adapters in linux i first edited the file /etc/apt/sources.list and included this line
deb ftp://mirror.cse.iitk.ac.in/debian lenny contrib main non-free

then as a root i typed
apt-get update
apt-get install firmware-iwlwifi

Then i went to intel website to download the firmware. http://intellinuxwireless.org clicked on iwlwifi project link.

From there i downloaded the file iwlwifi-3945-ucode-15.32.2.9.tgz and then uncompressed into a new directory. Now i copied the file iwlwifi-3945-2.ucode to /lib/firmware directory.
Now just clicked my nm-applet in top right corner of gnome window it started initializing and i was able to view all the nearby wireless networks.

By typing iwconfig now i was able to view all the paramters of my wireless adapter.

After this point i thought i could go for configuring peer to peer networking i had another laptop with the iwl3945 intel wireless adapter. Configured the wireless adapter.

I googled around for peer to peer networking. I would like to list the steps
i followed
stopped network-manger by typing
/etc/init.d/network-manager stop
made the wireless interface inactive by typing
ifconfig wlan0 down

using the iwconfig command i changed the mode of wirless adapter
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 channel 11

i activated the wireless interface once again by typing
iwconfig wlan0 up
then i set a name for my network

iwconfig wlan0 essid 'peernet'
iwconfig wlan0 key 0987654321

assigned an ip address for the interface
ifconfig wlan0 192.168.1.1 netmask 255.255.255.0
and then enabled ip forwarding
echo "1" >/proc/sys/net/ipv4/ip_forward

repeated the same thing for the second except for the ip address.

Tested the networking by pinging from each of the laptop
Great it worked fine.