您好,登錄后才能下訂單哦!
因為業務需要,需要在公司,AWS和Azure之間都搭建IPSec的連接。主要挑戰在于:
解決方法如下 限于篇幅 我就不寫具體的操作 可以從相關鏈接進行查詢,更多的是提供一個思路
AWS使用自帶的IPSEC 網關便可直接和路由器搭建連接。不同的路由器配置界面不太一樣,不過基本思路是一樣的。我之前已經寫過一個博文記錄操作
https://blog.51cto.com/beanxyz/2177992
微軟提供了一個解決方案,針對那些不支持BGP的路由器也可以使用route-based的IPSEC連接,這樣可以繞過1個連接的限制。需要用戶自定義IPSEC/IKE的標準,這個操作圖形界面不支持,只能通過PowerShell實現
https://docs.microsoft.com/en-us/azure/***-gateway/***-gateway-connect-multiple-policybased-rm-ps
#Connect to Azure
Connect-AzureRmAccount
$Sub1 = "Free Trial"
$RG1 = "MyResourceGroup"
$Location1 = "australiaeast"
$VNetName1 = "TestVNet1"
$FESubName1 = "FrontEnd"
$BESubName1 = "Backend"
$GWSubName1 = "GatewaySubnet"
$VNetPrefix11 = "10.11.0.0/16"
$VNetPrefix12 = "10.12.0.0/16"
$FESubPrefix1 = "10.11.0.0/24"
$BESubPrefix1 = "10.12.0.0/24"
$GWSubPrefix1 = "10.12.255.0/27"
$DNS1 = "8.8.8.8"
$GWName1 = "VNet1GW"
$GW1IPName1 = "VNet1GWIP1"
$GW1IPconf1 = "gw1ipconf1"
$ConnectionIT = "VNet1toSiteIT"
$LNGNameIT = "SiteIT"
$LNGPrefixIT = "10.2.13.0/24"
$LNGIPIT = "19.12.127.94"
# Create subnets
$fesub1 = New-AzureRmVirtualNetworkSubnetConfig -Name $FESubName1 -AddressPrefix $FESubPrefix1
$besub1 = New-AzureRmVirtualNetworkSubnetConfig -Name $BESubName1 -AddressPrefix $BESubPrefix1
$gwsub1 = New-AzureRmVirtualNetworkSubnetConfig -Name $GWSubName1 -AddressPrefix $GWSubPrefix1
#Create VNet
New-AzureRmVirtualNetwork -Name $VNetName1 -ResourceGroupName $RG1 -Location $Location1 -AddressPrefix $VNetPrefix11,$VNetPrefix12 -Subnet $fesub1,$besub1,$gwsub1
#Create a public IP and associate it to the gateway subnet
$gw1pip1 = New-AzureRmPublicIpAddress -Name $GW1IPName1 -ResourceGroupName $RG1 -Location $Location1 -AllocationMethod Dynamic
$vnet1 = Get-AzureRmVirtualNetwork -Name $VNetName1 -ResourceGroupName $RG1
$subnet1 = Get-AzureRmVirtualNetworkSubnetConfig -Name "GatewaySubnet" -VirtualNetwork $vnet1
$gw1ipconf1 = New-AzureRmVirtualNetworkGatewayIpConfig -Name $GW1IPconf1 -Subnet $subnet1 -PublicIpAddress $gw1pip1
#Create route-based Virtual Gateway
New-AzureRmVirtualNetworkGateway -Name $GWName1 -ResourceGroupName $RG1 -Location $Location1 -IpConfigurations $gw1ipconf1 -GatewayType *** -***Type RouteBased -GatewaySku ***Gw1
#Create local Gateway
New-AzureRmLocalNetworkGateway -Name $LNGNameIT -ResourceGroupName $RG1 -Location $Location1 -GatewayIpAddress $LNGIPIT -AddressPrefix $LNGPrefixIT
#Define IPSEC/IKE
$ipsecpolicy6 = New-AzureRmIpsecPolicy -IkeEncryption AES256 -IkeIntegrity SHA256 -DhGroup DHGroup2 -IpsecEncryption AES256 -IpsecIntegrity SHA256 -PfsGroup None
$vnet1gw = Get-AzureRmVirtualNetworkGateway -Name $GWName1 -ResourceGroupName $RG1
$lng6 = Get-AzureRmLocalNetworkGateway -Name $LNGNameIT -ResourceGroupName $RG1
#Create new Connection
New-AzureRmVirtualNetworkGatewayConnection -Name $Connectionit -ResourceGroupName $RG1 -VirtualNetworkGateway1 $vnet1gw -LocalNetworkGateway2 $lng6 -Location $Location1 -ConnectionType IPsec -IpsecPolicies $ipsecpolicy6 -SharedKey 'AzurepassWord'
執行上面的代碼,替換自己的IP地址就行了。注意創建Virtual Network Gateway會花20分鐘,耐心等待即可。(鄙視一下Azure,AWS里面創建一個同樣功能的網關就一分鐘)
公司路由器上根據自己定義的標準,選擇配置對應的IKE標準就是了
因為AWS支持IKEv1 而 Azure支持IKEv2,因為解決方案只能是在AWS上搭建一個新的實例來充當軟路由。
豆子嘗試了Vyos 不過不太好使,最后發現用Windows 服務器自帶的路由服務就可以實現了。 具體操作參見
http://awsfeed.com/post/165181537929/connecting-clouds-aws-to-azure-site-to-site-***
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。