iT邦幫忙

2019 iT 邦幫忙鐵人賽

DAY 15
1
自我挑戰組

谷哥 Google Cloud Platform 勇者的試煉系列 第 15

多雲合體 GCP 與 Azure VPN 打通之旅

想想都在單一雲層使用服務...無論是內部應用做資料交換的角度或是一堆雞蛋別放在同個籃子上來看應該是要讓多雲一起相親相愛的說.../images/emoticon/emoticon79.gif

不免俗還是要來一下目前做S2S(站對站的VPN)連線架構示意,主要就是把Azure與Google兩朵雲上的網路透過VPN打通進而連線對方指定的內部IP網路相互交換資料存取等行為
https://ithelp.ithome.com.tw/upload/images/20181015/20025481uAQ6Uiruy6.png

就直接來實作試試GCP VPN直接點擊執行
https://ithelp.ithome.com.tw/upload/images/20181015/20025481bMbXuJGWfI.png

點擊建立VPN
https://ithelp.ithome.com.tw/upload/images/20181015/200254819cRsHBTm5E.png

設定過程會需要設定一組固定IP,作為對方VPN建立連線通道之用
https://ithelp.ithome.com.tw/upload/images/20181015/20025481qZNSoJ617K.png

自建此VPN名稱,另外內部網路選用自建的garyvpc(172.16.x.x)後面都是直接自動套用
https://ithelp.ithome.com.tw/upload/images/20181015/20025481iHyRt9cXbA.png

再回到Azure上選擇虛擬網路閘道...因為我還沒有建立Azure VPN...XD
https://ithelp.ithome.com.tw/upload/images/20181015/20025481u45qozKfRn.png

順便示範一下Azure VPN的設定

  • 選擇VPN非專線這應該沒啥問題
  • 大部份經驗法則走動態比較好也容易固選擇路由式
  • SKU就是規格等級最基本100mbps頻寬上限不過測試而已夠了
  • 虛擬網路我選擇指定能連線VM服務的內部網路
  • Public IP新建就好...有既有也可以直接套用
  • 地區位置一定要跟上述這些服務一致,所以東南亞
    都完成了就建立吧!
    https://ithelp.ithome.com.tw/upload/images/20181015/20025481VFT2JO9lGb.png

VPN已經建立完成了...(這大約是要30-45分鐘的時間@@)
https://ithelp.ithome.com.tw/upload/images/20181015/20025481tG5z5ZCOde.png

再來要準備新增連線了..就設定剛剛GCP VPN上套用的Public IP及garyvpc的網路範圍(172.16.0.0/16)
https://ithelp.ithome.com.tw/upload/images/20181015/20025481AYdj0tvhEa.png

設定兩邊交換一致的Key...自訂即可
https://ithelp.ithome.com.tw/upload/images/20181015/20025481qcSYKIrYg8.png

竟然....失敗@@怎麼回事
https://ithelp.ithome.com.tw/upload/images/20181015/20025481UqdrEdRN4p.png

確認一下目前Azure VPN套用的虛擬網路,確定套用於此
https://ithelp.ithome.com.tw/upload/images/20181015/20025481OAbsgf20Wo.png

回到GCP VPN繼續後面設定Tunnel,反過來設置Azure VPN上套用的Public IP,交換類型請選擇IKEv2,
交換Key請設定一致,最後路徑就是隧道打通後要連線的實際內部網路IP網段為何!好了就完成.
https://ithelp.ithome.com.tw/upload/images/20181015/20025481Efh9757xFB.png

GCP VPN建立中
https://ithelp.ithome.com.tw/upload/images/20181015/20025481y1ncmr3emo.png

ㄜ!!GCP VPN也是失敗....第一次兩邊和親就GG
https://ithelp.ithome.com.tw/upload/images/20181015/20025481dMB31bh3fl.png

怪了,一直警示指定的IP範圍有問題...
https://ithelp.ithome.com.tw/upload/images/20181015/20025481ZpQQHS9hsM.png

中間排除問題中.................1小時過去了@@

好吧!最後我成功了..(因為步驟都一樣就不在重複,我只做了一件事就是把虛擬網路從我自建的改為預設的)
https://ithelp.ithome.com.tw/upload/images/20181015/20025481xo63lqK7ls.png

GCP預設的虛擬網路包含各個地區的10.x.x.x網路範圍,我測試只選用10.140.x.x(東亞台灣)
https://ithelp.ithome.com.tw/upload/images/20181015/20025481LEtITxDLp1.png

自動建立一筆VPN路由
https://ithelp.ithome.com.tw/upload/images/20181015/20025481TvhyF6655i.png

這路由下就會跟底下的GCE連通,等等拿第一台來測試看看
https://ithelp.ithome.com.tw/upload/images/20181015/20025481ylgFLQXmME.png

回頭看一下我又重新設定Azure上要指定GCP的IP網路(注意差異...下面位置空間就是從172.16改為10.140.x.x default網路)
https://ithelp.ithome.com.tw/upload/images/20181015/20025481bfalIFTuVH.png

VPN狀態已經顯示已連線(旁邊連入連出都已經有封包資料做交換)
https://ithelp.ithome.com.tw/upload/images/20181015/200254815Tj06fndyM.png

直接來實測一下從GCE(10.140.0.2)ping Azure VM(10.100.100.4)
https://ithelp.ithome.com.tw/upload/images/20181015/20025481zs3w0Sa4hR.png

Azure VM再次驗明正身
https://ithelp.ithome.com.tw/upload/images/20181015/20025481pfgBD19nHs.png

GCE也同樣來確認一下IP確定沒有唬爛
https://ithelp.ithome.com.tw/upload/images/20181015/20025481RNdVdBtji4.png

從Azure VM(10.100.100.4)ping GCE(10.140.0.2)
https://ithelp.ithome.com.tw/upload/images/20181015/200254818fhn7QR7aX.png

我覺得GCP的自訂網路一定有路徑上的問題應該有忽略到....VPN的設定是沒有問題的...待小弟如果有解了在補充給大大們知道....

小弟我就先告退了........81


上一篇
GCP 之 Cloud SQL 一窺究竟
下一篇
一定要開機器來放著不能有事件觸發執行才付費嗎?淺談Cloud Functions
系列文
谷哥 Google Cloud Platform 勇者的試煉30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言