您好,登錄后才能下訂單哦!
因?yàn)闃I(yè)務(wù)需要,需要在公司,AWS和Azure之間都搭建IPSec的連接。主要挑戰(zhàn)在于:
解決方法如下 限于篇幅 我就不寫具體的操作 可以從相關(guān)鏈接進(jìn)行查詢,更多的是提供一個思路
AWS使用自帶的IPSEC 網(wǎng)關(guān)便可直接和路由器搭建連接。不同的路由器配置界面不太一樣,不過基本思路是一樣的。我之前已經(jīng)寫過一個博文記錄操作
https://blog.51cto.com/beanxyz/2177992
微軟提供了一個解決方案,針對那些不支持BGP的路由器也可以使用route-based的IPSEC連接,這樣可以繞過1個連接的限制。需要用戶自定義IPSEC/IKE的標(biāo)準(zhǔn),這個操作圖形界面不支持,只能通過PowerShell實(shí)現(xiàn)
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'
執(zhí)行上面的代碼,替換自己的IP地址就行了。注意創(chuàng)建Virtual Network Gateway會花20分鐘,耐心等待即可。(鄙視一下Azure,AWS里面創(chuàng)建一個同樣功能的網(wǎng)關(guān)就一分鐘)
公司路由器上根據(jù)自己定義的標(biāo)準(zhǔn),選擇配置對應(yīng)的IKE標(biāo)準(zhǔn)就是了
因?yàn)锳WS支持IKEv1 而 Azure支持IKEv2,因?yàn)榻鉀Q方案只能是在AWS上搭建一個新的實(shí)例來充當(dāng)軟路由。
豆子嘗試了Vyos 不過不太好使,最后發(fā)現(xiàn)用Windows 服務(wù)器自帶的路由服務(wù)就可以實(shí)現(xiàn)了。 具體操作參見
http://awsfeed.com/post/165181537929/connecting-clouds-aws-to-azure-site-to-site-***
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。