In order to hack a wireless card, we have another utility called iwconjig. It works similar to ifconfig, but it has lots of additional features that are bonded to wireless cards. If we are using a wireless network with static Ip, we can attach our wireless card interface to a network as follows:
... where 'slynux' is the ESSID (that is, the name of the wireless network) and '8c140b2037' is the security key. Of course, you need to replace these variables with the values that hold good in your network. You can also scan and check the availability of wireless network(s) in your vicinity using the iwlist command as follows:
[root@gnuxbox-]# iwlist wlanO scan
wlanO Scan completed
Cell 01 . Address: 00:08:5C:52:E9:83 ESSlD:"slynux"
Mode:Master
ChanneI:lI
Frequency:2.462 GHz (Channel II)
Quality=92/l00 Signallevel:-39 dBm Noise level=-78 dBm Encryption key

ff
Bit Rates: I Mb/s; 2 Mb/s; 5.5 Mb/s; II Mb/s; 18 Mb/s 24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
12 Mb/s; 48 Mb/s
Extra:tsf=00000000fc021187
The above command will list out the various wireless networks available with a number of properties.
Then we can set the IP for the interface card using the ifconfig command itself:
If you are using dynamic addressing, you can obtain the IP address as follows:
The settings that you've configured with the ifconfig tool are available until the system reboot. But it's a waste of time if you need to configure it on every system start. And hence we take the' aid of network configuration scripts. On an Ubuntu (or any other Debian-based) system, this file is located at /etc/networks/interfaces, and contains data similar to the following:
auto 10
ilace 10 inet loopback
address 164.164.32.101 netmask 255.255.255240 gateway 164.164.32.97
It is necessary to learn this scripting in order to play with your network. The syntax for these are as follows:
1. Add the following lines if you want to configure ethO as theDHCP:
auto ethO
ilace ethO inet dhcp
2. Add the following files if you want to configure static IP:
auto ethO
ilace ethO inet static
address <ip_address>
netmask <netmask>
3. If it is a wireless network, add the following lines along with the above lines:
wireless-essid <network_name> wireless-key <key>
Now, to restart the network daemon, execute the following as the root: