如何將多個本機站台連接到 Azure 並連接虛擬網路?

如何將多個本機站台連接到 Azure 並連接虛擬網路?

我希望能夠設定多個 Azure 虛擬網絡,將它們連接在一起,並允許多個本地 VPN 路由器連接到這些虛擬網路。以下是我計劃如何設定網路。

資料中心虛擬網路: 172.16.250.0/24 位址空間 172.16.250.0/25 子網路-1 172.16.250.128/29 閘道 -> 點對站連線:10.0.253.0/24 -> 本地端連接 資料中心到站台連線:10.0.253.0/24 -> 本地到網路連線 10.0.0. 24

總部虛擬網路: 172.16.0.0/24 位址空間 172.16.0.0/25 子網路-1 172.16.0.128/29 閘道 -> 站點到站點連接:總部本地網路:10.0.0.0/24

Region1 虛擬網路: 172.16.1.0/24 位址空間 172.16.1.0/25 子網路-1 172.16.1.128/29 閘道 -> 網站對站連線:區域 1 本地網路:10.0.1.0/24

因此,我希望資料中心、總部和區域虛擬網路能夠連接起來。然後,我需要本地 VPN 路由器來連接到總部和區域虛擬網路。我如何 1) 讓 VN 相互通信,2) 我有 Cisco 881 路由器,並且我正在使用 Azure 中的以下配置。

! Microsoft Corporation
! Windows Azure Virtual Network

! This configuration template applies to Cisco ISR 2900 Series Integrated Services Routers running IOS 15.1.
! It configures an IPSec VPN tunnel connecting your on-premise VPN device with the Azure gateway.

! ---------------------------------------------------------------------------------------------------------------------
! ACL rules
! 
! Proper ACL rules are needed for permitting cross-premise network traffic.
! You should also allow inbound UDP/ESP traffic for the interface which will be used for the IPSec tunnel.
access-list 101 permit ip 10.0.0.0 0.0.0.255 172.16.0.0 0.0.0.255

! ---------------------------------------------------------------------------------------------------------------------
! Internet Key Exchange (IKE) configuration
! 
! This section specifies the authentication, encryption, hashing, and Diffie-Hellman group parameters for the Phase
! 1 negotiation and the main mode security association. 
crypto ikev2 proposal azure-proposal
  encryption aes-cbc-256 aes-cbc-128 3des
  integrity sha1
  group 2
  exit

crypto ikev2 policy azure-policy
  proposal azure-proposal
  exit

crypto ikev2 keyring azure-keyring
  peer 104.215.95.202
    address 104.215.95.202
    pre-shared-key 
    exit
  exit

crypto ikev2 profile azure-profile
  match address local interface 
  match identity remote address 104.215.95.202 255.255.255.255
  authentication remote pre-share
  authentication local pre-share
  keyring azure-keyring
  exit

! ---------------------------------------------------------------------------------------------------------------------
! IPSec configuration
! 
! This section specifies encryption, authentication, tunnel mode properties for the Phase 2 negotiation
crypto ipsec transform-set azure-ipsec-proposal-set esp-aes 256 esp-sha-hmac
 mode tunnel
 exit

! ---------------------------------------------------------------------------------------------------------------------
! Crypto map configuration
!
! This section defines a crypto profile that binds the cross-premise network traffic to the IPSec transform
! set and remote peer.  We also bind the IPSec policy to the virtual tunnel interface, through which 
! cross-premise traffic will be transmitted.  We have picked an arbitrary tunnel id "1" as an example. If
! that happens to conflict with an existing virtual tunnel interface, you may choose to use a different id.
crypto ipsec profile vti
  set transform-set azure-ipsec-proposal-set
  set ikev2-profile azure-profile
  exit

int tunnel 1
  ip address 169.254.0.1 255.255.255.0
  ip tcp adjust-mss 1350
  tunnel source 
  tunnel mode ipsec ipv4
  tunnel destination 104.215.95.202
  tunnel protection ipsec profile vti
  exit

ip route 172.16.0.0 255.255.255.0 tunnel 1

是否需要在此範本中新增或刪除任何設定才能使本機 VPN 正常運作?

感謝您的幫忙!

答案1

我怎樣才能讓 VN 互相交談

