Connecting to a wireless network
An Ethernet connection is simple to configure, since it is connected through wired cables with no special requirements like authentication. However, wireless LAN requires an Extended Service Set IDentification network identifier (ESSID) and may also require a pass-phrase.
Getting ready
To connect to a wired network, we simply assign an IP address and subnet mask with the ifconfig
utility. A wireless network connection requires theiwconfig
and iwlist
utilities.
How to do it...
This script will connect to a wireless LAN with WEP (Wired Equivalent Privacy):
#!/bin/bash #Filename: wlan_connect.sh #Description: Connect to Wireless LAN #Modify the parameters below according to your settings ######### PARAMETERS ########### IFACE=wlan0 IP_ADDR=192.168.1.5 SUBNET_MASK=255.255.255.0 GW=192.168.1.1 HW_ADDR='00:1c:bf:87:25:d2' #Comment above line if you don't want to spoof mac address ESSID="homenet" WEP_KEY=8b140b20e7 FREQ=2.462G #####################...