<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>udr Archives - Apostolidis Cloud Corner</title>
	<atom:link href="https://www.cloudcorner.gr/tag/udr/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.cloudcorner.gr/tag/udr/</link>
	<description>Remarks from a Cloud Architect encounters</description>
	<lastBuildDate>Tue, 24 Oct 2023 08:44:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://www.cloudcorner.gr/wp-content/uploads/2021/04/cropped-cloudcorner2-32x32.png</url>
	<title>udr Archives - Apostolidis Cloud Corner</title>
	<link>https://www.cloudcorner.gr/tag/udr/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Azure Routing Experiences &#124; Scenario 3</title>
		<link>https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-3/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-3/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Sun, 06 Feb 2022 19:26:16 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[dns proxy]]></category>
		<category><![CDATA[peering]]></category>
		<category><![CDATA[private endpoints]]></category>
		<category><![CDATA[route tables]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[udr]]></category>
		<category><![CDATA[virtual network]]></category>
		<category><![CDATA[virtual network gateway]]></category>
		<category><![CDATA[vnet]]></category>
		<category><![CDATA[vnet peering]]></category>
		<category><![CDATA[vpn]]></category>
		<guid isPermaLink="false">https://20.113.141.97/?p=3859</guid>

					<description><![CDATA[<p>Designing the network routing, cloud &#38; hybrid, on a Hyperscaler like Microsoft Azure can get a real pain. I got</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-3/">Azure Routing Experiences | Scenario 3</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Designing the network routing, cloud &amp; hybrid, on a Hyperscaler like Microsoft Azure can get a real pain. I got an idea, to start playing with some common scenarios and make some notes, in order to have it as a reference. I end up with three scenarios. Those scenarios are referring to internal network topology, without public access, and I focus more on the routing aspect, the DNS configuration &amp; inspection through Azure Firewall.</p>



<ul class="wp-block-list"><li><a href="/microsoft/azure-routing-experiences-scenario-1/" data-type="post" data-id="3838">Scenario 1: Hybrid connectivity with Azure VPN Gateway</a></li><li><a href="/microsoft/azure-routing-experiences-scenario-2/" data-type="post" data-id="3846">Scenario 2: Hybrid connectivity with Azure VPN Gateway &amp; Traffic Inspection with Azure Firewall</a></li><li><a href="/microsoft/azure-routing-experiences-scenario-3/" data-type="post" data-id="3859">Scenario 3: Hybrid Connectivity with Azure VPN Gateway, second level peered networks &amp; full traffic inspection with Azure Firewall</a></li></ul>



<p>At the previews posts, we covered the basics of routing traffic from/to on-premises, inspecting all traffic through Azure Firewall, and configuring the DNS for accessing the Private Endpoints. In this scenario, I am experimenting with connectivity between on-premises, the Hub &amp; Spoke networks and a second level peered network (a network that is peered behind the Spoke network). </p>



<p>Recap of Scenario 1 &amp; 2: We have a Hub network, two Spoke networks and an IPSec VPN connection with my on-premises network. We established routing all traffic through the Azure Firewall for inspection &amp; configured DNS for accessing the Private Endpoint from on-premises &amp; all Azure VNets.</p>



<p>In the third scenario, I am adding a new Spoke VNet, the &#8220;Azure 2&#8221; peered with my hub, and a third VNet, the &#8220;Azure 3&#8221; that is only peered with the &#8220;Azure 2&#8221; VNet. To enable connectivity between the &#8220;Azure 3&#8221; VNet and the rest of the networks, including the on-premises, we need a router at the &#8220;Azure 2&#8221; VNet. This can be an NVA or Azure Firewall. In my case, I added an Azure Firewall. The Azure Firewall of &#8220;Azure 2&#8221; VNet has the private IP: 192.168.200.64.</p>



<ul class="wp-block-list"><li>Azure 3 VNet, VM Subnet Route Table:<ul><li>10.0.0.0/16 NH 192.168.200.68</li><li>192.168.0.0/20 NH 192.168.200.68</li><li>192.168.4.0/24 NH 192.168.200.68</li><li>192.168.5.0/24 NH 192.168.200.68</li><li>192.168.200.0/28 NH 192.168.200.68</li></ul></li></ul>



<ul class="wp-block-list"><li>Azure 2 VNet, AzureFirewallSubnet:<ul><li>10.0.0.0/0 NH Internet</li><li>10.0.0.0/16 NH 192.168.2.4</li><li>192.168.0.0/20 NH 192.168.2.4</li><li>192.168.4.0/24 NH 192.168.2.4</li><li>192.168.5.0/24 NH 192.168.2.4</li></ul></li></ul>



<ul class="wp-block-list"><li>Azure 2 VNet, VM Subnet:<ul><li>10.0.0.0/16 NH 192.168.200.68</li><li>192.168.4.0/24 NH 192.168.200.68</li><li>192.168.5.0/24 NH 192.168.200.68</li><li>192.168.0.0/20 NH 192.168.200.68</li><li>10.100.0.0/16 NH 192.168.200.64</li></ul></li></ul>



<ul class="wp-block-list"><li>Azure Hub VNet, AzureFirewallSubet:<ul><li>10.0.0.0/0 NH Internet</li><li>192.168.200.0/28 NH 192.168.200.68</li><li>10.100.0.0/16 NH 192.168.200.68</li></ul></li><li>Azure Hub VNet, VM Subnet:<ul><li>10.0.0.0/16 NH 192.168.2.4</li><li>192.168.4.0/24 NH 192.168.2.4</li><li>192.168.5.0/24 NH 192.168.2.4</li><li><strong>192.168.4.4/32 NH 192.168.2.4</strong></li><li>192.168.200.0/24 NH 192.168.2.4</li><li>10.100.0.0/16 NH 192.168.2.4</li></ul></li><li>Azure Hub VNet, GatewaySubnet:<ul><li>192.168.0.0/24 NH 192.168.2.4</li><li>192.168.4.0/24 NH 192.168.2.4</li><li>192.168.5.0/24 NH 192.168.2.4</li><li><strong>192.168.4.4/32 NH 192.168.2.4</strong></li><li>192.168.200.0/24 NH 192.168.2.4</li><li>10.100.0.0/16 NH 192.168.2.4</li></ul></li><li>Spoke 2 VNet, VM Subnet:<ul><li>10.0.0.0/16 NH 192.168.2.4</li><li>192.168.4.0/24 NH 192.168.2.4</li><li>192.168.0.0/24 NH 192.168.2.4</li><li>192.168.200.0/24 NH 192.168.2.4</li></ul></li></ul>



<h2 class="wp-block-heading" id="routing-example">Routing Example</h2>



<p>Let&#8217;s describe a packet&#8217;s journey. The On-premises Server X (10.0.2.10) makes sends a packet to 10.100.0.4. 1st hop the packet goes to the default gateway, reaching the on-premises VPN device, in our case the RRAS. The RRAS has a custom route for 10.100.0.0/16 and forwards the packet to the VPN interface. The packet reaches the Azure VPN Gateway The Azure VPN Gateway has a custom route for 10.100.0.0/16 and forwards the packet to the HUB Azure Firewall, 192.168.2.4. The HUB Azure Firewall has a custom route for 10.100.0.0/16 and forwards the packet to the &#8220;Azure 2&#8221; Azure Firewall, 192.168.200.68. The &#8220;Azure 2&#8221; Azure Firewall does not have a custom route, but it has a route for 10.100.0.0/16 that is automatically populated by the VNet peering. The Azure FIrewall knows to forward the packet through the VNet peering and reaches the destination.</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2022/02/image.png"><img fetchpriority="high" decoding="async" width="1024" height="322" src="/wp-content/uploads/2022/02/image-1024x322.png" alt="" class="wp-image-3879" srcset="https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-1024x322.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-300x94.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-768x241.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-1536x483.png 1536w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image.png 1654w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>You can find more commends and tests in the below diagram with the whole solution.</p>



<p>Diagram: (<a rel="noreferrer noopener" href="https://1drv.ms/u/s!AvpafHi49lqjgpstm9ojqEwNV80lKQ?e=60SmlZ" target="_blank">Click here to download a high-resolution SVG image</a>)</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2022/02/Azure-Hybrid-Network-AzFW-3rPT-BTP.drawio.png"><img decoding="async" width="1024" height="763" src="/wp-content/uploads/2022/02/Azure-Hybrid-Network-AzFW-3rPT-BTP.drawio-1024x763.png" alt="" class="wp-image-3860" srcset="https://www.cloudcorner.gr/wp-content/uploads/2022/02/Azure-Hybrid-Network-AzFW-3rPT-BTP.drawio-1024x763.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/Azure-Hybrid-Network-AzFW-3rPT-BTP.drawio-300x224.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/Azure-Hybrid-Network-AzFW-3rPT-BTP.drawio-768x572.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/Azure-Hybrid-Network-AzFW-3rPT-BTP.drawio-1536x1144.png 1536w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/Azure-Hybrid-Network-AzFW-3rPT-BTP.drawio.png 1663w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>References:<br><a href="/microsoft/azure-routing-experiences-scenario-1/">Azure Routing Experiences | Scenario 1 – Apostolidis Cloud Corner</a><br><a href="/microsoft/azure-routing-experiences-scenario-2/">Azure Routing Experiences | Scenario 2 – Apostolidis Cloud Corner</a><br><a href="https://docs.microsoft.com/en-us/azure/private-link/inspect-traffic-with-azure-firewall">Use Azure Firewall to inspect traffic destined to a private endpoint – Azure Private Link | Microsoft Docs</a><br><a href="https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns">Azure Private Endpoint DNS configuration | Microsoft Docs</a><br><a href="https://docs.microsoft.com/en-us/azure/dns/private-dns-virtual-network-links">What is a virtual network link subresource of Azure DNS private zones | Microsoft Docs</a><br><a href="https://docs.microsoft.com/en-us/azure/firewall/dns-details">Azure Firewall DNS Proxy details | Microsoft Docs</a><br><a href="https://docs.microsoft.com/en-us/azure/virtual-network/manage-route-table">Create, change, or delete an Azure route table | Microsoft Docs</a></p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div><div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div><div class="saboxplugin-desc"><div itemprop="description"><p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div></div><div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div><div class="clearfix"></div><div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:pr&#111;&#120;&#105;m&#097;g&#114;&#064;h&#111;&#116;m&#097;&#105;&#108;&#046;c&#111;&#109;" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div></div></div><p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure-routing-experiences-scenario-3%2F&amp;linkname=Azure%20Routing%20Experiences%20%7C%20Scenario%203" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure-routing-experiences-scenario-3%2F&amp;linkname=Azure%20Routing%20Experiences%20%7C%20Scenario%203" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure-routing-experiences-scenario-3%2F&#038;title=Azure%20Routing%20Experiences%20%7C%20Scenario%203" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-3/" data-a2a-title="Azure Routing Experiences | Scenario 3"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-3/">Azure Routing Experiences | Scenario 3</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-3/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Azure Routing Experiences &#124; Scenario 1</title>
		<link>https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-1/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-1/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Sun, 06 Feb 2022 18:41:14 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure firewall]]></category>
		<category><![CDATA[dns proxy]]></category>
		<category><![CDATA[peering]]></category>
		<category><![CDATA[private endpoints]]></category>
		<category><![CDATA[route tables]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[udr]]></category>
		<category><![CDATA[virtual network]]></category>
		<category><![CDATA[vnet]]></category>
		<category><![CDATA[vnet peering]]></category>
		<category><![CDATA[vpn]]></category>
		<guid isPermaLink="false">https://20.113.141.97/?p=3838</guid>

					<description><![CDATA[<p>Designing the network routing, cloud &#38; hybrid, on a Hyperscaler like Microsoft Azure can get a real pain. I got</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-1/">Azure Routing Experiences | Scenario 1</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Designing the network routing, cloud &amp; hybrid, on a Hyperscaler like Microsoft Azure can get a real pain. I got an idea, to start playing with some common scenarios and make some notes, in order to have it as a reference. I end up with three scenarios. Those scenarios are referring to internal network topology, without public access, and I focus more on the routing aspect, the DNS configuration &amp; inspection through Azure Firewall.</p>



<ul class="wp-block-list"><li><a href="/microsoft/azure-routing-experiences-scenario-1/" data-type="post" data-id="3838"></a><a href="/microsoft/azure-routing-experiences-scenario-1/" data-type="post" data-id="3838"></a><a href="/microsoft/azure-routing-experiences-scenario-1/" data-type="post" data-id="3838">Scenario 1: Hybrid connectivity with Azure VPN Gateway</a></li><li><a href="/microsoft/azure-routing-experiences-scenario-1/" data-type="post" data-id="3838"></a><a href="/microsoft/azure-routing-experiences-scenario-1/" data-type="post" data-id="3838"></a><a href="/microsoft/azure-routing-experiences-scenario-2/" data-type="post" data-id="3846">Scenario 2: Hybrid connectivity with Azure VPN Gateway &amp; Traffic Inspection with Azure Firewall</a></li><li><a href="/microsoft/azure-routing-experiences-scenario-1/" data-type="post" data-id="3838"></a><a href="/microsoft/azure-routing-experiences-scenario-1/" data-type="post" data-id="3838"></a><a href="/microsoft/azure-routing-experiences-scenario-3/" data-type="post" data-id="3859">Scenario 3: Hybrid Connectivity with Azure VPN Gateway, second level peered networks &amp; full traffic inspection with Azure Firewall</a></li></ul>



<h2 class="wp-block-heading" id="scenario-1-hybrid-connectivity-through-azure-vpn-gateway">Scenario 1: Hybrid connectivity through Azure VPN gateway</h2>



<p>At the start, I created the on-premises network, using a RRAS (Windows Server 2019 with Routing &amp; Remote Access) to act as the router/VPN device and a Server with DNS service. The Azure estate has three VNets, in a hub &amp; spoke topology. One HUB and two Spokes, connected with the HUB with VNet peering. There is no peering between the spokes. My Azure HUB network has three subnets, one has a VPN Gateway, the second has a VM, and the third has an Azure Firewall. In this first scenario, the Azure Firewall acts only as a DNS Proxy. It is not included in routing.</p>



<ul class="wp-block-list"><li>On-premises network: 10.0.0.0/16</li><li>HUB VNet Address Space: 192.168.0.0/22</li><li>HUB GatewaySubnet: 192.168.1.0/24</li><li>HUB VMSubnet: 192.168.0.0/24</li><li>HUB Firewall Subnet: 192.168.2.0/24</li><li>Spoke1 (storage account): 192.168.4.0/24</li><li>Spoke2 (VM): 192.168.5.0/24</li></ul>



<p>The first spoke has a Private Link to my storage account. The second spoke has a VM.. Azure VPN Gateway knows all routes of its VNet, the peered VNets &amp; the routes propagated from the VPN connection. From on-premises, we can reach all resources using the VPN connection interface ( in RRAS I added a custom route &#8220;192.168.0.0 255.255.0.0 interface:AzureGW&#8221;)</p>



<p>From the VM of the HUB VNet (192.168.0.4), in order to be able to reach the on-premises network, we need a custom route, since the on-premises network is not populated to the VNet. I created a <a href="https://docs.microsoft.com/en-us/azure/virtual-network/manage-route-table" target="_blank" rel="noreferrer noopener">Route Table</a>, with route &#8220;10.0.0.0/16 Next Hop: Virtual Network Gateway&#8221; attached to the VM Subnet. </p>



<p>To access the <a href="https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns" data-type="URL" data-id="https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns" target="_blank" rel="noreferrer noopener">Private Endpoint of the Storage account we need some more resources &amp; configuration</a>. The storage account, as all PaaS services (like Web App &amp; Azure SQL) responds only to URI and not to IP. Since we have connected a Private Endpoint to the Storage Account, the Public Access is blocked. So, in order to connect to the storage account, we need the aprostore.file.core.windows.net to translate to the private IP of the storage account, the 192.168.4.4. The proper way to achieve this is by using DNS. </p>



<p>First, we need to create a Private DNS zone and <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/azure/dns/private-dns-virtual-network-links" target="_blank">link </a>it to the HUB VNET. For accessing blob storage we need a <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns#azure-services-dns-zone-configuration" target="_blank">Private DNS zone with the name</a> privatelink.blob.core.windows.net, for the file we need privatelink.file.core.windows.net. <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns#azure-services-dns-zone-configuration" target="_blank">More services here</a>. Then add the Storage Account Private Endpoint record to the Private DNS Zone. Now there is an A record azappsa with IP 192.168.4.4. Now, all Azure resources at the linked VNet, the HUB, are able to resolve the DNS records of the Private DNS Zone. We cannot resolve the records of the Azure Private DNS Zone from on-premises. To do so, we need a DNS server on Azure, to use as a conditional forwarder. This can be a Windows or Linux VM with DNS services or in my case, the Azure FIrewall with the <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/azure/firewall/dns-details" target="_blank">DNS proxy</a> enabled (I will use the whole functionality of the firewall to my next scenarios). I enabled the DNS Proxy on Azure, using default Azure DNS, and I added a conditional forwarding at the on-premises DNS &#8220;blob.core.windows.net -&gt; 192.168.2.4&#8221; and &#8220;file.core.windows.net -&gt; 192.168.2.44&#8221;. Now, I can successfully resolve the private IP of the storage account using its name, and be able to connect to it to both blob and to files with SMB access.</p>



<p>From the VM of the Spoke2 VNet (192.168.5.4), in order to be able to reach the on-premises network, we need a custom route, since the on-premises network is not populated to the VNet. I created a Route Table, with route &#8220;10.0.0.0/16 Next Hop: Virtual Network Gateway&#8221; attached to the VM Subnet. I added a second route &#8220;192.168.4.0/24 Next Hop: Virtual Network Gateway&#8221; &amp; changed the VNet DNS to 192.168.2.4 (the Azure Firewall) to be able to access the Spoke1 VNet for storage access.</p>



<h2 class="wp-block-heading" id="dns-routing-example">DNS &amp; Routing example</h2>



<p><strong>DNS</strong>: The on-premises Server X, 10.0.2.10, makes a request to https://azappsa.blob.core.windows.net. At first, it asks the DNS to resolve the URL to an IP. The DNS has a conditional forwarder about blob.core.windows.net, and asks the Azure Firewall, 192.168.2.4. Azure Firewall has a linked Private DNS zone that has a host record for azappsa.blob.core.windows.net and it resolves to 192.168.4.4. This information routes back to Server X. Now Server X knows that the IP address of azappsa.blob.core.windows.net is 192.168.4.4. </p>



<p><strong>Routing</strong>: To go to 192.168.4.4 first it asks its Default Gateway, in our case the RRAS. The RRAS has a custom route for 192.168.0.0/16 and forwards the packet to the VPN interface. The packet reaches the Azure VPN Gateway. The Azure VPN Gateway has a custom route for 192.168.0.0/24 BUT it also has a route for 192.168.4.4/32 that is automatically populated by the VNet peering. The /32 route is more specific than the /24 route, so the VPN Gateway forwards the packet directly to the Private Endpoint, bypassing the Azure Firewall. (At the <a href="/microsoft/azure-routing-experiences-scenario-2/">Azure Routing Experiences | Scenario 2</a> we will see how we will force the traffic through the Azure Firewall.</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2022/02/image-4.png"><img loading="lazy" decoding="async" width="1024" height="465" src="/wp-content/uploads/2022/02/image-4-1024x465.png" alt="" class="wp-image-3889" srcset="https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-4-1024x465.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-4-300x136.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-4-768x348.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-4.png 1080w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Please find below the whole solution diagram, I tried to make it as analytic as possible, without messing with too many lines. Also, I have some notes and tests below.</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2022/02/Azure-Hybrid-Network-VPN-GW-Only.drawio.png"><img loading="lazy" decoding="async" width="800" height="1024" src="/wp-content/uploads/2022/02/Azure-Hybrid-Network-VPN-GW-Only.drawio-800x1024.png" alt="" class="wp-image-3841" srcset="https://www.cloudcorner.gr/wp-content/uploads/2022/02/Azure-Hybrid-Network-VPN-GW-Only.drawio-800x1024.png 800w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/Azure-Hybrid-Network-VPN-GW-Only.drawio-234x300.png 234w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/Azure-Hybrid-Network-VPN-GW-Only.drawio-768x983.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/Azure-Hybrid-Network-VPN-GW-Only.drawio.png 825w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>



<p>References:<br><a href="https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-dns">Azure Private Endpoint DNS configuration | Microsoft Docs</a><br><a href="https://docs.microsoft.com/en-us/azure/dns/private-dns-virtual-network-links">What is a virtual network link subresource of Azure DNS private zones | Microsoft Docs</a><br><a href="https://docs.microsoft.com/en-us/azure/firewall/dns-details">Azure Firewall DNS Proxy details | Microsoft Docs</a><br><a href="https://docs.microsoft.com/en-us/azure/virtual-network/manage-route-table">Create, change, or delete an Azure route table | Microsoft Docs</a></p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div><div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div><div class="saboxplugin-desc"><div itemprop="description"><p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div></div><div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div><div class="clearfix"></div><div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:&#112;ro&#120;&#105;&#109;&#097;&#103;&#114;&#064;&#104;o&#116;&#109;&#097;&#105;l.co&#109;" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div></div></div><p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure-routing-experiences-scenario-1%2F&amp;linkname=Azure%20Routing%20Experiences%20%7C%20Scenario%201" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure-routing-experiences-scenario-1%2F&amp;linkname=Azure%20Routing%20Experiences%20%7C%20Scenario%201" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure-routing-experiences-scenario-1%2F&#038;title=Azure%20Routing%20Experiences%20%7C%20Scenario%201" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-1/" data-a2a-title="Azure Routing Experiences | Scenario 1"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-1/">Azure Routing Experiences | Scenario 1</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure-routing-experiences-scenario-1/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Infrastructure as Code &#124; Deploy a VNET &#038; NSG &#038; UDR</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Wed, 11 Mar 2020 22:45:35 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[IaC]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure template]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[iac]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[network security group]]></category>
		<category><![CDATA[nsg]]></category>
		<category><![CDATA[route table]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[udr]]></category>
		<category><![CDATA[virtual network]]></category>
		<category><![CDATA[vnet]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=3297</guid>

					<description><![CDATA[<p>Infrastructure as Code &#124; Deploy a VNET with NSG and UDRs Infrastructure as Code, or just IaC, provides three three</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/">Infrastructure as Code | Deploy a VNET &#038; NSG &#038; UDR</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Infrastructure as Code | Deploy a VNET with NSG and UDRs</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3312" src="https://www.e-apostolidis.gr/wp-content/uploads/2020/03/IaC.png" alt="IaC" width="1095" height="838" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC.png 1095w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC-300x230.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC-1024x784.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC-768x588.png 768w" sizes="auto, (max-width: 1095px) 100vw, 1095px" /></p>
<p>Infrastructure as Code, or just IaC, provides three three main advantages: cost reduction, faster execution and risk reduction, the attributes of the DevOps culture.</p>
<p style="text-align: justify;">Microsoft Azure Resource Manager allows the managing and provisioning of Azure Resources, that can be Virtual Machines, Virtual Networks, Storage Accounts, Apps, SQL Databases and everything that a computer data center includes, through machine-readable definition files, known as JSON templates, without the need of physical hardware configuration or interactive configuration tools.</p>
<p style="text-align: justify;">I am starting a series of posts about building infrastructure with JSON templates.</p>
<p style="text-align: justify;">The tool I use to build my Azure Json templates is the Visual Studio Code. You can download it from <a href="https://code.visualstudio.com/">https://code.visualstudio.com/</a> for every platform.</p>
<p style="text-align: justify;">To work with Azure Resource Manager you need the Azure Resource Manager Tools extension. Open the VS Code, go to the Extensions Section, search and install the Azure Resource Manager Tools extension.</p>
<p id="SEhVTIV"><img loading="lazy" decoding="async" class="alignnone wp-image-3306 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2020/03/img_5e695dd565ae7.png" alt="infrastructure as code" width="488" height="353" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/03/img_5e695dd565ae7.png 488w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/img_5e695dd565ae7-300x217.png 300w" sizes="auto, (max-width: 488px) 100vw, 488px" /></p>
<p>The extension is very helpful since it highlights the code, it provides references and intellisense.</p>
<p>At this post I am sharing &amp; explaining my Azure json template for deploying a Virtual Network, a Network Security Group and a Route Table.</p>
<p>You can find and download my working template at <a href="https://github.com/proximagr" target="_blank" rel="noopener noreferrer">my Git account</a> :</p>
<p><a href="https://github.com/proximagr/ARMTemplates/tree/master/VNET-2sub-NSG-UDR" target="_blank" rel="noopener noreferrer">https://github.com/proximagr/ARMTemplates/tree/master/VNET-2sub-NSG-UDR</a></p>
<h3>Json Template Guide</h3>
<p>Below you can find my template with comments, for better understanding.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="json" data-enlighter-theme="droide">{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
//** Define the Virtual Network Name */
    "vnetName": {
      "type": "string",
      "defaultValue": "Cloud-Corner-VNET",
      "metadata": {
        "description": "Cloud Corner VNET"
      }
//** Define the Address Space of the Virtual Network */
    },
      "vnetAddressPrefix": {
        "type": "string",
        "defaultValue": "10.0.0.0/24",
        "metadata": {
          "description": "Address prefix"
        }
//** Define the Address Space of the the First Subnet */
      },
      "subnet1Prefix": {
        "type": "string",
        "defaultValue": "10.0.0.0/27",
        "metadata": {
          "description": "Subnet 1 Prefix"
        }
//** Define the Name of the the First Subnet */
      },
      "subnet1Name": {
        "type": "string",
        "defaultValue": "Subnet1",
        "metadata": {
          "description": "Subnet 1 Name"
        }
//** Define the Address Space of the the Second Subnet */
      },
      "subnet2Prefix": {
        "type": "string",
        "defaultValue": "10.0.0.32/27",
        "metadata": {
          "description": "Subnet 2 Prefix"
        }
//** Define the Name of the the First Subnet */
      },
      "subnet2Name": {
        "type": "string",
        "defaultValue": "Subnet2",
        "metadata": {
          "description": "Subnet 2 Name"
        }
      },
//** Define the Name of the the Network Security Group */
      "networkSecurityGroup01Name": {
        "type": "string",
        "defaultValue": "Cloud-Corner-NSG-01",
        "metadata": {
          "description": "This is the name of the network security group"
        }
      },
//** Define the Name of the the First Route Table */
      "RouteTable01Name": {
        "type": "string",
        "defaultValue": "Cloud-Corner-UDR-01",
        "metadata": {
        "description": "Route Table 01 Name."
        }
      },
//** Define the Name of the the First Route of the First Route Table */
      "Route01Name": {
        "type": "string",
        "defaultValue": "To-internet",
        "metadata": {
          "description": "Route 01 Name."
        }
      },
//** Define the Next Hop Type of the the First Route of the First Route Table */
      "Route01NextHopType": {
        "type": "string",
        "allowedValues": [
        "VirtualNetworkGateway",
        "VnetLocal",
        "Internet",
        "VirtualAppliance",
        "None"
      ],
      "defaultValue": "VirtualAppliance",
        "metadata": {
          "description": "Route 01 Next Hop Type."
        }
      },
//** Define the Address Prefix of the First Route of the First Route Table */
      "Route01AddressPrefix": {
        "type": "string",
        "defaultValue": "0.0.0.0/0",
        "metadata": {
          "description": "Route 01 Address Prefix."
        }
      },
//** If you set "Virtyal Appliance for Next Hop Type, then you need to define the Next Hop IP Address, */
//** meaning the appliance's IP address. Here you define it for the First Route of the First Route Table */
        "RT01Route01NextHopIPAddress": {
        "type": "string",
        "defaultValue": "10.0.0.40",
        "metadata": {
          "description": "Next Hop IP Addess."
        }
      },
//** Define the Name of the Second Route Table */
      "RouteTable02Name": {
        "type": "string",
        "defaultValue": "Cloud-Corner-UDR-02",
        "metadata": {
          "description": "Route Table 02 Name."
        }
      },
//** Define the Name of the the First Route of the Second Route Table */
      "RT02Route01Name": {
        "type": "string",
        "defaultValue": "Local-Subnet",
        "metadata": {
        "description": "Route Table 02 Route 01 Name."
        }
      },
//** Define the Next Hop Type of the the First Route of the Second Route Table */
      "RT02Route01NextHopType": {
        "type": "string",
        "allowedValues": [
        "VirtualNetworkGateway",
        "VnetLocal",
        "Internet",
        "VirtualAppliance",
        "None"
      ],
      "defaultValue": "VnetLocal",
        "metadata": {
          "description": "Route 02 Next Hop Type."
        }
      },
//** Define the Address Prefix of the the First Route of the Second Route Table */
      "RT02Route01AddressPrefix": {
        "type": "string",
        "defaultValue": "10.0.0.0/27",
        "metadata": {
          "description": "Route Table 02 Route 01 Address Prefix."
        }
      },
//** Define the Name of the the Second Route of the Second Route Table */
        "RT02Route02Name": {
          "type": "string",
          "defaultValue": "To-subnet-1",
          "metadata": {
            "description": "Route Table 02 Route 01 Name."
          }
        },
//** Define the Next Hop Type of the the Second Route of the Second Route Table */
        "RT02Route02NextHopType": {
          "type": "string",
          "allowedValues": [
          "VirtualNetworkGateway",
          "VnetLocal",
          "Internet",
          "VirtualAppliance",
          "None"
        ],
        "defaultValue": "VirtualAppliance",
          "metadata": {
            "description": "Route 02 Next Hop Type."
          }
        },
//** Define the address prefix of the the Second Route of the Second Route Table */
        "RT02Route02AddressPrefix": {
          "type": "string",
          "defaultValue": "10.0.0.32/27",
          "metadata": {
            "description": "Route Table 02 Route 01 Address Prefix."
          }
      },
//** Define the next hop IP address (the virtual appliance's address) of the the Second Route of the Second Route Table */
        "RT02Route02NextHopIPAddress": {
          "type": "string",
          "defaultValue": "10.0.0.40",
          "metadata": {
            "description": "Next Hop IP Addess."
          }
        }
    },
//** I dont use any variables, you can exclude this section*/
  "variables": {},
  "resources": [
//* create the First Route Table &amp; Route*/
    {
    "apiVersion": "2017-10-01",
    "type": "Microsoft.Network/routeTables",
    "name": "[parameters('RouteTable01Name')]",
    "location": "[resourceGroup().location]",
    "properties": {
    "disableBgpRoutePropagation": true,
    "routes": [
      {
        "name": "[parameters('Route01Name')]",
        "properties": {
          "addressPrefix": "[parameters('Route01AddressPrefix')]",
          "nextHopType": "[parameters('Route01NextHopType')]",
          "nextHopIpAddress": "[parameters('RT01Route01NextHopIPAddress')]"
          }
        }
      ]
    }
  },
//* create the Second Route Table &amp; Routes*/
    {
    "apiVersion": "2017-10-01",
    "type": "Microsoft.Network/routeTables",
    "name": "[parameters('RouteTable02Name')]",
    "location": "[resourceGroup().location]",
    "properties": {
    "disableBgpRoutePropagation": true,
    "routes": [
      {
        "name": "[parameters('RT02Route01Name')]",
        "properties": {
          "addressPrefix": "[parameters('RT02Route01AddressPrefix')]",
          "nextHopType": "[parameters('RT02Route01NextHopType')]"
        }
      },
          {
        "name": "[parameters('RT02Route02Name')]",
        "properties": {
          "addressPrefix": "[parameters('RT02Route02AddressPrefix')]",
          "nextHopType": "[parameters('RT02Route02NextHopType')]",
          "nextHopIpAddress": "[parameters('RT02Route02NextHopIPAddress')]"
          }
        }
      ]
    }
  },
//* create teh Network Security Group */
    {
    "apiVersion": "2019-02-01",
    "type": "Microsoft.Network/networkSecurityGroups",
    "name": "[parameters('networkSecurityGroup01Name')]",
    "location": "[resourceGroup().location]",
    "properties": {
      "securityRules": [
        {
          "name": "HTTPS",
          "properties": {
            "description": "Open HTTPS to Public",
            "protocol": "Tcp",
            "sourcePortRange": "443",
            "destinationPortRange": "443",
            "sourceAddressPrefix": "*",
            "destinationAddressPrefix": "*",
            "access": "Allow",
            "priority": 101,
            "direction": "Inbound"
            }
          }
        ]
      }
    },
//* create the Virtual Network */
    {
      "apiVersion": "2018-10-01",
      "type": "Microsoft.Network/virtualNetworks",
      "name": "[parameters('vnetName')]",
      "location": "[resourceGroup().location]",
//*add a dependency in order to ensure that the NSG is created before the VNET, in order to be able to attach it*/
      "dependsOn": [
        "[parameters('networkSecurityGroup01Name')]"
      ],
      "properties": {
        "AddressSpace": {
          "AddressPrefixes": [
            "[parameters('vnetAddressPrefix')]"
          ]
        }
      },
      "resources": [
//* create the first subnet */
        {
        "apiVersion": "2018-10-01",
        "type": "subnets",
        "location": "[resourceGroup().location]",
        "name": "[parameters('subnet1Name')]",
//* add dependencies to create the resources with an order, because you need to ensure that the VNET is ready before creating the Subnet and also the Route Table*/
        "dependsOn": [
          "[parameters('vnetName')]",
          "[resourceId('Microsoft.Network/routeTables', parameters('RouteTable01Name'))]"
        ],
        "properties": {
        "AddressPrefix": "[parameters('subnet1Prefix')]",
//*attach the Newtork Securoty Group to the Subnet*/
        "networkSecurityGroup": {
        "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroup01Name'))]"},
//*attacht the First route table to the Subnet*/
        "routeTable": {
        "id": "[resourceId('Microsoft.Network/routeTables', parameters('RouteTable01Name'))]"
          }
         }
        },
//*create the second subnet*/
        {
        "apiVersion": "2018-10-01",
        "type": "subnets",
        "location": "[resourceGroup().location]",
        "name": "[parameters('subnet2Name')]",
        "dependsOn": [
          "[parameters('vnetName')]",
          "[parameters('subnet1Name')]",
          "[parameters('RouteTable02Name')]"
        ],
        "properties": {
          "AddressPrefix": "[parameters('subnet2Prefix')]",
//*attach the Newtork Securoty Group to the Subnet*/
          "networkSecurityGroup": {
          "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroup01Name'))]"},
//*attacht the second route table to the Subnet*/
          "routeTable": {
          "id": "[resourceId('Microsoft.Network/routeTables', parameters('RouteTable02Name'))]"
            }
          }
        }
      ]
    }
  ]
}</pre>
<p>&nbsp;</p>
<h3>Deploy the template</h3>
<p><strong>Deploy the template directly from here:</strong></p>
<p><a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fproximagr%2FARMTemplates%2Fmaster%2FVNET-2sub-NSG-UDR%2Fazuredeploy.json" target="_blank" rel="noopener noreferrer"> <img decoding="async" src="https://aka.ms/deploytoazurebutton" /> </a></p>
<p>&nbsp;</p>
<p>More Azure Resource Manager Templates: <a href="https://www.e-apostolidis.gr/microsoft/create-azure-file-shares-using-arm-template-powershell/">https://www.e-apostolidis.gr/microsoft/azure/create-azure-file-shares-using-arm-template-powershell/</a></p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:&#112;ro&#120;&#105;&#109;&#097;&#103;r&#064;&#104;&#111;t&#109;ai&#108;.&#099;&#111;&#109;" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Finfrastructure-as-code-deploy-a-vnet-nsg-udr%2F&amp;linkname=Infrastructure%20as%20Code%20%7C%20Deploy%20a%20VNET%20%26%20NSG%20%26%20UDR" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Finfrastructure-as-code-deploy-a-vnet-nsg-udr%2F&amp;linkname=Infrastructure%20as%20Code%20%7C%20Deploy%20a%20VNET%20%26%20NSG%20%26%20UDR" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Finfrastructure-as-code-deploy-a-vnet-nsg-udr%2F&#038;title=Infrastructure%20as%20Code%20%7C%20Deploy%20a%20VNET%20%26%20NSG%20%26%20UDR" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/" data-a2a-title="Infrastructure as Code | Deploy a VNET &amp; NSG &amp; UDR"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/">Infrastructure as Code | Deploy a VNET &#038; NSG &#038; UDR</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Custom pfSense on Azure Rm &#124; a complete guide</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Wed, 03 Jan 2018 15:12:52 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure vm]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[custom routes]]></category>
		<category><![CDATA[custom vhd]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[route tables]]></category>
		<category><![CDATA[udr]]></category>
		<category><![CDATA[upload vhd]]></category>
		<category><![CDATA[virtual network]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=1528</guid>

					<description><![CDATA[<p>Custom pfSense on Azure Rm &#124; a complete guide A complete guide on how to create a pfSense VM on</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/">Custom pfSense on Azure Rm | a complete guide</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1 style="text-align: justify;">Custom pfSense on Azure Rm | a complete guide</h1>
<p style="text-align: justify;">A complete guide on how to create a pfSense VM on a local Hyper-V server, prepare it for Microsoft Azure, upload the disk to Azure and create a multi-NIC VM.</p>
<p style="text-align: justify;">Download the latest image from https://www.pfsense.org/download/</p>
<p id="UOGOgbu" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1719 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a46417942ce4.png" alt="pfsense" width="554" height="365" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46417942ce4.png 554w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46417942ce4-300x198.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46417942ce4-120x80.png 120w" sizes="auto, (max-width: 554px) 100vw, 554px" /></p>
<p style="text-align: justify;">Open Hyper-V Manager create a Generation 1 VM. I added 4096 ram, 2 cores, use VHD, add an extra NIC (for second interface)  and select the downloaded ISO. (create a fixed VHD as Azure supports only fixed VHDs for custom VMs)</p>
<p id="bWwoqGz" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1703 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a4612db0c33f.png" alt="pfsense" width="300" height="484" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4612db0c33f.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4612db0c33f-186x300.png 186w" sizes="auto, (max-width: 300px) 100vw, 300px" /></p>
<p style="text-align: justify;">Start the VM and at the first screen press enter.</p>
<p id="mIaxRHN" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1700 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a4611c229af2.png" alt="pfsense" width="626" height="384" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4611c229af2.png 626w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4611c229af2-300x184.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4611c229af2-600x368.png 600w" sizes="auto, (max-width: 626px) 100vw, 626px" /></p>
<p style="text-align: justify;">At all screens I accepted the default settings. Finally at the reboot prompt remove the installation ISO.</p>
<p style="text-align: justify;">There is no need to setup VLANs, select the second interface for WAN and the first for LAN.</p>
<p id="jLbbuSk" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1705 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a4614323b079.png" alt="pfsense" width="636" height="472" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4614323b079.png 636w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4614323b079-300x223.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4614323b079-600x445.png 600w" sizes="auto, (max-width: 636px) 100vw, 636px" /></p>
<p id="FNJPixZ" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1706 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a46147b409db.png" alt="pfsense" width="653" height="137" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46147b409db.png 653w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46147b409db-300x63.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46147b409db-600x126.png 600w" sizes="auto, (max-width: 653px) 100vw, 653px" /></p>
<p style="text-align: justify;">Once the pfSense is ready press 2 and change the LAN (hn0) interface IP to one at your network. Then select the option 14 to enable SSH.</p>
<p id="ZWseqdU" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1720 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a464549bd64f.png" alt="pfsense" width="633" height="438" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a464549bd64f.png 633w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a464549bd64f-300x208.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a464549bd64f-600x415.png 600w" sizes="auto, (max-width: 633px) 100vw, 633px" /></p>
<p style="text-align: justify;">Now we can login with putty, with username admin password pfsense and press 8 for Shell access.</p>
<p id="FNSfbHz" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1711 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a4619a436eb5.png" alt="pfsense" width="653" height="415" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4619a436eb5.png 653w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4619a436eb5-300x191.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4619a436eb5-600x381.png 600w" sizes="auto, (max-width: 653px) 100vw, 653px" /></p>
<p style="text-align: justify;">The first thing is to update the packages running:</p>
<pre class="lang:sh decode:true ">pkg upgrade</pre>
<h2 style="text-align: justify;">Python</h2>
<p style="text-align: justify;">Then install Python, as it is requirement for the Azure Linux Agent.</p>
<p style="text-align: justify;">Search for Python packages running:</p>
<pre class="lang:sh decode:true ">pkg search python</pre>
<p id="jmunmwR" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1721 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a46475c9ca1b.png" alt="pfsense" width="631" height="112" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46475c9ca1b.png 631w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46475c9ca1b-300x53.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46475c9ca1b-600x106.png 600w" sizes="auto, (max-width: 631px) 100vw, 631px" /></p>
<p style="text-align: justify;">Install the latest Python package, setup tools and bash:</p>
<pre class="lang:sh decode:true">pkg install -y python27-2.7.14</pre>
<pre class="lang:ps decode:true">pkg search setuptools

pkg install py27-setuptools-36.2.2

ln -s /usr/local/bin/python /usr/local/bin/python2.7

pkg install -y bash</pre>
<h2 style="text-align: justify;">Azure Linux Agent</h2>
<p style="text-align: justify;">ref: <a href="https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/freebsd-create-upload-vhd">https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/freebsd-create-upload-vhd</a></p>
<pre class="lang:sh decode:true">pkg install git

git clone https://github.com/Azure/WALinuxAgent.git

cd WALinuxAgent

git tag

git checkout WALinuxAgent-2.1.1

git checkout WALinuxAgent-2.0.16

python setup.py install

ln -sf /usr/local/sbin/waagent /usr/sbin/waagent</pre>
<p style="text-align: justify;">check the agent is running:</p>
<pre class="lang:sh decode:true ">waagent -Version</pre>
<p id="XyDFgfJ" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1722 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a46540428ee9.png" alt="pfsense" width="536" height="54" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46540428ee9.png 536w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46540428ee9-300x30.png 300w" sizes="auto, (max-width: 536px) 100vw, 536px" /></p>
<p style="text-align: justify;">One final step before uploading the VHD to Azure is to set the LAN interface as dhcp.</p>
<p style="text-align: justify;">This can be done by the web interface, go to https://lanaddress, login using admin / pfsense, and go to interfaces / LAN and select DHCPas ipv4 configuration.</p>
<p id="imfoSFv" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1725 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a469d4f2dd21.png" alt="pfsense" width="306" height="351" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a469d4f2dd21.png 306w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a469d4f2dd21-262x300.png 262w" sizes="auto, (max-width: 306px) 100vw, 306px" /></p>
<p style="text-align: justify;">Now, shutdown the pfSense and upload it to Azure Storage.</p>
<p style="text-align: justify;">I use the Storage Explorer, <a href="https://azure.microsoft.com/en-us/features/storage-explorer/">https://azure.microsoft.com/en-us/features/storage-explorer/</a> a free and powerful tool to manage Azure Storage. Login to your Azure Account and press Upload. Select as Blob type: &#8220;Page blob&#8221;</p>
<p id="rlEuHoA" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1739 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62.png" alt="pfsense" width="855" height="649" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62.png 855w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62-300x228.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62-768x583.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62-600x455.png 600w" sizes="auto, (max-width: 855px) 100vw, 855px" /></p>
<p style="text-align: justify;">After the upload is completed we can create a multiple NIC VM. This cannot be accomplished from GUI. We will create this using PowerShell.</p>
<pre class="lang:ps decode:true ">$ResourceGroupName = "******"
$pfresourcegroup = "*******"
$StorageAccountName = "******"
$vnetname = "*****"
$location = "West Europe"
$vnet = Get-AzureRmVirtualNetwork -Name $vnetname -ResourceGroupName $ResourceGroupName
$backendSubnet = Get-AzureRMVirtualNetworkSubnetConfig -Name default -VirtualNetwork $vnet
$vmName="pfsense"
$vmSize="Standard_F1"
$vnet = Get-AzureRmVirtualNetwork -Name $vnetname -ResourceGroupName $ResourceGroupName
$pubip = New-AzureRmPublicIpAddress -Name "PFPubIP" -ResourceGroupName $pfresourcegroup -Location $location -AllocationMethod Dynamic
$nic1 = New-AzureRmNetworkInterface -Name "EXPFN1NIC1" -ResourceGroupName $pfresourcegroup -Location $location -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pubip.Id
$nic2 = New-AzureRmNetworkInterface -Name "EXPFN1NIC2" -ResourceGroupName $pfresourcegroup -Location $location -SubnetId $vnet.Subnets[0].Id
$VM = New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize
$VM | Set-AzureRmVMOSDisk `
            -VhdUri https://********.blob.core.windows.net/vhds/pfsensefix.vhd `
            -Name pfsenseos -CreateOption attach -Linux -Caching ReadWrite
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nic1.Id
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nic2.Id
$vm.NetworkProfile.NetworkInterfaces.Item(0).Primary = $true
New-AzureRMVM -ResourceGroupName $pfresourcegroup -Location $locationName -VM $vm -Verbose</pre>
<p style="text-align: justify;">Once the VM is created, go to the VM&#8217;s blade and scroll down to &#8220;Boot diagnostics&#8221;. There you can see a screenshot of the VM&#8217;s monitor.</p>
<p id="acIPyky" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1744 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4cddde2157b.png" alt="pfsense" width="1002" height="707" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cddde2157b.png 1002w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cddde2157b-300x212.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cddde2157b-768x542.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cddde2157b-600x423.png 600w" sizes="auto, (max-width: 1002px) 100vw, 1002px" /></p>
<p style="text-align: justify;">Then go to the Networking section and SSH to the Public IP.</p>
<p id="RpmtQJA" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1746 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ce2adeacc3.png" alt="pfsense" width="673" height="547" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce2adeacc3.png 673w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce2adeacc3-300x244.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce2adeacc3-600x488.png 600w" sizes="auto, (max-width: 673px) 100vw, 673px" /></p>
<p style="text-align: justify;">and also we can login to the Web Interface of the pfSense</p>
<p id="RTPgdSW" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1747 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a.png" alt="pfsense" width="882" height="630" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a.png 882w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a-300x214.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a-768x549.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a-600x429.png 600w" sizes="auto, (max-width: 882px) 100vw, 882px" /></p>
<p id="YIHfCde" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1748 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1.png" alt="pfsense" width="1161" height="857" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1.png 1161w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1-300x221.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1-768x567.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1-1024x756.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1-600x443.png 600w" sizes="auto, (max-width: 1161px) 100vw, 1161px" /></p>
<p style="text-align: justify;">In my case I have added both NICs at the same Subnet, but at a production environment add the LAN interface to the backend subnet and the WAN interface to the DMZ (public) subnet.</p>
<p style="text-align: justify;">Of course more NICs can be added to the VM, one for each Subnet at our environment.</p>
<h2 style="text-align: justify;">Route external traffic through the pfSense</h2>
<p style="text-align: justify;">We cannot change the gateway at an Azure VM, but we can use routing tables to route the traffic through the pfSense.</p>
<p style="text-align: justify;">From the Azure Portal, select New and search for Route table.</p>
<p id="OKjEcPT" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1749 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b.png" alt="pfsense" width="1037" height="309" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b.png 1037w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b-300x89.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b-768x229.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b-1024x305.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b-600x179.png 600w" sizes="auto, (max-width: 1037px) 100vw, 1037px" /></p>
<p style="text-align: justify;">We need to configure two things. One is to associate the Route table to a Subnet and the second is to create a Route.</p>
<p id="uHNKvMv" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1750 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ceae539c0b.png" alt="pfsense" width="232" height="111" /></p>
<p style="text-align: justify;">Open the &#8220;Route table&#8221; and click the &#8220;Routes&#8221;. Press &#8220;Add route&#8221; and in order to route all outbound traffic through the pfSense then add for Address prefix &#8220;0.0.0.0&#8221;, next hop type Virtual appliance&#8221; and Net hop address the ip address of the pfSense&#8217;s LAN interface IP.</p>
<p id="feCVtbZ" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1751 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4cec67cf571.png" alt="pfsense" width="569" height="302" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cec67cf571.png 569w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cec67cf571-300x159.png 300w" sizes="auto, (max-width: 569px) 100vw, 569px" /></p>
<p>Then go to the &#8220;Subnets&#8221; and associate the required subnets.</p>
<p id="IgXjKZN"><img loading="lazy" decoding="async" class="alignnone wp-image-1753 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4.png" alt="pfsense" width="1068" height="430" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4.png 1068w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4-300x121.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4-768x309.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4-1024x412.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4-600x242.png 600w" sizes="auto, (max-width: 1068px) 100vw, 1068px" /></p>
<p>One final thing to do is to enable IP Forwarding at the LAN interface of the pfSense, in order to be able to receive and forward traffic not originated for it.</p>
<p id="vsIVpQc"><img loading="lazy" decoding="async" width="907" height="321" class="alignnone size-full wp-image-1807 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/02/img_5a83ec9159a98.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/02/img_5a83ec9159a98.png 907w, https://www.cloudcorner.gr/wp-content/uploads/2018/02/img_5a83ec9159a98-300x106.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/02/img_5a83ec9159a98-768x272.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/02/img_5a83ec9159a98-600x212.png 600w" sizes="auto, (max-width: 907px) 100vw, 907px" /></p>
<p>&nbsp;</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:pr&#111;xim&#097;&#103;&#114;&#064;&#104;ot&#109;&#097;i&#108;&#046;c&#111;m" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fcustom-pfsense-on-azurerm-a-complete-guide%2F&amp;linkname=Custom%20pfSense%20on%20Azure%20Rm%20%7C%20a%20complete%20guide" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fcustom-pfsense-on-azurerm-a-complete-guide%2F&amp;linkname=Custom%20pfSense%20on%20Azure%20Rm%20%7C%20a%20complete%20guide" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fcustom-pfsense-on-azurerm-a-complete-guide%2F&#038;title=Custom%20pfSense%20on%20Azure%20Rm%20%7C%20a%20complete%20guide" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/" data-a2a-title="Custom pfSense on Azure Rm | a complete guide"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/">Custom pfSense on Azure Rm | a complete guide</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
	</channel>
</rss>
