debian网络认证801.2配置方法

debian的802.1认证网络设置:

/etc/wpa_supplicant/wired_connection.conf :

ap_scan=0
ctrl_interface=/var/run/wpa_supplicant
network={
    proto=WPA
    key_mgmt=IEEE8021X
    pairwise=TKIP
    group=TKIP
    eap=PEAP
        eapol_flags=0
    identity="username"
    password="passwd"
    phase1="peaplabel=0"
    phase2="auth=MSCHAPV2"
}

/etc/network/interfaces:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
pre-up wpa_supplicant -B -c/etc/wpa_supplicant/wired_connection.conf -ieth0 -Dwired&> /dev/null

(最后一句的意思为在ifce前先认证)

 

然后:killall wpa_supplicant ;

         sudo /etc/init.d/networking restart

 

有时候开机后,偶尔会认证不成功,可以直接运行以下脚本:

#!/bin/sh
killall wpa_supplicant
ifdown eth0
wpa_supplicant -B -D wired -i eth0 -c /etc/wpa_supplicant/wired_connection.conf &> /dev/null
ifup eth0
dhclient3 eth0

 

 

你可能感兴趣的:(C++,c,Debian,脚本,C#)