wpa_supplicant 的配置说明文件 wpa_suppl

2020-06-09  本文已影响0人  iOSDevLog

wpa_supplicant 配置文件的例子

#updata_config=1
ctrl_interface=/var/run/wpa_spplicant
eapol_version=1
ap_scan=1
user_mpm=1
max_peer_link=99
mesh_max_inactivity=300
cert_in_cb=1
fast_reauth=1
//激活opensc工具
opensc_engine_path=/usr/lib/opensc/engine_opensc.so
//激活pkcs11工具
pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so
//通过 pkcs11工具配置pkcs11模块请求路径
pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so
openssl_chipers=DEFAULT:!EXP:!LOW
load_dynamic_eap=/usr/lib/wpa_supplicant/eap_tls.so
load_dynamic_eap=/usr/lib/wpa_supplicant/eap_md5.so
driver_param="field=value"
country=US
//PMKSA最大的存活时间(秒);默认为43200
dot11RSNAConfigPMKLifetime=43200
//重认证的阈值(PMK存活时间的百分比);默认为70
dot11RSNAConfigPMKReauthThreshold=70
//安全关联协议的超时时间(秒);默认为60
dot11RSNAConfigSATimeout=60
uuid=12345678-91bc-def0-1234-56789abcdef0
//设备名称
//对设备使用友好的描述;UTF-8编码的32个字节
device_name=Wireless Client
//制造商
//设备的制造商(64个ASCII特征码)
manufacturer=Company
//型号
//设备型号(32个ASCII特征码)
model_name=cmodel
//型号编号
//额外的设备描述(32个ASCII特征码)
model_number=123
//序列号
//设备的序列号(32个ASCII特征码)
serial_number=12345
device_type=1-0050F204-1
os_version=01020300
//对于 WSC 1.0
//配置方法=标签、显示、按钮、键盘
config_methods=label display push_button keypad
//对于 WSC 2.0
//配置方法=标签、虚拟显示、虚拟按钮、键盘
config_methods=label virtual_display virtual_push_button keypad
wps_cred_processing=0
wps_vendor_ext_m1=000137100100020001
wps_nfc_dev_pw_id: Device Password ID (16..65535)
wps_nfc_dh_pubkey: Hexdump of DH Public Key
wps_nfc_dh_privkey: Hexdump of DH Private Key
wps_nfc_dev_pw: Hexdump of Device Password
wps_priority=0
bss_max_count=200
filter_ssids=0
ext_password_backend=test:pw1=password|pw2=testing
p2p_disabled=1
p2p_go_max_inactivity=300
p2p_passphrase_len=8
p2p_search_delay=500
okc=0
pmf=0
sae_groups=21 20 19 26 25
//DTIM周期的默认值(如果没有在网络语句块中被重写)
dtim_period=2
//信标间隔的默认值(如果没有在网络语句块中被重写)
beacon_int=100
ap_vendor_elements=dd0411223301
ignore_old_scan_res=0
mac_addr=0
rand_addr_lifetime=60
preassoc_mac_addr=0
interworking=1
hessid=00:11:22:33:44:55
auto_interworking=0

通过从客户端认证中退出,windows下的认证储存可以被使用,并且私人密匙可以通过以下格式配置:
cert://substring_to_match
hash://certificate_thumbprint_in_hex

举个例子:private_key=”hash://63093aa9c47f56ae88334c7b65a4
注意当将wpa_supplicant作为应用运行时,用户认证储存区(自己的用户账户)将被使用。而当运行wpasvc作为服务端时计算机储存区(计算机账户)将被使用。
另外,一个blob的配置可以将此设置为blob://blob_name

min_dl_bandwidth_home
min_ul_bandwidth_home
min_dl_bandwidth_roaming
min_ul_bandwidth_roaming
req_conn_capab=6,22,80,443
For example, IPSec/IKE:
req_conn_capab=17:500
req_conn_capab=50

下面对语句块举例子:

cred={
    realm="example.com"
    username="user@example.com"
    password="password"
    ca_cert="/etc/wpa_supplicant/ca.pem"
    domain="example.com"
}
cred={
    imsi="310026-000000000"
    milenage="90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82"
}
cred={
    realm="example.com"
    username="user"
    password="password"
    ca_cert="/etc/wpa_supplicant/ca.pem"
    domain="example.com"
    roaming_consortium=223344
    eap=TTLS
    phase2="auth=MSCHAPV2"
}

网络语句块

-网络语句块字段:

