Hub-Spoke communication using vNet Peering and User Defined Routes

%3CLINGO-SUB%20id%3D%22lingo-sub-2942340%22%20slang%3D%22en-US%22%3EHub-Spoke%20communication%20using%20vNet%20Peering%20and%20User%20Defined%20Routes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2942340%22%20slang%3D%22en-US%22%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3EKeyword%20%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CUL%20class%3D%22%22%3E%3CLI%3E%3CSTRONG%3EHub%20VNet%3C%2FSTRONG%3E.%20Virtual%20network%20used%20to%20deploy%20the%20Hub%2C%20The%20hub%20is%20the%20central%20point%20of%20connectivity%20to%20host%20services%20and%20internet.%20Services%20deployed%20in%20Hub%20vnet%20can%20be%20consumed%20by%20the%20different%20workloads%20hosted%20in%20the%20spoke%20VNets.%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EWorkload%20subnet%3C%2FSTRONG%3E.%20The%20subnets%20defined%20in%20the%20Spoke%20Vnets..%3C%2FLI%3E%3C%2FUL%3E%3CUL%20class%3D%22%22%3E%3CLI%3E%3CSTRONG%3ESpoke%20VNets%3C%2FSTRONG%3E.%20Spokes%20can%20be%20used%20to%20isolate%20workloads%20in%20their%20own%20VNets%2C%20managed%20separately%20from%20other%20spokes.%20Each%20workload%20might%20include%20multiple%20tiers%2C%20with%20multiple%20subnets%20connected%20through%20Azure%20load%20balancers.%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EVNet%20peering%3C%2FSTRONG%3E%3CSPAN%3E.%20To%20establish%20communication%20between%20two%20VNets.%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CSTRONG%3EAzure%20Firewall%26nbsp%3B%3C%2FSTRONG%3EAzure%20Firewall%20is%20deployed%20in%20the%20hub%2C%20which%20provides%20an%20additional%20layer%20of%20security.%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_10-1636454801634.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325483i120F25BD4C7902AA%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_10-1636454801634.png%22%20alt%3D%22MohamedT_Trabelsi_10-1636454801634.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3EScenario%20%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3ESPOKE%20networks%20must%20communicate%20with%20each%20other%2C%20but%20peering%20between%20them%20was%20not%20allowed.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%20color%3D%22%23FF0000%22%3EProblem%20%3A%26nbsp%3B%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CSPAN%3E--%20SPOKE%201%20is%20peered%20with%20the%20HUB%20network%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CSPAN%3E--%20HUB%20is%20peered%20with%20SPOKE%202%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CSPAN%3E--%20No%20communication%20between%20SPOKE%201%20and%20SPOKE%202%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3ESolutions%20%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E1-%26nbsp%3B%3CSPAN%3Ea%20Network%20Virtual%20Appliance%20(NVA)%20from%20the%20market%20place%26nbsp%3B%20%3A%20a%20VM%20with%20a%20configured%20Firewall%2FRouter%20within%20the%20HUB%20and%20configure%20it%20to%20forward%20traffic%20to%20and%20from%20the%20Spoke1%20%26amp%3B%202.%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CSPAN%3E2-%26nbsp%3Ba%20Virtual%20Gateway%20attached%20to%20the%20HUB%20network%20%3A%20enable%20communication%20between%20spokes%20with%20the%20defined%20routes.%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CU%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CSTRONG%3EWe%20will%20see%20the%202nd%20solution%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FU%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CSPAN%3E1-%20Create%20the%20Hub%20Vnet%20(10.2.0.0%2F16)%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_7-1636453197510.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325476iD190AEDEFB5CA933%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_7-1636453197510.png%22%20alt%3D%22MohamedT_Trabelsi_7-1636453197510.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CSPAN%3E2-%20Create%20the%20spoke1%20Vnet%20(10.3.0.0%2F16)%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_6-1636453179459.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325475i7255EA2F0573CB4B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_6-1636453179459.png%22%20alt%3D%22MohamedT_Trabelsi_6-1636453179459.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CSPAN%3E3-%20Create%20the%20spoke2%20Vnet%20(10.4.0.0%2F16)%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_8-1636453268478.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325477i43EF46B44336FC82%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_8-1636453268478.png%22%20alt%3D%22MohamedT_Trabelsi_8-1636453268478.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%2003%20Vnets%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_9-1636454017180.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325481iCDF62389A23EB22C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_9-1636454017180.png%22%20alt%3D%22MohamedT_Trabelsi_9-1636454017180.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E3-%20Configure%20peering%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3E%3CEM%3E%3CSTRONG%3E%3CFONT%20color%3D%22%230000FF%22%3E****%20With%20Portal%20Azure%26nbsp%3B%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FU%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EHub%20%26lt%3B%26gt%3B%20Spoke1%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_11-1636455270815.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325486i7BFCC510AE8EC2BF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_11-1636455270815.png%22%20alt%3D%22MohamedT_Trabelsi_11-1636455270815.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_12-1636455295599.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325487iEB7C2F93073B200F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_12-1636455295599.png%22%20alt%3D%22MohamedT_Trabelsi_12-1636455295599.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EHub%20%26lt%3B%26gt%3B%20Spoke2%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_13-1636455438827.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325488iAC38C3BCA7058DD0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_13-1636455438827.png%22%20alt%3D%22MohamedT_Trabelsi_13-1636455438827.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_14-1636455455630.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325489iE3A95D787632E718%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_14-1636455455630.png%22%20alt%3D%22MohamedT_Trabelsi_14-1636455455630.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CSTRONG%3E%3CEM%3E******************************************************************************%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CEM%3E%3CU%3E%3CSTRONG%3E%3CFONT%20color%3D%22%230000FF%22%3EOr%20you%20can%20do%20it%26nbsp%3B%26nbsp%3B****%20With%20PowerShell%20Script%26nbsp%3B%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CEM%3Eexample%20%3A%20%3C%2FEM%3E%3C%2FFONT%3E%3CFONT%20color%3D%22%23000000%22%3E%3CEM%3Ecreate%20peering%26nbsp%3B%20Hub%20%26lt%3B%26gt%3B%20Spoke1%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_1-1636459124192.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325513i7ED0E722BAE4EB26%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_1-1636459124192.png%22%20alt%3D%22MohamedT_Trabelsi_1-1636459124192.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24SpokeRG%20%3D%20%22Networks%22%3CBR%20%2F%3E%24SpokeRM%20%3D%20%22spoke1%22%3CBR%20%2F%3E%24HubRG%20%3D%20%22Networks%22%3CBR%20%2F%3E%24HubRM%20%3D%20%22centralHub%22%3C%2FP%3E%3CP%3E%24spokermvnet%20%3D%20Get-AzVirtualNetwork%20-Name%20%24SpokeRM%20-ResourceGroup%20%24SpokeRG%3CBR%20%2F%3E%24hubrmvnet%20%3D%20Get-AzVirtualNetwork%20-Name%20%24HubRM%20-ResourceGroup%20%24HubRG%3C%2FP%3E%3CP%3EAdd-AzVirtualNetworkPeering%20%60%3CBR%20%2F%3E-Name%20SpokeRMtoHubRM%20%60%3CBR%20%2F%3E-VirtualNetwork%20%24spokermvnet%20%60%3CBR%20%2F%3E-RemoteVirtualNetworkId%20%24hubrmvnet.Id%20%60%3CBR%20%2F%3E-UseRemoteGateways%3C%2FP%3E%3CP%3EAdd-AzVirtualNetworkPeering%20%60%3CBR%20%2F%3E-Name%20HubRMToSpokeRM%20%60%3CBR%20%2F%3E-VirtualNetwork%20%24hubrmvnet%20%60%3CBR%20%2F%3E-RemoteVirtualNetworkId%20%24spokermvnet.Id%20%60%3CBR%20%2F%3E-AllowGatewayTransit%3C%2FP%3E%3CP%3E%3CEM%3E%3CU%3E%3CSTRONG%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CFONT%20color%3D%22%23000000%22%3E******************************************************************************%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E4-%20Create%20a%26nbsp%3B%3CSPAN%3EVirtual%20Network%20Gateway%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_0-1636456755187.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325503iB6312CEAD7677AE6%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_0-1636456755187.png%22%20alt%3D%22MohamedT_Trabelsi_0-1636456755187.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_1-1636456781721.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325504i25B88704DBAF9E78%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_1-1636456781721.png%22%20alt%3D%22MohamedT_Trabelsi_1-1636456781721.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20created%20now%20%3B)%3C%2Fimg%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_0-1636457696716.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325507i4E49EA96D1DA619E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_0-1636457696716.png%22%20alt%3D%22MohamedT_Trabelsi_0-1636457696716.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E5-%20Now%2C%26nbsp%3B%3CSPAN%3Ego%20back%20to%20the%26nbsp%3B%3C%2FSPAN%3E%3CI%3EPeering%3C%2FI%3E%3CSPAN%3E%26nbsp%3Bsection%20of%20each%20of%20the%20SPOKE%20Networks%20and%20configure%20%E2%80%9C%3C%2FSPAN%3E%3CSTRONG%3EUse%20Remote%20gateways%3C%2FSTRONG%3E%3CSPAN%3E%E2%80%9D%20option%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E6-%20Create%20the%20route%20tables%20and%20define%20users%20routes%20needed%20for%20the%20SPOKE%20to%20SPOKE%20communication%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_2-1636466649417.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325554i58EA9AEFFBA4F4AD%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_2-1636466649417.png%22%20alt%3D%22MohamedT_Trabelsi_2-1636466649417.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdd%20route%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E--The%20Gateway%20subnet%20%3A%26nbsp%3BCIDR%20%2F29%26nbsp%3B%20%3D%3D%26gt%3B%20The%26nbsp%3Bfirst%20and%20last%20IP%20are%20reserved%20for%20azure%20services.%26nbsp%3B%3C%2FP%3E%3CP%3E--The%20internal%20IP%20address%20will%20be%20from%20the%204%20%3D%3D%26gt%3B%20%3CSTRONG%3E10.2.1.4%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CSTRONG%3E%3CEM%3E****RT%20of%20Spoke01%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3EThe%20Address%20prefix%20must%20be%20the%20network%20of%20the%26nbsp%3B%3CSTRONG%3ESpoke2%20Virtual%20Network%3C%2FSTRONG%3E%26nbsp%3B%3CSTRONG%3E10.4.0.0%2F16%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EVirtual%20appliance%20%3A%26nbsp%3B%3C%2FSTRONG%3ENext%20hop%20type%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3ENext%20hop%20address%20%3A%26nbsp%3B%3C%2FEM%3E%3C%2FSTRONG%3Einternal%20address%20of%20the%20Virtual%20Network%20Gateway%20%3CSTRONG%3E10.2.1.4%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_0-1636466571146.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325552i84326FDEB5B274A8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_0-1636466571146.png%22%20alt%3D%22MohamedT_Trabelsi_0-1636466571146.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CSTRONG%3E%3CEM%3E****RT%20of%20Spoke02%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3EThe%20Address%20prefix%20must%20be%20the%20network%20of%20the%26nbsp%3B%3CSTRONG%3ESpoke2%20Virtual%20Network%3C%2FSTRONG%3E%26nbsp%3B%3CSTRONG%3E10.3.0.0%2F16%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EVirtual%20appliance%20%3A%26nbsp%3B%3C%2FSTRONG%3ENext%20hop%20type%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3ENext%20hop%20address%20%3A%26nbsp%3B%3C%2FEM%3E%3C%2FSTRONG%3Einternal%20address%20of%20the%20Virtual%20Network%20Gateway%20%3CSTRONG%3E10.2.1.4%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedT_Trabelsi_1-1636466592201.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325553i6F59C112F42DE151%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MohamedT_Trabelsi_1-1636466592201.png%22%20alt%3D%22MohamedT_Trabelsi_1-1636466592201.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E7-%20Associate%20these%20Route%20tables%20with%20our%20Virtual%20Networks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Keyword : 

  • Hub VNet. Virtual network used to deploy the Hub, The hub is the central point of connectivity to host services and internet. Services deployed in Hub vnet can be consumed by the different workloads hosted in the spoke VNets.
  • Workload subnet. The subnets defined in the Spoke Vnets..
  • Spoke VNets. Spokes can be used to isolate workloads in their own VNets, managed separately from other spokes. Each workload might include multiple tiers, with multiple subnets connected through Azure load balancers.
  • VNet peering. To establish communication between two VNets.
  • Azure Firewall Azure Firewall is deployed in the hub, which provides an additional layer of security.

