azure - 无法使用容器技术预览版 4 在 azure windows server 2016 core 中创建 NetNatStaticMapping

标签 azure azure-powershell

我正在尝试使用此博客https://blogs.msdn.microsoft.com/msgulfcommunity/2015/09/07/why-windows-server-containers-and-why-you-need-to-look-at-containers-hands-on/创建iis容器

但是当我尝试使用添加 NetNatStaticMapping 时:

Add-NetNatStaticMapping -NatName “ContainerNAT” -Protocol TCP -ExternalIPAddress 0.0.0.0 -InternalIPAddress 172.17.0.5 -InternalPort 80 -ExternalPort 80

它显示以下错误。

Add-NetNatStaticMapping:找不到实例 Nat ContainerNAT 行:1 字符:1 + 添加-NetNatStaticMapping -NatName“ContainerNAT”-协议(protocol) TCP -Extern ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ + 类别信息:ObjectNotFound:(MSFT_NetNatStaticMapping:root/StandardCi...atStaticMapping) [Add-NetNat 静态映射],CimException + FullQualifiedErrorId:Windows 系统错误 1168,Add-NetNatStaticMapping

最佳答案

我通过观察找到了解决方案。

ContainerNAT Nat 实例存在于“带有容器的 Windows Server 2016”中,因此无需创建具有相同名称的 Nat 实例,并且容器应附加到虚拟交换机,即已经存在于服务器中。

提供给-InternalIPAddress参数的IP应在虚拟交换机范围内。

关于azure - 无法使用容器技术预览版 4 在 azure windows server 2016 core 中创建 NetNatStaticMapping,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37023631/

相关文章:

azure - 获取 azure powershell 上标签以(或包含)特定字符串开头的所有资源 - Azure Powershell

azure - 如何在 Windows Azure 应用程序中使用通配符子域?

用于容器的 Azure 监视器与应用程序洞察

php - 使用任务计划程序运行 PHP 脚本时出现问题 (Windows Server 2008 R2)

.net - 获取 AzureRmResource : A parameter cannot be found that matches parameter name 'Tag'

powershell - 获取Azure VM的存储帐户

.net - AppDomainUnloadedException - 如何调试?

azure - 是否可以使用内置 blob 触发器为每个新 blob 触发逻辑应用程序?

azure - 从 Azure PowerShell 获取 "PRIMARY STATIC WEBSITE ENDPOINT"

azure - 如何仅获取 Azure key 保管库的部分 Powershell 输出?