ieee80211w:是否激活包含管理机制

auth_alg:允许的IEEE 802.11 认证算法列表

pairwise : WPA点对点(单播)支持的密码表格

group:组(广播/组播)支持的密码列表

psk: WPA预共享密码;256位预共享密码

** eapol_flags: IEEE 802.1X/EAPOL 选项(bit field位字段)**

macsec_policy:EEE 802.1X/MACsec options选项

mixed_cell : 这个选项可以被用于配置是否为所谓的混杂单元,即一个同样的SSID 网络使用明码和加密密匙

proactive_key_caching:

wep_key0..3:静态WEP密码(双精度ASCII引用,比如“abcd”;或者没有引用的十六进制数,比如“012345678”)

peerkey:是否允许直接连接的peerkey协议(IEEE 802.11e DLS),这个只用于 RSN/WPA2

wpa_ptk_rekey:PTK最大的存活时间(秒),这个选项可以被用于配置执行PTK密匙更新来缓解因为TKIP缺陷而受到的攻击

以下字段值用于内部EAP实施。

identity:EAP的字符标识符

anonymous_identity : EAP的匿名标识符字符串(被用于支持不同的标识符隧道的非加密EAP类型的标识符,比如,EAP-TTLS)。这个字段也可以被用于EAP-SIM/AKA/AKA’保存匿名标识符
password: EAP的密码字符串。这个字段既可以包含纯文本密码字符串(使用ASCII或者十六进制字符串)也可以一个使用hash:<32 hex digits>格式的NtPasswordHash(16字节MD4 哈希密码)

client_cert : 客户端认证文件的路径(PEM/DER)

domain_suffix_match:域名服务器名称的规则

phase1 : 阶段一(外部认证:即TLS隧道)参数(成对的字段字符,比如:”peapver=0” 或者”peapver=1 peaplabel=1”)

phase2 : 阶段二(TLS隧道的内部认证)参数(string with field-value pairs, e.g., “auth=MSCHAPV2” for EAP-PEAP or”autheap=MSCHAPV2 autheap=MD5” for EAP-TTLS)

TLS-based 方法可以用以下参数来控制TLS行为(这个通常是下第一阶段的参数,但是也可以当EAP-TLS在内部隧道使用时 被用在第二阶段)

以下认证/私人密匙字段将在使用EAP-TTLS 或者 EAP-PEAP 时内部第二阶段认证使用

EAP-FAST 变量

wpa_supplicant允许的最大的一些围绕解决认证服务器的错误交互操作的问题工作的“EAP workaround”数量,因为目前认证服务器存在大量的某些问题,所以这些选项默认激活的。严格的一致性EAP模式可以通过使用选项eap_workaround=0 取消工作区来配置

活动站点的限制

disable_ht : 是否取消HT (802.11n)


支持快速会话转移

接口所属的FST标志组

FST组的接口优先级


以下为网络语句块的例程:

简单的案例: WPA-PSK, PSK ASCII密文,允许所有有效密码

network={
    ssid="simple"
    psk="very secret passphrase"
    priority=5
}

和以上类似,增加了请求SSID的特定扫描(用于拒绝广播SSID 的APs)

network={
    ssid="second ssid"
    scan_ssid=1
    psk="very secret passphrase"
    priority=2
}

只在WPA-PSK时使用,接受任何可用的密码组合

network={
    ssid="example"
    proto=WPA
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    group=CCMP TKIP WEP104 WEP40
    psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
    priority=2
}

使用TKIP加密算法的WPA-Personal(PSK),并且强制频繁地重置PTK密码

network={
    ssid="example"
    proto=WPA
    key_mgmt=WPA-PSK
    pairwise=TKIP
    group=TKIP
    psk="not so secure passphrase"
    wpa_ptk_rekey=600
}

当使用WPA-EAP时。允许CCMP和TKIP加密算法。使用WEP104或者WEP40作为组密码将不会被接受

network={
    ssid="example"
    proto=RSN
    key_mgmt=WPA-EAP
    pairwise=CCMP TKIP
    group=CCMP TKIP
    eap=TLS
    identity="user@example.com"
    ca_cert="/etc/cert/ca.pem"
    client_cert="/etc/cert/user.pem"
    private_key="/etc/cert/user.prv"
    private_key_passwd="password"
    priority=1
}

使用新的peaplabel标签来进行RADIUS 服务器的EAP-PEAP/MSCHAPv2 配置(例如,辐射器)