MohamedT_Trabelsi_10-1636454801634.png

 

Scenario : 

SPOKE networks must communicate with each other, but peering between them was not allowed.

Problem : 

 

-- SPOKE 1 is peered with the HUB network 

-- HUB is peered with SPOKE 2

-- No communication between SPOKE 1 and SPOKE 2 

 

Solutions : 

1- a Network Virtual Appliance (NVA) from the market place  : a VM with a configured Firewall/Router within the HUB and configure it to forward traffic to and from the Spoke1 & 2. 

 

2- a Virtual Gateway attached to the HUB network : enable communication between spokes with the defined routes. 

 

We will see the 2nd solution

 

1- Create the Hub Vnet (10.2.0.0/16) 

MohamedT_Trabelsi_7-1636453197510.png

2- Create the spoke1 Vnet (10.3.0.0/16) 

MohamedT_Trabelsi_6-1636453179459.png

 

3- Create the spoke2 Vnet (10.4.0.0/16) 

MohamedT_Trabelsi_8-1636453268478.png

 

We have 03 Vnets : 

MohamedT_Trabelsi_9-1636454017180.png

 

3- Configure peering  

 

**** With Portal Azure 

Hub <> Spoke1

MohamedT_Trabelsi_0-1636468462783.png

 

MohamedT_Trabelsi_2-1636468499632.png

 

 

 

