简体   繁体   English

有没有人成功地将 MAC 连接到 Azure P2S 网络网关? 没有任何文档对我有用

[英]Has anyone ever successfully connected a MAC to an Azure P2S network gateway? None of the documentation works for me

Starting with an empty directory:从一个空目录开始:

  1. Generate CAroot private key生成 CAroot 私钥
$ openssl genrsa -aes256 -out dcsAzureVPN.key 2048
  1. Generate a CARoot certificate生成 CARoot 证书
$ openssl req -x509 -sha256 -new -key dcsAzureVPN.key -out dcsAzureVPN.cer -days 1825 -subj /CN="dcsAzureVPN"`
  1. Successfully copied dcsAzureVPN.cer to VPN gateway and saved (see attached screenshot)成功将dcsAzureVPN.cer复制到 VPN 网关并保存(见附件截图)

  2. Generate Certificate Request (CSR)生成证书请求 (CSR)

$ openssl genrsa -out dcsAzureClientCert.key 2048
$ openssl req -new -out tjaClientCert.req -key dcsAzureClientCert.key -subj /CN="dcsAzureVPN"`
  1. Generate signed Client Certificate from CSR从 CSR 生成签名的客户端证书
$ openssl x509 -req -sha256 -in tjaClientCert.req -out dcsAzureClientCert.cer -CAkey dcsAzureVPN.key -CA dcsAzureVPN.cer -days 1825 -CAcreateserial -CAserial serial 
Signature ok
    subject=/CN=dcsAzureVPN
  1. Pack key and certificate in.pfx format将密钥和证书打包成 .pfx 格式
$ openssl pkcs12 -export -out dcsAzureVPNClient.pfx -inkey dcsAzureClientCert.key -in dcsAzureClientCert.cer -certfile dcsAzureVPN.cer
  1. Copy client cert to my Keychain将客户端证书复制到我的钥匙串

  2. Make dcsAzure VPN a trusted cert.使 dcsAzure VPN 成为受信任的证书。

  3. Select dcsAzureVPN as the client certificate for my VPN connection Select dcsAzureVPN 作为我的 VPN 连接的客户端证书

  4. Try to connect.尝试连接。 Connection fails with an error: User Authentication failed连接失败并出现错误:用户身份验证失败

What am I doing wrong?我究竟做错了什么?

You have to manually configure the native IKEv2 VPN client on every Mac that will connect to Azure.您必须在将连接到 Azure 的每台 Mac 上手动配置本机 IKEv2 VPN 客户端。 You could use these steps to configure the native VPN client on Mac for certificate authentication.您可以使用这些步骤在 Mac 上配置本机 VPN 客户端以进行证书身份验证。

Moreover, you could refer to this to troubleshoot Point-to-Site VPN connections from Mac OS X VPN clients.此外,您可以参考内容来解决来自 Mac OS X VPN 客户端的点到站点 VPN 连接问题。

Additionally, no matter what client OS you want to connect from, you must always have a client certificate.此外,无论您想从哪个客户端操作系统进行连接,都必须始终拥有客户端证书。 You can generate a client certificate from either a root certificate that was generated using an Enterprise CA solution or a self-signed root certificate.您可以从使用企业 CA 解决方案生成的根证书或自签名根证书生成客户端证书。 See the PowerShell , MakeCert , or Linux instructions for steps to generate a client certificate.有关生成客户端证书的步骤,请参阅PowerShellMakeCertLinux说明。

Please let me know if this works.请让我知道这是否有效。

I finally found the problem.我终于找到了问题所在。 It turns out the Local ID has to match the client certificate subject, not the name of your client certificate file.事实证明,本地 ID 必须匹配客户端证书主题,而不是客户端证书文件的名称。

Whoever stumbles up on this solution: It is working if you change the Client certificate's subj from dcsAzureVPN to (for example) dcsAzureVPNSubj and use it in the connection tab for Local ID.谁偶然发现了这个解决方案:如果您将客户端证书的主题从 dcsAzureVPN 更改为(例如)dcsAzureVPNSubj 并在本地 ID 的连接选项卡中使用它,它就可以工作。

So instead of this:所以代替这个:

openssl req -new -out tjaClientCert.req -key dcsAzureClientCert.key -subj /CN="dcsAzureVPN"

Use this:用这个:

openssl req -new -out tjaClientCert.req -key dcsAzureClientCert.key -subj /CN="dcsAzureVPNSubj"

and use the dcsAzureVPNSubj for Local id on the MacOS VPN connection tab.并在 MacOS VPN 连接选项卡上使用 dcsAzureVPNSubj 作为本地 ID。

Worked on the following machine: 20.5.0 Darwin Kernel Version 20.5.0: root:«gibberish»/RELEASE_ARM64_T8101 arm64 Big Sur version: 11.4在以下机器上工作:20.5.0 Darwin Kernel 版本 20.5.0:root:«gibberish»/RELEASE_ARM64_T8101 arm64 Big Sur 版本:11.4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有人成功在MAC上安装了RIDE吗? - Anyone successfully installed RIDE on MAC? 使用Cocoa / Objective-C,获取Mac OS X中当前连接的网络的安全类型 - Using Cocoa / Objective-C, get currently connected network's security type in Mac OS X 有没有人成功地将Cocoapods与OSX Server 3.2及更高版本一起使用? - Has anyone successfully used Cocoapods with OSX Server 3.2 and above? 有没有人在Snow Leopard中成功构建了PyObjC应用程序? - Has anyone successfully built a PyObjC app in Snow Leopard? 如何确定Mac连接到的网络是WiFi还是有线网络等 - How to figure out if the network the mac is connected to is a WiFi or cable network or the like 使用AVFoundation的文档在Mac中进行屏幕录制 - Screen Recording in Mac using AVFoundation's documentation 如何以编程方式检查Mac是否已连接到Wi-Fi网络? - How to programmatically check if Mac is connected to Wi-Fi network? 为 my.network 中所有连接的计算机获取 IP、MAC 和主机名 - Get IP, MAC and hostname for all connected computers in my network 如果textarea的父级都没有固定大小,为什么textarea不接受相对字体大小? (Firefox 18.0 Mac) - Why does textarea not accept relative font-size if none of it's parent has fixed size? (Firefox 18.0 Mac) 如何通过VNET网关从Mac RDP到Azure VM - How to rdp from mac to azure vm through vnet gateway
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM