Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> Linux 指令

iwconfig 入門:Linux 無線網卡的第一支設定工具

iwconfig 屬於 Linux Wireless Extensions(LWE)的使用者層工具。LWE 由三部分組成:核心支援、使用者層設定工具、驅動介面。目前多數無線網卡都支援 LWE,Redhat、Ubuntu 等主流發行版也預設就帶了這個工具。

基本用法

iwconfig interface [essid {NN|on|off}]
[nwid {NN|on|off}]
[mode {managed|ad-hoc|...}]
[freq N.NNNN[k|M|G]]
[channel N]
[ap {N|off|auto}]
[sens N] [nick N]
[rate {N|auto|fixed}]
[rts {N|auto|fixed|off}]
[frag {N|auto|fixed|off}]
[enc {NNNN-NNNN|off}]
[power {period N|timeout N}]
[retry {limit N|lifetime N}]
[txpower N {mW|dBm}]
[commit]

essid:網路識別

ESSID 用來區分不同無線網路,一般情況下只有 ESSID 相同的站點才能互通(除非你要監聽)。

iwconfig eth0 essid any           # 接受任何 ESSID,即混雜模式
iwconfig eth0 essid "My Network"
iwconfig eth0 essid -- "ANY"      # 字串本身含 any/off 時需加 --

nwid 與 nick

nwid 只用於 pre-802.11 的網卡,802.11 已改用 ESSID 加 AP 的 MAC 取代,現在幾乎不設。nickname 雖可設,但協議與 MAC 層並未使用,同樣少用。

iwconfig eth0 nwid AB34
iwconfig eth0 nwid off
iwconfig eth0 nickname "My Linux Node"

mode:工作模式

Ad-hoc 無 AP 的點對點網路;Managed 透過多個 AP 組成、可在其中漫遊;Master 讓本機成為 AP;Repeater 作為中繼轉發;Secondary 備份 AP/中繼;Monitor 監聽模式;Auto 由網卡自行決定。

iwconfig eth0 mode Managed
iwconfig eth0 mode Ad-Hoc
Copyright © Linux教程網 All Rights Reserved