Creating an Ad-hoc Wireless Network

From Gumstix User Wiki
Jump to: navigation, search

Creating an Ad-hoc Network

On startup using the interfaces file:

Open /etc/network/interfaces

Change the wlan0 config to

auto wlan0
iface wlan0 inet static
wireless-mode ad-hoc
wireless-essid gumstix-network


Using ifconfig and iwconfig:

ifconfig wlan0 down
ifconfig wlan0 address netmask
iwconfig wlan0 mode ad-hoc essid gumstix-network
ifconfig wlan0 up

Running DHCP Server on Ad-hoc Network

Setting up a DHCP server on the ad-hoc network will allow you to connect to the gumstix without having to change your ip address.

Create a configuration file:

vi /etc/udhcpd.conf

Put the following in the file:

#start address

#end address

#interface to listen on
interface       wlan0

#maximum number of leases
max_leases      64

Create the leases file:

touch /var/lib/misc/udhcpd.leases

Now run the dhcp server:

udhcpd /etc/udhcpd.conf

Connect to the gumstix ad-hoc network and you should notice that you have been assigned the start address in the config file above. .