network={
    ssid="example"
    key_mgmt=WPA-EAP
    eap=PEAP
    identity="user@example.com"
    password="foobar"
    ca_cert="/etc/cert/ca.pem"
    phase1="peaplabel=1"
    phase2="auth=MSCHAPV2"
    priority=10
}

使用非加密的匿名标志的EAP-TTLS/EAP-MD5-Challenge配置,真实的标识符只在加密的TLS隧道上发送

network={
    ssid="example"
    key_mgmt=WPA-EAP
    eap=TTLS
    identity="user@example.com"
    anonymous_identity="anonymous@example.com"
    password="foobar"
    ca_cert="/etc/cert/ca.pem"
    priority=2
}

使用非加密的匿名标志的EAP-TTLS/MSCHAPv2配置,真实的标识符只在加密的TLS隧道上发送

network={
    ssid="example"
    key_mgmt=WPA-EAP
    eap=TTLS
    identity="user@example.com"
    anonymous_identity="anonymous@example.com"
    password="foobar"
    ca_cert="/etc/cert/ca.pem"
    phase2="auth=MSCHAPV2"
}

用不同的CA认证证书搭建WPA-EAP, EAP-TTLS 外部和内部认证

network={
    ssid="example"
    key_mgmt=WPA-EAP
    eap=TTLS
    # Phase1 / outer authentication
    anonymous_identity="anonymous@example.com"
    ca_cert="/etc/cert/ca.pem"
    # Phase 2 / inner authentication
    phase2="autheap=TLS"
    ca_cert2="/etc/cert/ca2.pem"
    client_cert2="/etc/cer/user.pem"
    private_key2="/etc/cer/user.prv"
    private_key2_passwd="password"
    priority=2
}

支持WPA-PSK 和 WPA-EAP。只有接受CCMP作为成对分组密码

network={
    ssid="example"
    bssid=00:11:22:33:44:55
    proto=WPA RSN
    key_mgmt=WPA-PSK WPA-EAP
    pairwise=CCMP
    group=CCMP
    psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
}

SSID 中的特殊字符,使用十六进制。默认为WPA-PSK,WPA-EAP和所有可用的密文

network={
    ssid=00010203
    psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
}

GSM SIM 或者 USIM 的EAP-SIM

network={
    ssid="eap-sim-test"
    key_mgmt=WPA-EAP
    eap=SIM
    pin="1234"
    pcsc=""
}

EAP-PSK

network={
    ssid="eap-psk-test"
    key_mgmt=WPA-EAP
    eap=PSK
    anonymous_identity="eap_psk_user"
    password=06b4be19da289f475aa46a33cb793029
    identity="eap_psk_user@example.com"
}

IEEE 802.1x/eapol动态生成WEP密钥(即没有WPA)使用EAP-TLS认证和密钥生成;需要单播和广播WEP密钥。

network={
    ssid="1x-test"
    key_mgmt=IEEE8021X
    eap=TLS
    identity="user@example.com"
    ca_cert="/etc/cert/ca.pem"
    client_cert="/etc/cert/user.pem"
    private_key="/etc/cert/user.prv"
    private_key_passwd="password"
    eapol_flags=3
}

LEAP动态WEP密匙

network={
    ssid="leap-example"
    key_mgmt=IEEE8021X
    eap=LEAP
    identity="user"
    password="foobar"
}

EAP-IKEv2 使用为服务器和对等认证共享密码

network={
    ssid="ikev2-example"
    key_mgmt=WPA-EAP
    eap=IKEV2
    identity="user"
    password="foobar"
}

EAP-FAST with WPA (WPA or WPA2)

network={
    ssid="eap-fast-test"
    key_mgmt=WPA-EAP
    eap=FAST
    anonymous_identity="FAST-000102030405"
    identity="username"
    password="password"
    phase1="fast_provisioning=1"
    pac_file="/etc/wpa_supplicant.eap-fast-pac"
}
network={
    ssid="eap-fast-test"
    key_mgmt=WPA-EAP
    eap=FAST
    anonymous_identity="FAST-000102030405"
    identity="username"
    password="password"
    phase1="fast_provisioning=1"
    pac_file="blob://eap-fast-pac"
}

纯文本连接(no WPA, no IEEE 802.1X)

network={
    ssid="plaintext-test"
    key_mgmt=NONE
}

** Shared WEP key connection共享WEP密匙连接(no WPA, no IEEE 802.1X)**

