Azure VM: More than one Public IP

后端 未结 7 1094
予麋鹿
予麋鹿 2021-01-01 05:51

Can anyone confirm if Azure VM allows more than one Public IP? We want to host multiple website on single VM and hence want to have different IP for each website. I know we

7条回答
  •  长情又很酷
    2021-01-01 06:45

    You can add multiple IP addresses for a cloud service. Since the VM's are "inside" the cloud service, this gives you in a way multiple public IP addresses for a virtual machine. The procedure is documented at [1]. Additional addresses currently cost about $3/month.

    Here's the steps to add a new reserved IP address to a cloud service.

    First create a new reserved IP address:

    New-AzureReservedIP –ReservedIPName "MyIPAddress"  –Location "West Europe"
    

    Associate the IP address with cloud service:

    Add-AzureVirtualIP -VirtualIPName MyIPAddress -ServiceName MyCloudService
    

    Create endpoint that maps the IP address to a virtual machines. If you have multiple vm's and want load balancer, repeat this for each vm. In order to run multiple web sites, you would put each website to different port (the localport). The endpoint listens for connections on the public port and forwards them to the virtual machine's localport.

    Get-AzureVM -ServiceName MyCloudService -Name myserver `
    | Add-AzureEndpoint -Name QuvastoMail -Protocol tcp `
          -LocalPort 8002 -PublicPort 80 -VirtualIPName MyIPAddress `
    | Update-AzureVM
    

    [1] http://azure.microsoft.com/en-us/documentation/articles/load-balancer-multivip/

提交回复
热议问题