您需要建立 VNet 到 VNet VPN 隧道,可以透過執行以下操作來完成:

  1. 在 Azure 入口網站中,建立所需的所有 VNet,將子網路新增至 VNet 以及 LAN 中對應的本機網路。
  2. 使用動態路由 VPN 為 VNet 建立網關,靜態路由 VPN 將無法運作。
  3. 首先將 VPN 閘道相互連接,然後根據需要連接 LAN 以簡化故障排除過程。

這一切都在這裡有很好的記錄: 在 Azure 入口網站中設定 VNet 到 VNet 連接也在這裡 VNet 到 VNet:跨不同區域連接 Azure 中的虛擬網絡

是否需要在此範本中新增或刪除任何設定才能使本機 VPN 正常運作?

你很幸運,你的裝置支援使用動態路由的 Azure 網站到網站 VPN,為了確保你可以成功地將 LAN 連接到 Azure,我建議你查看此頁面中的詳細資訊:關於用於站點到站點虛擬網路連接的 VPN 設備

不幸的是,我不是 Cisco 路由器的專家,我無法查看您發佈的配置,但我可以透過提供將 Azure 連接到 VPN 裝置的一般準則來協助您:

  1. 使用上述步驟設定 VNet 後,Azure 將足夠聰明地建立腳本,您可以下載並使用該腳本來設定本機 VPN 裝置。
  2. 閱讀 Cisco 建立 VPN 動態隧道的手冊:http://www.cisco.com/c/en/us/support/docs/security-vpn/ipsec-negotiation-ike-protocols/46242-lan-to-lan-vpn-client.html
  3. 查看 Cisco 的 Azure VPN 範例:https://msdn.microsoft.com/library/azure/dn133800.aspx?f=255&MSPPError=-2147217396#BKMK_ISRDynamic

我希望這些足以幫助您,如果沒有,我相信在思科有更多經驗的其他人將能夠幫助您解決這個問題。

答案2

好的,所以我已經取得了一些進展。我已將本地設備連接到Azure,Azure 中的虛擬網路也相互連接,但如果我將一個虛擬機放在一個VNet 中,將另一個虛擬機放在另一個VNet 中,我將無法跨VNet 執行ping操作。此外,我無法從本機裝置對 Azure VNet 中的任何內容執行 ping 操作。

這就是當前的設定方式。

虛擬網路
VNet 資料中心:172.16.250.0/24

  • 本地網路:LNet到總部(10.0.0.0/24)、LNet到Region1(10.0.1.0/24)

VNet-總部:172.16.0.0/24

  • 本地網路:LNet-Headquarters (10.0.0.0/24)、LNet-int-Headquarters (10.0.250.0/24、10.0.1.0/24)

VNet 區域 1:172.16.1.0/24

  • 本地網路:LNet-Region1 (10.0.1.0/24)、LNet-int-Region1 (10.0.250.0/24、10.0.0.0/24)

我在 VNet-Headquarters 中有一個虛擬機,在 VNet-DataCenter 中有一個虛擬機,但我無法 ping 通任何一台計算機。

我使用以下文章作為參考。 如何設定Azure虛擬網路之間的路由?

任何幫助表示讚賞!

答案3

好的,我已經重建了整個網絡,並再次將兩個虛擬機放置在其中兩個 VN 中,但它們仍然無法 ping 通任何內容,甚至無法 ping 通本地網關。這是設定。

我創建了三個 VN:

  • 互聯網 1 - 10.0.250.0/24
  • 互聯網 2 - 10.0.0.0/24
  • 互聯網 3 - 10.0.1.0/24

我創建了四個 LN:

  • LNet 1 - 10.0.0.0/24
  • LNet 2 - 10.0.1.0/24
  • LNet 3 - 10.0.250.0/24、10.0.1.0/24
  • LNet 4 - 10.0.250.0/24、10.0.0.0/24

VNet 1 連接了兩個 LN,LNet 1 和 LNet 2
VNet 2 連接了 1 個 LN,LNet 3
VNet 3 連接了 1 個 LN,LNet 4

VNet 1 中有一個 IP 為 10.0.250.4 的虛擬機器。
VNet 2 有一個 IP 為 10.0.0.4 的虛擬機器。

我無法從另一個虛擬機 ping 任一虛擬機,因此 10.0.0.4 無法 ping 10.0.250.4,反之亦然。

謝謝!

答案4

Azure 中的 Ping VM 在 Windows 防火牆層級被阻止,請確保在測試期間關閉每個 VM 上的防火牆,一旦成功,您可以將它們設定為允許 ICMP。或者,使用 RDP 檢查連線(假設已啟用)

相關內容