Tuesday, October 7, 2008

Automatic Startup Wireless Network Configuration on Ubuntu 8.04

In this time we would like to build Wireless Network Configuration that will be start automatically when start up. Wireless card that used here is Atheros Chipset. The configuration is like this:

IP Static
IP: 192.168.100.1
netmask: 255.255.255.0
wireless mode: adhoc
wireless essid: telecom_mesh
wireless channel: 2

To get this configuration, we must do some configuration.
1. In the /etc/network/interfaces, fill with this:
auto ath0
iface ath0 inet static
address 192.168.100.1
netmask 255.255.255.0
post-down wlanconfig ath0 destroy
pre-up sleep 3
pre-up wlanconfig ath0 create wlandev wifi0 wlanmode adhoc
pre-up sleep 3
pre-up iwconfig ath0 essid "telecom_mesh" channel 2
pre-up ifconfig ath0 up


But, if only using this configuration, it takes no effect. So, we must do another way again. The problem is Ubuntu can't execute command "pre-up wlanconfig ath0 create wlandev wifi0 wlanmode adhoc". The solution for this is:
We must make some script to change wireless mode become adhoc when first booting of Ubuntu without using file /etc/network/interface.

Make files in /etc/init.d, for example named netwmn. You can use another file name, no problem. The content of the file like this:
#! /bin/sh

/sbin/wlanconfig ath0 destroy
/bin/sleep 3
/sbin/wlanconfig ath0 create wlandev wifi0 wlanmode adhoc
/bin/sleep 3
/sbin/iwconfig ath0 essid telecom_mesh channel 2


exit 0

After that, making this file execute when Ubuntu start-up, using command:
chmod +x /etc/init.d/netwmn

This file also must can be execute when start up on SystemV Ubuntu, using command:
cd /etc/init.d/
update-rc.d netwmn

After that, change /etc/network/interfaces using:
auto ath0
iface ath0 inet static
address 192.168.100.1
netmask 255.255.255.0
broadcast 192.168.100.255
network 192.168.100.0


That's final. Now the wireless is configured well when startup.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home