openwrt 的/etc/config/wireless 文件解析

原文:http://blog.csdn.net/hui523hui523hui523/article/details/38493725安全

 

1.2.2 無線網絡Wireless

WiFi設置儲存在/etc/config/wireless中(目前支持Broadcom, Atheros 和mac80211)。當第一次啓動路由器時,將會自動檢測你的卡而且建立簡單的配置文件。默認狀況下 'option network lan' 是被註釋掉的。它提供了一個非安全的無線網絡共享。網絡

The WiFi settings are configured in the file /etc/config/wireless(currently supported on Broadcom, Atheros and mac80211). When booting the router for the first time it should detect your card and create a sample configuration file. By default 'option network lan' is commented. This prevents unsecured sharing of the network over the wireless interface.架構

每個無線驅動都有本身的配置腳本/lib/wifi/driver_name.sh ,用來處理驅動選項和配置。這個腳本也調用特殊二進制,例如Broadcom的w1c,或者atheros的hostapd 和wpa_supplicant 。less

Each wireless driver has its own configuration script in /lib/wifi/driver_name.sh which handles driver specific options and configurations. This script is also calling driver specific binaries like wlc for Broadcom, or hostapd and wpa_supplicant for atheros.ide

使用不一樣的架構配置是由於不一樣的驅動配置。ui

The reason for using such architecture, is that it abstracts the driver configuration.this

標準的Broadcom無線配置: Generic Broadcom wireless config:加密

config wifi-device "wl0" 
option type "broadcom" 
option channel "5" 

config wifi-iface 
option device "wl0" 
option network lan 
option mode "ap" 
option ssid "OpenWrt" 
option hidden "0" 
option encryption "none"

標準的Atheros無線配置: Generic Atheros wireless config:spa

config wifi-device "wifi0" 
option type "atheros" 
option channel "5" 
option hwmode "11g" 

config wifi-iface 
option device "wifi0" 
option network lan 
option mode "ap" 
option ssid "OpenWrt" 
option hidden "0" 
option encryption "none"

標準的mac80211無線配置: Generic mac80211 wireless config:.net

config wifi-device "wifi0" 
option type "mac80211" 
option channel "5" 

config wifi-iface 
option device "wlan0" 
option network lan 
option mode "ap" 
option ssid "OpenWrt" 
option hidden "0" 
option encryption "none"

標準的多播Atheros無線配置: Generic multi-radio Atheros wireless config:

config wifi-device wifi0 
option type atheros 
option channel 

config wifi-iface 
option device wifi0 
option network lan 
option mode ap 
option ssid OpenWrt_private 
option hidden 
option encryption none 

config wifi-device wifi1 
option type atheros 
option channel 11 

config wifi-iface 
option device wifi1 
option network lan 
option mode ap 
option ssid OpenWrt_public 
option hidden 
option encryption none

這個文件裏有兩個類型的配置段。wifi-device針對物理wifi接口,wifi-iface配置了一個在wifi-device之上的虛擬接口(須要被驅動支持)。

There are two types of config sections in this file. The 'wifi-device' refers to the physical wifi interface and 'wifi-iface' configures a virtual interface on top of that (if supported by the driver).

無線配置全歸納:A full outline of the wireless configuration file with description of each field:

 

config wifi-device wifi device name 
option type broadcom, atheros, mac80211 
option country us, uk, fr, de, etc. 
option channel 1-14 
option maxassoc 1-128 (broadcom only) 
option distance 1-n 
option hwmode 11b, 11g, 11a, 11bg (atheros, mac80211) 
option rxantenna 0,1,2 (atheros, broadcom) 
option txantenna 0,1,2 (atheros, broadcom) 
option txpower transmission power in dBm 

config wifi-iface 
option network the interface you want wifi to bridge with 
option device wifi0, wifi1, wifi2, wifiN 
option mode ap, sta, adhoc, monitor, or wds 
option txpower (deprecated) transmission power in dBm 
option ssid ssid name 
option bssid bssid address 
option encryption none, wep, psk, psk2, wpa, wpa2 
option key encryption key 
option key1 key 
option key2 key 
option key3 key 
option key4 key 
option server ip address 
option port port 
option hidden 0,1 
option isolate 0,1

 

 

 

wifi-device的配置項: Options for the wifi-device :

  • type 
    該接口使用的驅動。The driver to use for this interface.
  • country 
    國家代碼用來指名規定設置。The country code used to determine the regulatory settings.
  • channel 
    wifi頻道(例如1-14,取決於country設置)The wifi channel (e.g. 1-14, depending on your country setting).
  • maxassoc 
    可選:最大的可鏈接客戶端。這個特性只在broadcom芯片組上可選。可選的: Maximum number of associated clients. This feature is supported only on the broadcom chipset.
  • distance 
    可選的: Distance between the ap and the furthest client in meters. This feature is supported only on the atheros chipset.
  • mode 
    The frequency band (b, g, bg, a). This feature is only supported on the atheros chipset.
  • diversity 
    可選的: Enable diversity for the Wi-Fi device. This feature is supported only on the atheros chipset.
  • rxantenna 
    可選的: Antenna identifier (0, 1 or 2) for reception. This feature is supported by atheros and some broadcom chipsets.
  • txantenna 
    可選的: Antenna identifier (0, 1 or 2) for emission. This feature is supported by atheros and some broadcom chipsets.
  • txpowerSet the transmission power to be used. The amount is specified in dBm.

wifi-iface的配置: Options for the wifi-iface :

    • network 
      選擇/etc/config/network中的接口段 Selects the interface section from /etc/config/networkto be used with this interface
    • device 
      設置設備名稱Set the wifi device name.
    • mode 
      可選模式:Operating mode:
      • ap 
        接入點模式Access point mode
      • sta 
        客戶端模式Client mode
      • adhoc 
        Ad-Hoc mode
      • monitor 
        監控模式Monitor mode
      • wds 
        WDS點對點鏈接 WDS point-to-point link
    • ssid 設置wifi設備使用的SSID Set the SSID to be used on the wifi device.
    • bssid設置BSSID 地址用來設置wds的mac地址。Set the BSSID address to be used for wds to set the mac address of the other wds unit.
    • txpower(Deprecated, set in wifi-device) Set the transmission power to be used. The amount is specified in dBm.
    • encryption 
      加密設置。可設置爲如下值:Encryption setting. Accepts the following values:
      • none
      • wep
      • psk, psk2 
        WPA(2) Pre-shared Key
      • wpa, wpa2 
        WPA(2) RADIUS
    • key, key1, key2, key3, key4(wep, wpa and psk) 
      WEP key, WPA key (PSK mode) or the RADIUS shared secret (WPA RADIUS mode)
    • server(wpa) 
      The RADIUS server ip address
    • port(wpa) 
      The RADIUS server port (defaults to 1812)
    • hidden 
      0 broadcasts the ssid; 1 disables broadcasting of the ssid
    • isolate 可選的: Isolation is a mode usually set on hotspots that limits the clients to communicate only with the AP and not with other wireless clients. 0 disables ap isolation (default); 1 enables ap isolation.
相關文章
相關標籤/搜索