Hub <> Spoke2

MohamedT_Trabelsi_1-1636468476517.png

MohamedT_Trabelsi_3-1636468524989.png

 

 

******************************************************************************

Or you can do it  **** With PowerShell Script 

 

example : create peering  Hub <> Spoke1

MohamedT_Trabelsi_1-1636459124192.png

 

 

$SpokeRG = "Networks"
$SpokeRM = "spoke1"
$HubRG = "Networks"
$HubRM = "centralHub"

$spokermvnet = Get-AzVirtualNetwork -Name $SpokeRM -ResourceGroup $SpokeRG
$hubrmvnet = Get-AzVirtualNetwork -Name $HubRM -ResourceGroup $HubRG

Add-AzVirtualNetworkPeering `
-Name SpokeRMtoHubRM `
-VirtualNetwork $spokermvnet `
-RemoteVirtualNetworkId $hubrmvnet.Id `
-UseRemoteGateways

Add-AzVirtualNetworkPeering `
-Name HubRMToSpokeRM `
-VirtualNetwork $hubrmvnet `
-RemoteVirtualNetworkId $spokermvnet.Id `
-AllowGatewayTransit

******************************************************************************

 

4- Create a Virtual Network Gateway

MohamedT_Trabelsi_0-1636456755187.png

MohamedT_Trabelsi_1-1636456781721.png

 

