在802.1x企业网络中,我可以使用NetworkManager配置802.1x参数,包括密码。这一切都能工作,但需要将密码存储在明文中。
我们试图使用Netplan来更安全地存储凭据(作为散列密码),但不能使802.1x连接进行身份验证。
我还没有找到构建包含802.1x凭据的Netplan配置的好指南。
(更新: Netplan中有一个关于散列密码( https://github.com/CanonicalLtd/netplan/pull/78)的错误,这似乎是主要问题)
以下是一个无法工作的文件
network:
version: 2
renderer: networkd
ethernets:
enp0s31f6:
auth:
key-management: 802.1x
password: hash:some-stuff-here
method: peap
identity: ghewett
dhcp4: false
addresses:
- 1.2.3.4
gateway4: 5.6.7.8
nameservers:
search: [cisco.com, otherdomain]
addresses:
- 1.1.1.1
- 2.2.2.2(IP和凭据已更改)
这给了我们
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:19354): DEBUG: 09:23:41.614: Processing input file /etc/netplan/01-netcfg.yaml..
** (generate:19354): DEBUG: 09:23:41.614: starting new processing pass
Error in network definition /etc/netplan/01-netcfg.yaml line 7 column 6: unknown key auth发布于 2019-03-09 01:12:13
请参阅https://netplan.io/examples,https://netplan.io站点一般都有很好的信息。确保sudo netplan --debug generate检查.yaml文件,并生成配置文件,然后使用sudo netplan apply使它们处于活动状态。
Authentication
Netplan supports advanced authentication settings for ethernet and wifi interfaces, as well as individual wifi networks, by means of the auth block.
auth (mapping)
Specifies authentication settings for a device of type ethernets:, or an access-points: entry on a wifis: device.
The auth block supports the following properties:
key-management (scalar)
The supported key management modes are none (no key management); psk (WPA with pre-shared key, common for home wifi); eap (WPA with EAP, common for enterprise wifi); and 802.1x (used primarily for wired Ethernet connections).
password (scalar)
The password string for EAP, or the pre-shared key for WPA-PSK.
The following properties can be used if key-management is eap or 802.1x:
method (scalar)
The EAP method to use. The supported EAP methods are tls (TLS), peap (Protected EAP), and ttls (Tunneled TLS).
identity (scalar)
The identity to use for EAP.
anonymous-identity (scalar)
The identity to pass over the unencrypted channel if the chosen EAP method supports passing a different tunnelled identity.
ca-certificate (scalar)
Path to a file with one or more trusted certificate authority (CA) certificates.
client-certificate (scalar)
Path to a file containing the certificate to be used by the client during authentication.
client-key (scalar)
Path to a file containing the private key corresponding to client-certificate.
client-key-password (scalar)
Password to use to decrypt the private key specified in client-key if it is encrypted.来源:https://netplan.io/reference#authentication
注意:确保您的.yaml文件中没有选项卡.
加入你的证书,恢复IP,然后试试这个.
network:
version: 2
renderer: networkd
ethernets:
enp0s31f6:
auth:
key-management: 802.1x
method: peap
identity: "ghewett@example.com"
ca-certificate: my_ca.pem
client-certificate: my_cert.pem
client-key: my_key.pem
addresses:
- 1.2.3.4
gateway4: 5.6.7.8
nameservers:
search: [cisco.com, otherdomain]
addresses:
- 1.1.1.1
- 2.2.2.2发布于 2019-03-15 04:59:31
Ubuntu18.04.02附带的默认网络计划不支持有线身份验证,因此不可能工作。github上的最新版本在2019年3月初确实支持身份验证,但它缺少所需的其他内容。WPA请求者需要一个CLI标志来使用有线驱动程序来工作,我编写了一个PR来将它添加到netplan中。Netplan还以破解密码的方式处理散列密码,因此还有另一个PR来解决这个问题。
如果您想尝试这些,PR,说明如下:
network:
version: 2
ethernets:
enp0s31f6:
dhcp4: true
optional: true
auth:
key-management: 802.1x
wired: true
method: ttls
identity: fluffy@cisco.com
password: hash:83...11它应该看起来像
ctrl_interface=/run/wpa_supplicant
network={
key_mgmt=IEEE8021X
eap=TTLS
identity="fluffy@cisco.com"
password=hash:83..11
}如果使用散列密码,请确保密码周围没有引号。
它应该会返回类似的东西
/run/systemd/system/systemd-networkd.service.wants/netplan-wpa-wired@enp4s0.service
关键是要检查它是否是wpa-有线的。
您将看到关于802.1x消息的信息流,最后应该有一个“身份验证成功”
你得杀了它。
https://askubuntu.com/questions/1124164
复制相似问题