一、準備工作
- 新建資源組(可把所有與新建VPN相關資源放入此組)
- 新建虛擬網絡
- VPN用那種方式基於路由或基於協議
- 本地VPN設備是否支持Azure,具體可參考
https://docs.azure.cn/zh-cn/vpn-gateway/vpn-gateway-about-vpn-devices
二、操作
第一步:新建虛擬網絡網關(默認基於路由),點擊創建即完成(大約等待45分鐘生效)
名稱:自定義
網關類型:選擇VPN
VPN類型:根據VPN設備支持,自行選擇基於路由或基於協議
SKU:工作負荷、吞吐量、功能和 SLA 的類型,選擇滿足需求的 SKU,可參考
https://docs.microsoft.com/zh-cn/azure/vpn-gateway/vpn-gateway-about-vpngateways
虛擬網絡:選擇準備工作中新建的虛擬網絡
公共IP地址:填入IP名稱(只支持動態IP)
訂閱:一般默認訂閱
資源組:一般與準備工作中的資源組一致
位置:與資源組位置一致
第二步:新建本地網絡網關
名稱:自定義
IP地址:本地VPN設備公網地址
地址空間:本地需要打通的地址段
第三步:連接(在Azure中新建連接服務)
連接類型:站點到站點
訂閱:默認
資源組:同第一步
位置:同第一步
虛擬網絡網關:第一步所創的虛擬網絡
本地網絡網關:第二步所創資源
連接名稱:自定義
共享密鑰:自定義
第四步:配置VPN設備
方法一:打開連接資源,點擊下載配置,可以找到相關配置腳本
方法二:方法一沒有相關腳本,請參考如下
https://docs.azure.cn/zh-cn/vpn-gateway/vpn-gateway-about-vpn-devices
方法三:如下爲cisco ISR路由設備腳本,用於參考
crypto ikev2 proposal yaoikeprofile
encryption aes-cbc-256 aes-cbc-128 3des
integrity sha1
group 2
exit
crypto ikev2 policy yaoikepolicy
proposal yaoikeprofile
exit
crypto ikev2 keyring yaokeyring
peer 139.219.109.209
address 139.219.109.209
pre-shared-key qwer1234
exit
exit
crypto ikev2 profile yaoikeprofile
match address local interface g0/0
match identity remote address 139.219.109.209 255.255.255.255
authentication remote pre-share
authentication local pre-share
keyring local yaokeyring
exit
crypto ipsec transform-set yaoipsecproposal esp-aes 256 esp-sha-hmac
mode tunnel
exit
crypto ipsec profile yaoprofile
set transform-set yaoipsecproposal
set ikev2-profile yaoikeprofile
exit
int tunnel 1
ip address 169.254.1.1 255.255.255.0
ip tcp adjust-mss 1350
tunnel source g0/0
tunnel mode ipsec ipv4
tunnel destination 139.219.109.209
tunnel protection ipsec profile yaoprofile
exit
ip route 172.168.100.0 255.255.0.0 tunnel 1