Configure and manage virtual networking
10.0.0.0/24
10.0.0.0/16
IP | Subnet Mask | CCIDR |
---|---|---|
192.0.2.0 | 255.255.255.0 | 192.0.2.0/24 |
192.0.2.0 | 255.255.0.0 | 192.0.2.0/16 |
Basic SKU: If you are creating a public IP address in a region that supports availability zones, the Availability zone setting is set to None by default. Basic Public IPs do not support Availability zones. Standard SKU: A Standard SKU public IP can be associated to a virtual machine or a load balancer front end.
A network interface enables an Azure Virtual Machine to communicate with internet, Azure, and on-premises resources. A virtual machine created with the Azure portal, has one network interface with default settings.
You can only assign a network interface to a virtual network that exists in the same subscription and location as the network interface.
You can use an Azure network security group to filter network traffic between Azure resources in an Azure virtual network. A network security group contains security rules that allow or deny inbound network traffic to, or outbound network traffic from, several types of Azure resources. For each rule, you can specify source and destination, port, and protocol.
NSG can be attached to:
Resource | Can be attached |
---|---|
Network interface | :white_check_mark: |
Subnet | :white_check_mark: |
Virtual Network | :x: |
You can create a VM without NSG associated but it’s risky.
Nothing possible from external :bangbang:
Feature | Basic | Standard |
---|---|---|
Cost | Free | Charged per hour |
SLA | NO SLA | 99,99% |
Health Probes | TCP, HTTP | TCP, HTTP, HTTPS |
Availability Zones Support | :x: | :white_check_mark: |
Backend Pool | only if part of Availability Set or Availability Zones |
Also indipendent VM can be added |
Public IP | Basic/Standard SKU | Only Standard SKU can be added |
Public IP of the VMs | Only Public IP with basic SKU | TBV |
NAT - Network Address Tranlation Connecting to the VM1 (without public IP) by using the NAT on the IP FrontEnd of the Load Balancer.
Example: 68.219.200.220:49152 (RDP)
Virtual Network Peering is used to connect two Azure virtual networks together via the backbone network.
Azure supports connecting two virtual networks located in the same region or networks located across regions.
Once you enable virtual network peering between two virtual networks, the virtual machines can then communicate via their private IP addresses across the peering connection.
You can also peer virtual networks that are located across different subscriptions.
The virtual networks can’t have overlapping CIDR blocks.
A Point-to-Site (P2S) VPN gateway connection lets you create a secure connection to your virtual network from an individual client computer. A P2S connection is established by starting it from the client computer.
Secure connection between the on premises pc and the VM on its private IP.
On the VN I have to install a Gateway SUbnet.
The gateway subnet is part of the virtual network IP address range that you specify when configuring your virtual network. It contains the IP addresses that the virtual network gateway resources and services use.
When you create the gateway subnet, you specify the number of IP addresses that the subnet contains. The number of IP addresses needed depends on the VPN gateway configuration that you want to create. Some configurations require more IP addresses than others. We recommend that you create a gateway subnet that uses a /27 or /28 (or /29.)
Certificates are needed for authentication to avoid any pc pc in the world can connec to the VNG.
root certificate
$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature `
-Subject "CN=VPNRoot" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "Cert:\CurrentUser\My" -KeyUsageProperty Sign -KeyUsage CertSign
client certificate
New-SelfSignedCertificate -Type Custom -DnsName P2SChildCert -KeySpec Signature `
-Subject "CN=VPNCert" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "Cert:\CurrentUser\My" `
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")
Authentication Type: Azure
Azure Point-to-Site VPN with Certificate Based Authentication
Azure VPN gateways provide cross-premises connectivity between customer premises and Azure.
Site-to-site VPN gateway connection from your on-premises network to the VNet.
If the VPN device that you want to connect to has changed its public IP address, you need to modify the local network gateway to reflect that change. :bangbang:
Connecting a virtual network to another virtual network using the VNet-to-VNet connection type is similar to creating a Site-to-Site IPsec connection to an on-premises location. Both connectivity types use a VPN gateway to provide a secure tunnel using IPsec/IKE, and both function the same way when communicating.