Configuring wireless interfaces

From Notes_Wiki
Revision as of 12:45, 14 July 2022 by Saurabh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Home > CentOS > CentOS 6.x > Network configuration > Network interface configuration > Configuring wireless interfaces

To configure wireless interfaces in Linux one can use combination of 'ifconfig', 'iwconfig' and 'iwlist' commands. 'ifconfig' or 'dhclient' can be used to configure IP address for interface or to make interface up so that we can use 'iwconfig' or 'iwlist' command for given interface. 'iwconfig' command can be used to configure frequency/channel, power, ssid, encryption key etc. for wireless interface. 'iwlist' helps in scanning for available networks and also helps in listing supported frequencies and channels of available network adapters.

Example script used to configure wireless interface at staff quarters is:

#!/bin/bash
sudo ifconfig wlan0 up
sudo iwconfig wlan0 essid <SSID>
sudo iwconfig wlan0 key <KEY>
sudo iwlist scanning wlan0
sudo iwconfig wlan0 channel 5
sudo iwconfig ap 00:0D:54:98:7C:85
sudo dhclient -v wlan0

Note:

  • Channel, essid, key, ap, etc. values will change as per scenario and most of these (except key offcourse) can be found using 'iwlist scanning' command.
  • 128-bit hex Key should be written in following format 'aaaa-bbbb-cccc-dddd-eeee-ffff-gg'



Home > CentOS > CentOS 6.x > Network configuration > Network interface configuration > Configuring wireless interfaces