802.1x网络认证

IEEE 802.1x是网络认证主机的标准,通常在大型网络,如校园网络或公司网络中使用,用于无线或有线网络认证。

在配置无线网络时候,需要使用以下工具命令:

  • wpa_supplicant - wpa_supplicant是支持使用WPA和WPA2(IEEE 802.11i/RSN)协议的的Linux, BSD, Mac OS X,Windows工具命令。

  • iw

  • ip

  • ping

软件包安装

Linux使用wpa_supplicant软件来实现 802.1x认证。在Ubuntu中,需要安装wpasupplicant

apt install wpasupplicant

基本配置

  • 编辑/etc/wpa_supplicant.conf添加以下内容

# Where is the control interface located? This is the default path:
ctrl_interface=/var/run/wpa_supplicant

# Who can use the WPA frontend? Replace "0" with a group name if you
#   want other users besides root to control it.
# There should be no need to chance this value for a basic configuration:
ctrl_interface_group=0

# IEEE 802.1X works with EAPOL version 2, but the version is defaults 
#   to 1 because of compatibility problems with a number of wireless
#   access points. So we explicitly set it to version 2:
eapol_version=2

# When configuring WPA-Supplicant for use on a wired network, we don’t need to
#   scan for wireless access points. See the wpa-supplicant documentation if
#   you are authenticating through 802.1x on a wireless network:
ap_scan=0

无线网络配置

参考 Configuring 802.1X Authentication in Linux

  • 配置/etc/wpa_supplicant.conf添加

上述配置和在MacBook上安装Gentoo中有关配置802.1x相同,如果使用NetworkManager也可以参考Ubuntu Touch手机设置802.1x无线网络

启动无线:

无线认证通过后,启动dhclient

也可以重新加载 network 脚本

  • 上述手工执行任务成功以后,就可以修改成启动配置:修改/etc/network/interfaces

有线网络配置

以下案例为有线网络IEEE 802.1x,使用EAP-Tunnelled传输层安全,使用PAP和MD5作为认证协议,不使用证书:

测试网络:

连接Pretected EAP(PEAP)

参考How to connect to Protected EAP (PEAP) wifi via terminal

  • 修改/etc/network/interfaces

  • 执行以下命令连接

参考

Last updated

Was this helpful?