2014-02-26 146 views
0

我发现这个页面"Create Firewall Rule",它假设显示设置一个VM服务器级防火墙。如何在Azure虚拟机上设置服务器级别的防火墙?

但是,文档中的URL模式包括 “SQLSERVER”:https://management.core.windows.net:8443/{subscriptionId}/services/sqlservers/servers/{serverName}/firewallrules

  1. 这是否意味着只有SQLServers防火墙可配置?
  2. 是否有另一种使用REST API配置服务器级VM的方法?
  3. Azure中是否存在类似于EC2 "Instance Metadata and User Data"的东西,我可以使用它将虚拟机引导程序注入我的脚本,以便我可以从内部配置防火墙?

编辑

我查了内置防火墙是处于打开状态,我可以使用“远程登录XXX.XXX.XXX.XXX 5986” 这是我得到的错误连接服务时,我运行:

>Test-WSMan XXX.XXX.XXX.XXX 

Test-WSMan : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150859046" 
Machine="WIN-HAPHAM5EH3M"><f:Message>WinRM cannot complete the operation. 
Verify that the specified computer name is valid, that the computer is accessible 
over the network, and that a firewall exception for the WinRM service is enabled and 
allows access from this computer. By default, the WinRM firewall exception for public 
profiles limits access to remote computers within the same local subnet. </f:Message></f:WSManFault> 
At line:1 char:1 
+ Test-WSMan XXX.XXX.XXX.XXX 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (XXX.XXX.XXX.XXX:String) [Test-WSMan], InvalidOperationException 
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand 

回答

0
  1. 的SQL天青 “防火墙” 是从VM防火墙不同;它只是提供了可以连接到SQL Server数据库的允许的IP列表。这是在Azure门户中找到的相同选项。

  2. 还有VM PowerShell CmdLets(使用REST API)来控制端点ACL - 默认情况下,您的VM不能访问Internet(除管理端口外)。

https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-acl-powershell/

+0

是的,我知道端点,我在创建虚拟机时就设置了它。我的问题是关于服务器级别,这意味着Windows内置的防火墙。 –

0
  1. 资源URI {} subscriptionId /服务/ sqlservers /服务器/ {} SERVERNAME/firewallrules 指ACL的SQL服务器上。这仅适用于SQL Azure。 如果您需要VM上的相同功能,您需要查看网络安全组(NSG)。您可以使用这些来限制对虚拟机或子网的访问。

  2. REST apis用于管理平面操作,即事件发生在虚拟机之外。您可以使用它来更改NSG,但不能更改内部防火墙。 (除非您使用它来启动一些其他机制)

  3. 如果要在Windows Server VM中管理防火墙规则,可以在部署时使用脚本,DSC,组策略或PowerShell远程(例如从天蓝色的自动化,部署后)。对于您的问题,您可能需要查看一个名为Custom Script Extension.的东西,这有助于您在部署虚拟机时在虚拟机内部运行脚本,例如更改防火墙规则。

相关问题