Pages

Tuesday, August 7, 2007

Debian Ad Hoc Wireless Networking

The following example uses eth1 for the wifi interface though this may be wlan0, ath0 or something else in your case.
Preparation

Ensure that network manager has been stopped and then bring the interface down.

sudo /etc/dbus-1/event.d/25NetworkManager stop
sudo ifdown eth1
Configuration
  1. Switch the card into ad hoc mode

  • sudo iwconfig eth1 mode ad-hoc
  1. Set the channel/frequency that you want to use.

  • sudo iwconfig eth1 channel 11
  1. Add the name (ssid) for the network you want to create/join. Use single quotes if there is a space in the name.

  • sudo iwconfig eth1 essid 'name'
  1. Add a WEP encryption key

  • sudo iwconfig eth1 key 1234567890
Activation
  1. Bring the interface back up

  • sudo ifconfig eth1 up
  1. Start dhclient to get an address

  • sudo dhclient eth1
  1. If you want to do it manually, you will have to make up an IP address.

  • sudo ifconfig eth1 10.0.0.1 netmask 255.255.255.0
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Reference

https://help.ubuntu.com/community/WifiDocs/Adhoc

No comments: