001 S8-Slides
001 S8-Slides
001 S8-Slides
Memi Lavi
www.memilavi.com
Networking
A Word of Caution:
NEVER VM
Weather API
VM
Catalog App
VNets
SubNets
Load Balancer
Application Gateway
Virtual Networks
VNet 1 VNet 2
X
VM resources in other
VM
VM
VNets
VM
Virtual Networks
your VNet
VNet Pricing
• Or IP Range
• Can be customized
and 32
• The number indicates the number of bits that are allocated to the
8 bits allocated
24 bits allocated to address for range
109.186.149.240 /24
8 bits 8 bits 8 bits 8 bits
109.186.149.000 – 109.186.149.255
Bits refresher: 256 Addresses
00000000 = 0
11111111=255
CIDR Notation Example #2
109.186.149.240 /16
8 bits 8 bits 8 bits 8 bits
109.186.000.000 – 109.186.255.255
Bits refresher: 65,536 Addresses
00000000 = 0
11111111=255
Probably way too big…
CIDR Notation Example #3
109.186.144.000 – 109.186.159.255
Bits refresher: 4,096 Addresses
00000000 = 0
11111111=255
CIDR Notation
• ie. https://www.ipaddressguide.com/cidr
CIDR Notation
Subnet
Frontend
*By default, VM
can be customized VM
Subnet
Backend
VM
Addresses of Subnets
• Think of it as a mini-firewall
• Is free
How NSG Works?
• Looks at 5 tuples:
• The lower the number – the higher the priority of the rule
NSG and VMs
anyone
• Examples:
• Separate systems
• System layers
• Sensitive databases
Network Peering
• Main reasoning:
resources in a VNet
VM
that has public access Front End
VM
Database
Network Peering
• So…
NSG
Open Port 80
VNet 2 VNet 1
VM VM
Database Front End
Network Peering
• But…
Network Peering
to the rescue!
Network Peering
• Not free
Network Peering
NSG
Open Port 80
VNet 2 VNet 1
Peering
VM VM
Database Front End
NSG
Open Port 1433
Cloud Architecture
VNet VNet
NSG NSG
NSG
ACR
Cart Docker
Cloud Architecture
Attack Surface
VNet VNet
NSG NSG
NSG
ACR
Cart Docker
Secure VM Access
JIT Access
VPN
Jump Box
Bastion
JIT Access
• When need to access one of the other VMs – connect to this one
VNet VNet
NSG NSG
NSG
ACR
Cart Docker
Bastion
• Cost
the cloud
• Is free!
Service Endpoint
• Voila!
Without Service Endpoint
The Internet
NSG
VNet
App Service VM
Backend App Front End
With Service Endpoint
Note:
1. Traffic leaves the VNet
2. There is a public IP on the PaaS
The Internet service (App Service)
3. Can’t be used from on-prem
network
• Almost…
NSG
VNet
App Service VM
Backend App Front End
Service Endpoint
the cloud
• Isn’t free
Private Link
The Internet
NSG
VNet
App Service VM
Backend App Front End
With Private Link
Note:
1. Traffic never leaves the VNet
2. The VM talks to the App Service
The Internet via private IP
3. Can be used from on-prem
network
NSG
VNet
App Service VM
Backend App Front End
Private Link
Server
gateway is required
SE / PL vs VNet Integration
NSG NSG
• VNet can be configured like any other VNet – Subnets, NSGs, etc
• Quite expensive…
ASE
VNet 1
Subnet
Frontend
ASE
Frontend App
Subnet
Backend
VM
Load Balancer
Source: https://docs.microsoft.com/en-us/windows-hardware/drivers/network/windows-network-architecture-and-the-osi-model
Load Balancer
Load Balancer Distribution Algorithm
Basic Standard
Load Balancer Types
Basic Standard
No redundancy Redundant
Load Balancer Types
Basic Standard
No redundancy Redundant
Open by default Secure by default
Load Balancer Types
Basic Standard
No redundancy Redundant
Open by default Secure by default
Up to 300 instances Up to 1000 instances
Load Balancer Types
Basic Standard
No redundancy Redundant
Open by default Secure by default
Up to 300 instances Up to 1000 instances
No SLA 99.99% SLA
Load Balancer Types
Basic Standard
No redundancy Redundant
Open by default Secure by default
Up to 300 instances Up to 1000 instances
No SLA 99.99% SLA
Free Not Free
Configuring Load Balancer
• 4 main configurations:
Public IP Public IP
204.222.76.09 224.3.101.55
Rule Rule
Backend Backend
Pool Pool
• Updates continuously
Imperva etc.)
Application Gateway
Application Gateway SKUs
WAF
AG Subnet
Service Endpoint +
Access Restrictions
NSG /
Private Link
VM App Service
Configuring Application Gateway
• 5 main configurations:
does this
NSG NSG
NSG
ACR
Cart Docker
Affinity
Affinity
Super Advanced
Application Gateway and Cookies
www.mysite.com www.mysite.com
Cookie dropped
by the browser
App Gateway
domain=myapp.azurewebsites.net
myapp.azurewebsites.net
App Service
Application Gateway and Cookies
• The solution:
App Gateway
Peering
Peering Peering
Frontend VNet
Backend VNet
Hub and Spoke Backend VNet
Peering
Peering Peering
Backend VNet
Datastore VNet Datastore VNet
Peering