Useful Linux Wireless Commands

原文地址:http://www.wirelessdefence.org/Contents/LinuxWirelessCommands.htm

 

Connecting to an Open or WEP enabled WLAN (DHCP)

 

Connecting to an Open or WEP enabled WLAN (Manual IP Setup)

 

iwconfig commands

 

ifconfig commands

 

iwpriv commands

 

iwlist commands

 

madwifi-ng commands

 

 

NOTE: NOT ALL CARDS/FIRMWARE SUPPORT ALL OF THE COMMANDS LISTED BELOW.

 

 

Note: To connect your Linux machine to a WLAN using WPA, WPA2 or 802.1X you will need to use WPA Supplicant

 

 

Connecting to an OPEN / WEP WLAN (DHCP)

 

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

 

iwconfig [interface] mode managed key [WEP key] (128 bit WEP use 26 hex characters, 64 bit WEP uses 10)

 

 

iwconfig [Interface] essid "[ESSID]" (Specify ESSID for the WLAN)

 

 

dhclient [interface] (to receive an IP address, netmask, DNS server and default gateway from the Access Point)

 

 

ping www.bbc.co.uk  (if you receive a reply you have access)

 

 

 

Connecting to an OPEN / WEP WLAN (Manual IP Setup)

 

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

 

It may be necessary to run some packet capture software (e.g. Ethereal) to determine the IP addresses of both the Default Gateway and DNS servers.

 

iwconfig [interface] mode managed key [WEP key] (128 bit WEP use 26 hex characters, 64 bit WEP uses 10)

 

 

iwconfig [interface] essid "[ESSID]"

 

 

ifconfig [interface] [IP address] netmask [subnetmask]

 

 

route add default gw [IP of default gateway] (Configure your default gateway; usually the IP of the Access Point)

 

 

echo nameserver [IP address of DNS server]  >>  /etc/resolve.conf (Configure your DNS server)

 

 

ping www.bbc.co.uk (if you receive a reply you have access)

 

 

 

iwconfig Commands:

 

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

 

iwconfig [interface] mode master (set the card to act as an access point mode)

 

 

iwconfig [interface] mode managed (set card to client mode on a network with an access point)

 

 

iwconfig [interface] mode ad-hoc (set card to peer to peer networking or no access point mode)

 

 

iwconfig [interface] mode monitor (set card to RFMON mode our favourite)

 

 

iwconfig [interface] essid any (with some cards you may  disable the  ESSID  checking)

 

 

iwconfig [interface] essid �your ssid_here� (configure ESSID for network)

 

 

iwconfig [interface] key 1111-1111-1111-1111 (set 128 bit WEP key)

 

 

iwconfig [interface] key 11111111 (set 64 bit WEP key)

 

 

iwconfig [interface] key s:mykey (set key as an ASCII string)

 

 

iwconfig [interface] key off (disable WEP key)

 

 

iwconfig [interface] key open (sets open mode, no authentication is used and card may accept non-encrypted sessions)

 

 

iwconfig [interface] channel [channel no.] (set a channel 1-14)

 

 

iwconfig [interface] channel auto (automatic channel selection)

 

 

iwconfig [interface] freq 2.422G (channels can also be specified in GHz)

 

 

iwconfig [interface] ap 11:11:11:11:11:11 (Force card to register AP address)

 

 

iwconfig [interface] rate 11M (card will use the rate specified)

 

 

iwconfig [interface] rate auto (select automatic rate)

 

 

iwconfig [interface] rate auto 5.5M (card will use the rate specified and any rate below as required)

 

 

 

ifconfig Commands:

 

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

 

ifconfig [interface] up (bring up specified interface)

 

 

ifconfig [interface] down (take down specified interface)

 

 

ifconfig [interface] [IP address] netmask [subnet-mask] (manually set IP and subnet-mask details)

 

 

ifconfig [interface] hw ether [MAC] (Change the wireless cards MAC address, specify in format 11:11:11:11:11:11)

 

 

 

iwpriv Commands:

 

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

 

iwpriv [interface] hostapd 1 (used to set card mode to hostapd e.g. for void11)

 

 

When the monitor mode patch is installed as per the Wireless Build HOWTO the following commands may be used to set the card into monitor mode.

 

 

iwpriv [interface] monitor [A] [B]


[A]

0 = disable monitor mode


1 = enable monitor mode with Prism2 header
 

2 = enable monitor mode with no Prism2


[B]

Channel to monitor (1-14)

 

iwlist Commands:

 

Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc.)

 

iwlist is used to display some large chunk of information from a wireless network interface that is not displayed by iwconfig.

 

 

iwlist [interface] scan (Give the list of Access Points and Ad-Hoc cells in range (ESSID, Quality, Frequency, Mode etc.) Note: In tests only worked with Atheros cards).

 

 

iwlist [interface] channel (Give the list of available frequencies in the device and the number of channels).

 

 

iwlist [interface] rate (List the bit-rates supported by the device).

 

 

iwlist [interface] key (List the encryption key sizes supported and display all the encryption keys available in the device).

 

 

iwlist [interface] power (List the various Power Management attributes and modes of the device).

 

 

iwlist [interface] txpower (List the various Transmit Power available on the device).

 

 

iwlist [interface] retry (List the transmit retry limits and retry lifetime on the device).

 

 

iwlist [interface] ap (Give the list of Access Points in range, and optionally the quality of link to them.  Deprecated in favour of scan)

 

 

iwlist [interface] peers (Give the list of Peers associated/registered with this card).

 

 

iwlist [interface] event (List the wireless events supported by this card).

 

 

Madwifi-ng Commands:

 

MADWiFi supports virtual access points (VAPS), which means you can create more than one wireless device per wireless card (the host wireless card = wifi0). 

 

By default, a sta mode VAP is created by, which is MadWifi talk for a 'managed mode wireless interface'.

 

 

Note: replace athx with your interface name as required (e.g. ath0, ath1)

 

 

wlanconfig athx destroy (Destroy VAP, athx)

 

 

wlanconfig athx create wlandev wifi0 wlanmode sta (Create a managed mode VAP, athx)

 

 

wlanconfig athx create wlandev wifi0 wlanmode ap (Create an Access Point VAP, athx)

 

 

wlanconfig athx create wlandev wifi0 wlanmode adhoc (Create an Ad-Hoc VAP, athx)

 

 

wlanconfig athx create wlandev wifi0 wlanmode monitor (Create a Monitor mode VAP, athx)

 

 

Changing modes:

 

ifconfig athx down (Take the VAP down)

 


wlanconfig athx destroy
(Destroy the VAP, athx)

 


wlanconfig athx create wlandev wifi0 wlanmode [sta|adhoc|ap|monitor]
(Create a new sta, adhoc, ap or monitor VAP)

 

 

Scan for Access Points (requires both steps):

 

modprobe wlan_scan_sta (To insert the scanning module)

 

 

wlanconfig athx list scan (To list the APs)

 

 

For more detailed information, see Madwifi Docs

 

 

Logicallysecure have produced an A4 leaflet of the above commands that can be downloaded here.

 

1、资源项目源码均已通过严格测试验证,保证能够正常运行;、 2项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行;、 2项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值