network={
    ssid="static-wep-test"
    key_mgmt=NONE
    wep_key0="abcde"
    wep_key1=0102030405
    wep_key2="1234567890123"
    wep_tx_keyidx=0
    priority=5
}

Shared WEP key connection共享WEP密匙连接(no WPA, no IEEE 802.1X) 使用IEEE 802.11 认证共享密匙

network={
    ssid="static-wep-test2"
    key_mgmt=NONE
    wep_key0="abcde"
    wep_key1=0102030405
    wep_key2="1234567890123"
    wep_tx_keyidx=0
    priority=5
    auth_alg=SHARED
}

IBSS/ad-hoc network with RSN

network={
    ssid="ibss-rsn"
    key_mgmt=WPA-PSK
    proto=RSN
    psk="12345678"
    mode=1
    frequency=2412
    pairwise=CCMP
    group=CCMP
}

IBSS/ad-hoc network with WPA-None/TKIP (deprecated已经过时了的)

network={
    ssid="test adhoc"
    mode=1
    frequency=2412
    proto=WPA
    key_mgmt=WPA-NONE
    pairwise=NONE
    group=TKIP
    psk="secret passphrase"
}

开放匹配的网络

network={
    ssid="test mesh"
    mode=5
    frequency=2437
    key_mgmt=NONE
}

secure (SAE + AMPE) network

network={
    ssid="secure mesh"
    mode=5
    frequency=2437
    key_mgmt=SAE
    psk="very secret passphrase"
}

涵盖所有允许更多或者更少的配置模式的案例

network={
    ssid="example"
    scan_ssid=1
    key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
    pairwise=CCMP TKIP
    group=CCMP TKIP WEP104 WEP40
    psk="very secret passphrase"
    eap=TTLS PEAP TLS
    identity="user@example.com"
    password="foobar"
    ca_cert="/etc/cert/ca.pem"
    client_cert="/etc/cert/user.pem"
    private_key="/etc/cert/user.prv"
    private_key_passwd="password"
    phase1="peaplabel=0"
}

EAP-TLS智能卡的案例(openssl的工具)

network={
    ssid="example"
    key_mgmt=WPA-EAP
    eap=TLS
    proto=RSN
    pairwise=CCMP TKIP
    group=CCMP TKIP
    identity="user@example.com"
    ca_cert="/etc/cert/ca.pem"
    client_cert="/etc/cert/user.pem"

    engine=1
    //这里配置的工具必须是可用的。在全局选项中查看openssl支持的工具。
    //通过该引擎的密钥必须和配置上述的客户端证书的私钥匹配

    //使用opensc工具
    //engine_id="opensc"
    //key_id="45"

    //使用pkcs11 工具
    engine_id="pkcs11"
    key_id="id_45"

    //PIN可选的配置,这个选项可以被遗漏并且PIN将会被控制接口请求
    pin="1234"

如何使用内联blob作为CA认证证书的数据取代使用外部文件来配置的案例

network={
    ssid="example"
    key_mgmt=WPA-EAP
    eap=TTLS
    identity="user@example.com"
    anonymous_identity="anonymous@example.com"
    password="foobar"
    ca_cert="blob://exampleblob"
    priority=20
}
blob-base64-exampleblob={
SGVsbG8gV29ybGQhCg==
}

对于SSID通配符的匹配(只支持纯文本APs)在本例中无论SSID为和都选择任何开放的AP

network={
    key_mgmt=NONE
}

配置两个在这个网络中会被忽略的APs 黑名单

network={
    ssid="example"
    psk="very secret passphrase"
    bssid_blacklist=02:11:22:33:44:55 02:22:aa:44:55:66
}

该案例配置了AP选择时指定特定APs的限制;任何其他不匹配掩码地址的AP将会被忽略

network={
    ssid="example"
    psk="very secret passphrase"
    bssid_whitelist=02:55:ae:bc:00:00/ff:ff:ff:ff:00:00 00:00:77:66:55:44/00:00:ff:ff:ff:ff
}

只扫描通道36 的配置案例

freq_list=5180
network={
    key_mgmt=NONE
}

MACsec配置案例

network={
    key_mgmt=IEEE8021X
    eap=TTLS
    phase2="auth=PAP"
    anonymous_identity="anonymous@example.com"
    identity="user@example.com"
    password="secretr"
    ca_cert="/etc/cert/ca.pem"
    eapol_flags=0
    macsec_policy=1
}

原文:https://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf

上一篇 下一篇

猜你喜欢

热点阅读