Windows Azure Virtual Network (7) 設定Azure Virtual Machine固定公網IP (Virtual IP Address, VIP) (2)

來源:互聯網
上載者:User

標籤:

  《Windows Azure Platform 系列文章目錄》

 

  在筆者之前的部落格中Windows Azure Virtual Network (6) 設定Azure Virtual Machine固定公網IP (Virtual IP Address, VIP) (1),筆者介紹了如何在建立虛擬機器的時候,將固定公網地址進行綁定。

 

  很遺憾,在很多情況下,客戶已經使用Azure Management Portal建立了新的虛擬機器。以前的辦法只能將DNS刪除,並且保留VHD,然後重新建立新的Cloud Service並綁定Virtual IP。但是這樣會產生服務的宕機。

 

  最新的Azure PowerShell有新的命令,允許使用者在已建立的虛擬機器上綁定固定Virtual IP Address。

  請在http://azure.microsoft.com/en-us/downloads/ 進行下載。

 

  關鍵步驟主要有:

  1.筆者使用Management Portal,建立一個新的Cloud Service

  2.使用PowerShell,將固定Reserved IP綁定到步驟1的Cloud Service上

 

  注意:在開始本章之前,請讀者預習Windows Azure Virtual Network (6) 設定Azure Virtual Machine固定公網IP (Virtual IP Address, VIP) (1)中的內容,熟悉相關的PowerShell。

  

  1.使用Azure Management Portal,建立新的虛擬機器(步驟略),注意虛擬機器需要建立在East Asia資料中心,與我們在步驟1中IP地址Location一致。建立完畢後,該虛擬機器資訊如下:

  

  -  DNS Name為LeiTestVM

  -  VM Name為LeiTestVM001

  -  VIP為191.234.18.61。注意這個IP在虛擬機器狀態為Stop(Deallocate)的時候,會改變,不是固定IP地址

 

  2.使用PowerShell,將固定公網IP(VIP)綁定到步驟1中建立的Cloud Service中去

  具體PowerShell命令為:

New-AzureReservedIP -ServiceName [YourCloudServiceName] -ReservedIPName [YourVIPName] -Location [Location]

  對比筆者的環境來說,我們的PowerShell命令為:

New-AzureReservedIP -ServiceName ‘LeiTestVM‘ -ReservedIPName ‘LeiTestVMReservedIP‘ -Location ‘East Asia‘

  如下:

  

  執行完這個PowerShell後,我們在步驟1中的VIP(191.234.18.61)就被筆者固定使用了,別的使用者無法訪問這個IP地址。

 

  3.我們可以通過PowerShell命令,查看LeiTestVMReservedIP這個固定IP地址的狀態

Get-AzureReservedIP -ReservedIPName ‘LeiTestVMReservedIP‘

  如下:

    

  名稱為LeiTestVMReservedIP的IP地址(191.234.18.61)就被筆者獨佔式使用了。

 

  我們還可以通過PowerShell命令 Get-AzureReservedIP,查看到筆者綁定的所有固定VIP地址資訊,如:

  

 

  

  

Windows Azure Virtual Network (7) 設定Azure Virtual Machine固定公網IP (Virtual IP Address, VIP) (2)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.