It's created now ;) 

 

MohamedT_Trabelsi_0-1636457696716.png

 

5- Now, go back to the Peering section of each of the SPOKE Networks and configure “Use Remote gateways” option

 

6- Create the route tables and define users routes needed for the SPOKE to SPOKE communication 

 

MohamedT_Trabelsi_2-1636466649417.png

 

Add route : 

 

--The Gateway subnet : CIDR /29  ==> The first and last IP are reserved for azure services. 

--The internal IP address will be from the 4 ==> 10.2.1.4

 

****RT of Spoke01

The Address prefix must be the network of the Spoke2 Virtual Network 10.4.0.0/16

Virtual appliance : Next hop type

Next hop address : internal address of the Virtual Network Gateway 10.2.1.4

MohamedT_Trabelsi_0-1636466571146.png

****RT of Spoke02

The Address prefix must be the network of the Spoke2 Virtual Network 10.3.0.0/16

Virtual appliance : Next hop type

Next hop address : internal address of the Virtual Network Gateway 10.2.1.4

 

MohamedT_Trabelsi_1-1636466592201.png

 

7- Associate these Route tables with our Virtual Networks 

 

In the Route table field select, Spoke1RouteTable and click Save

***Vnet Spoke1

MohamedT_Trabelsi_0-1636466794437.png

***Vnet Spoke2

MohamedT_Trabelsi_1-1636466812293.png

 

===> The two SPOKE Virtual Networks are able to communicate with each other via the HUB

 

8- Testing

--Create two windows VMs  ===> The first  in Spoke 1 network and the second The VM  in Spoke 2 network 

--Allow ICMP ping in the firewall of the 02 VMs 

 

MohamedT_Trabelsi_0-1636467624594.png

 

First VM in Spoke 1 network 

MohamedT_Trabelsi_0-1636467847806.png

 

Second VM in Spoke 2 network 

MohamedT_Trabelsi_1-1636467915006.png

 

====> The result of the test : 

 

Ping from VM1 To VM2 

MohamedT_Trabelsi_3-1636468068276.png

 

Ping from VM2 to VM1

MohamedT_Trabelsi_2-1636468027868.png

 

 

0 Replies