|
找遍整个论坛也没找到一份像样的OPENWRT无线配置说明!
怒了!
Wireless
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.
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.
The reason for using such architecture, is that it abstracts the driver configuration.
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"
Generic Atheros wireless config:
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"
Generic mac80211 wireless config:
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"
Generic multi-radio Atheros wireless config:
config wifi-device wifi0
option type atheros
option channel 1
config wifi-iface
option device wifi0
# option network lan
option mode ap
option ssid OpenWrt_private
option hidden 0
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 1
option encryption none
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 1
option key2 key 2
option key3 key 3
option key4 key 4
option server ip address
option port port
option hidden 0,1
option isolate 0,1
option doth 0,1 (atheros, broadcom)
option wmm 0,1 (atheros, broadcom)
Options for the wifi-device:
type
The driver to use for this interface.
country
The country code used to determine the regulatory settings.
channel
The wifi channel (e.g. 1-14, depending on your country setting).
maxassoc
Optional: Maximum number of associated clients. This feature is supported only on the broadcom chipset.
distance
Optional: 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
Optional: Enable diversity for the Wi-Fi device. This feature is supported only on the atheros chipset.
rxantenna
Optional: Antenna identifier (0, 1 or 2) for reception. This feature is supported by atheros and some broadcom chipsets.
txantenna
Optional: Antenna identifier (0, 1 or 2) for emission. This feature is supported by atheros and some broadcom chipsets.
txpower Set the transmission power to be used. The amount is specified in dBm.
Options for the wifi-iface:
network
Selects the interface section from /etc/config/network to 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 point-to-point link
ssid Set the SSID to be used on the wifi device.
bssid 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
Optional: 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.
doth
Optional: Toggle 802.11h mode. 0 disables 802.11h (default); 1 enables it.
wmm
Optional: Toggle 802.11e mode. 0 disables 802.11e (default); 1 enables it.
Wireless Distribution System WDS is a non-standard mode which will be working between two Broadcom devices for instance but not between a Broadcom and Atheros device.
Unencrypted WDS connections This configuration example shows you how to setup unencrypted WDS connections. We assume that the peer configured as below as the BSSID ca:fe:ba:be:00:01 and the remote WDS endpoint ca:fe:ba:be:00:02 (option bssid field).
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"
config wifi-iface
option device "wl0"
option network lan
option mode wds
option ssid "OpenWrt WDS"
option bssid "ca:fe:ba:be:00:02"
Encrypted WDS connections It is also possible to encrypt WDS connections. psk, psk2 and psk+psk2 modes are supported. Configuration below is an example configuration using Pre-Shared-Keys with AES algorithm.
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 encryption psk2
option key " for clients>"
config wifi-iface
option device "wl0"
option network lan
option mode wds
option bssid ca:fe:ba:be:00:02
option ssid "OpenWrt WDS"
option encryption psk2
option key " for WDS>"
802.1x configurations OpenWrt supports both 802.1x client and Access Point configurations. 802.1x client is only working with Atheros or mac80211 drivers. Configuration only supports EAP types TLS, TTLS or PEAP.
EAP-TLS
config wifi-iface
option device "ath0"
option network lan
option ssid OpenWrt
option eap_type tls
option ca_cert "/etc/config/certs/ca.crt"
option priv_key "/etc/config/certs/priv.crt"
option priv_key_pwd "PKCS#12 passphrase"
EAP-PEAP
config wifi-iface
option device |
|