AZ-104: Configure and manage virtual networks for Azure administrators Flashcards
What is Azure virtual networking?
Azure virtual networks enable Azure resources, such as virtual machines, web apps, and databases, to communicate with: each other, users on the Internet, and on-premises client computers. You can think of an Azure network as a set of resources that links other Azure resources
Isolation and segmentation
Azure allows you to create multiple isolated virtual networks. When you set up a virtual network, you define a private Internet Protocol (IP) address space, using either public or private IP address ranges. You can then segment that IP address space into subnets, and allocate part of the defined address space to each named subnet.
For name resolution, you can use the name resolution service that’s built in to Azure, or you can configure the virtual network to use either an internal or an external Domain Name System (DNS) server
Internet communications
A VM in Azure can connect out to the Internet by default. You can enable incoming connections from the Internet by defining a public IP address or a public load balancer. For VM management, you can connect via the Azure CLI, Remote Desktop Protocol (RDP), or Secure Shell (SSH
Communicate between Azure resources
Virtual networks
Virtual networks can connect not only VMs, but other Azure resources, such as the App Service Environment, Azure Kubernetes Service, and Azure virtual machine scale sets.
Service endpoints
You can use service endpoints to connect to other Azure resource types, such as Azure SQL databases and storage accounts. This approach enables you to link multiple Azure resources to virtual networks, thereby improving security and providing optimal routing between resources
Communicate with on-premises resources
Point-to-site Virtual Private Networks
This approach is like a Virtual Private Network (VPN) connection that a computer outside your organization makes back into your corporate network, except that it’s working in the opposite direction. In this case, the client computer initiates an encrypted VPN connection to Azure, connecting that computer to the Azure virtual network
Communicate with on-premises resources 2
Site-to-site Virtual Private Networks A site-to-site VPN links your on-premises VPN device or gateway to the Azure VPN gateway in a virtual network. In effect, the devices in Azure can appear as being on the local network. The connection is encrypted and works over the Internet
Communicate with on-premises resources 3
Azure ExpressRoute
For environments where you need greater bandwidth and even higher levels of security, Azure ExpressRoute is the best approach. Azure ExpressRoute provides dedicated private connectivity to Azure that does not travel over the Internet
Route tables
A route table allows you to define rules as to how traffic should be directed. You can create custom route tables that control how packets are routed between subnets.
Border Gateway Protocol (BGP
Border Gateway Protocol (BGP) works with Azure VPN gateways or ExpressRoute to propagate on-premises BGP routes to Azure virtual networks
Connect virtual networks / network peering
You can link virtual networks together using virtual network peering. Peering enables resources in each virtual network to communicate with each other. These virtual networks can be in separate regions, allowing you to create a global interconnected network through Azure
Address overlapping
Can’t have two address spaces overlapping in the same virtual network
Subnet
Subnet names must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.
Network security group
Network security group
Network security groups have security rules that enable you to filter the type of network traffic that can flow in and out of virtual network subnets and network interfaces. You create the network security group separately, and then associate it with the virtual network.
What is a VPN gateway?
An Azure virtual network gateway provides an endpoint for incoming connections from on-premises locations to Azure over the Internet
Each virtual network can have only one VPN gateway. All connections to that VPN gateway share the available network bandwidth
gateway type
A key setting is the gateway type. The gateway type determines the way the gateway functions. For a VPN gateway, the gateway type is “vpn”. Options for VPN gateways includ
Plan a VPN gateway
When you’re planning a VPN gateway, there are three architectures to consider:
Point to site over the Internet
Site to site over the Internet
Site to site over a dedicated network, such as Azure ExpressRoute
Design considerations
When you design your VPN gateways to connect virtual networks, you must consider the following factors:
Subnets cannot overlap
It is vital that a subnet in one location does not contain the same address space as in another location.
IP addresses must be unique
You cannot have two hosts with the same IP address in different locations, as it will be impossible to route traffic between those two hosts and the network-to-network connection will fail.
VPN gateways need a gateway subnet called GatewaySubnet
It must have this name for the gateway to work, and it should not contain any other resources.
Create a VPN gateway
RouteBased
Route-based VPN devices use any-to-any (wildcard) traffic selectors, and let routing/forwarding tables direct traffic to different IPsec tunnels. Route-based connections are typically built on router platforms where each IPsec tunnel is modeled as a network interface or VTI (virtual tunnel interface).
Create a VPN gateway 2
PolicyBased
Policy-based VPN devices use the combinations of prefixes from both networks to define how traffic is encrypted/decrypted through IPsec tunnels. A policy-based connection is typically built on firewall devices that perform packet filtering. IPsec tunnel encryption and decryption are added to the packet filtering and processing engine.
Azure ExpressRoute
Microsoft Azure ExpressRoute enables organizations to extend their on-premises networks into the Microsoft Cloud over a private connection implemented by a connectivity provider. This arrangement means that the connectivity to the Azure datacenters doesn’t go over the Internet but across a dedicated link. ExpressRoute also facilitates efficient connections with other Microsoft cloud-based services, such as Microsoft 365 and Dynamics 365
ExpressRoute connectivity models
IP VPN network (any-to-any)
Virtual cross-connection through an Ethernet exchange
Point-to-point Ethernet connection
What is layer 3 connectivity?
Microsoft uses an industry-standard dynamic routing protocol (BGP) to exchange routes between your on-premises network, your instances in Azure, and Microsoft public addresses. We establish multiple BGP sessions with your network for different traffic profiles.
Any-to-any (IPVPN) networks
IPVPN providers typically provide connectivity between branch offices and your corporate datacenter over managed layer 3 connections. With ExpressRoute, the Azure datacenters appear as if they were another branch office
Virtual cross-connection through an Ethernet Exchange
If your organization is co-located with a cloud exchange facility, you request cross-connections to the Microsoft Cloud through your provider’s Ethernet exchange. These cross-connections to the Microsoft Cloud can operate at either layer 2 or layer 3 managed connections, as in the networking OSI model
Point-to-point Ethernet connection
Point-to-point Ethernet links can provide layer 2 or managed layer 3 connections between your on-premises datacenters or offices to the Microsoft Cloud
What are ExpressRoute circuits
What are ExpressRoute circuits
An ExpressRoute circuit is the logical connection between your on-premises infrastructure and the Microsoft Cloud
An ExpressRoute circuit isn’t equivalent to a network connection or a network device. Each circuit is defined by a GUID, called a service or s-key. This s-key provides the connectivity link between Microsoft, your connectivity provider, and your organization - it isn’t a cryptographic secret. Each s-key has a one-to-one mapping to an Azure ExpressRoute circuit
Routing domains
ExpressRoute circuits then map to routing domains, with each ExpressRoute circuit having multiple routing domains. These domains are the same as the two peerings listed above. In an active-active configuration, each pair of routers would have each routing domain configured identically, thus providing high availability. The Azure private peering names represent the IP addressing schemes
Azure private peering
Azure private peering connects to Azure compute services such as virtual machines and cloud services that are deployed with a virtual network. As far as security goes, the private peering domain is simply an extension of your on-premises network into Azure
You can connect only one virtual network to the private peering domain
Microsoft peering
Microsoft peering supports connections to cloud-based SaaS offerings, such as Microsoft 365 and Dynamics 365. This peering option provides bi-directional connectivity between your company’s WAN and Microsoft cloud services.
ExpressRoute health
As with most features in Microsoft Azure, you can monitor ExpressRoute connections to ensure that they are performing satisfactorily. Monitoring includes coverage of the following areas:
Availability
Connectivity to virtual networks
Bandwidth utilization
The key tool for this monitoring activity is Network Performance Monitor, particularly NPM for ExpressRoute.
Azure Ip Addressing
In Azure, you typically would implement a network security group and a firewall. You use subnets to isolate front-end services, including web servers and DNS, and back-end services like databases and storage systems
Basic properties of Azure virtual networks
A virtual network is your network in the cloud. You can divide your virtual network into multiple subnets. Each subnet has a portion of the IP address space that is assigned to your virtual network. You can add, remove, expand, or shrink a subnet if there are no VMs or services deployed in it.
Basic properties of Azure virtual networks
The smallest subnet that is supported uses a /29 subnet mask. The largest supported subnet uses a /8 subnet mask
Address overlapping
There can be no IP address overlap for interconnected networks
- 0.0.0 to 10.255.255.255
- 16.0.0 to 172.31.255.255
- 168.0.1 to 192.168.255.255
not routable over the internet
Public IP addresses
Basic IP
Basic IPs are open by default. We recommend that you use network security groups to restrict inbound or outbound traffic.
They do not support availability zone scenarios. You must use a Standard SKU public IP for an availability zone scenario
Standard Public IP
Standard IPs are secure by default and closed to inbound traffic. You must explicitly allow inbound traffic by using a network security group
Standard IPs are zone-redundant by default and optionally zonal (they can be created zonal and guaranteed in a specific availability zone)
Public IP 2
Public IP addresses can’t be moved between regions; all IP addresses are region-specific. If your business needs to have datacenters in different regions, you would have a different public IP address range for each region. You can use technology like Azure Traffic Manager to balance between region-specific instances
To ensure a static range of public IP addresses, you can create a public IP address prefix. You can’t specify the addresses when you create the prefix, but after the prefix is created, the addresses will be fixed
classless inter-domain routing (CIDR) format
CIDR is a way to represent a block of network IP addresses. An IPv4 CIDR, specified as part of the IP address, shows the length of the network prefix
Subnet
The address range can’t overlap with other subnets in the virtual network or with the on-premises network
azure reserved address
The first three IP addresses are reserved for all subnets by default in Azure. For protocol conformance, the first and last IP addresses of all subnets also are reserved. An internal DHCP service within Azure assigns and maintains the lease of IP addresses. The .1, .2, .3, and last IP addresses are not visible or configurable by the Azure customer. These addresses are reserved and used by internal Azure services
Remember that Azure uses the first three addresses on each subnet. The first and last IP addresses of the subnets also are reserved for protocol conformance. Therefore, the number of possible addresses on an Azure subnet is 2^n-5, where n represents the number of host bits
Connect services by using virtual network peering
In peered virtual networks, traffic between virtual machines is routed through the Azure network. The traffic uses only private IP addresses. It doesn’t rely on internet connectivity, gateways, or encrypted connections. The traffic is always private, and it takes advantage of the high bandwidth and low latency of the Azure backbone network
types of peering connections
Virtual network peering connects virtual networks in the same Azure region, such as two virtual networks in North Europe.
Global virtual network peering connects virtual networks that are in different Azure regions, such as a virtual network in North Europe and a virtual network in West Europe
Reciprocal connections
you have to create connections in each virtual network.
Cross-subscription virtual network peering
When you use virtual network peering across subscriptions, you might find that an administrator of one subscription doesn’t administer the peer network’s subscription. The administrator might not be able to configure both ends of the connection. To peer the virtual networks when both subscriptions are in different Azure Active Directory tenants, the administrators of each subscription must grant the peer subscription’s administrator the Network Contributor role on their virtual network
Transitivity
Virtual network peering is nontransitive. Only virtual networks that are directly peered can communicate with each other. The virtual networks can’t communicate with the peers of their peers.
for example, that your three virtual networks (A, B, C) are peered like this: A B C. Resources in A can’t communicate with resources in C because that traffic can’t transit through virtual network B. If you need communication between virtual network A and virtual network C, you must explicitly peer these two virtual networks
Gateway transit
You can configure transitive connections on-premises if you use virtual network gateways as transit points. Using gateway transit, you can enable on-premises connectivity without deploying virtual network gateways to all your virtual networks. This method might reduce cost and complexity. By using gateway peering, you can configure a single virtual network as a hub network. Connect this hub network to your on-premises datacenter and share its virtual network gateway with peers.
Overlapping address spaces
IP address spaces of connected networks within Azure and between Azure and your on-premises system can’t overlap. This is also true for peered virtual networks. Keep this rule in mind when you’re planning your network design. In any networks you connect through virtual network peering, VPN, or ExpressRoute, assign different address spaces that don’t overlap
VPNs use the internet to connect your on-premises datacenter to the Azure backbone through an encrypted tunnel. You can use a site-to-site configuration to connect virtual networks together through VPN gateways. VPN gateways have higher latency than virtual network peering setups. They’re more complex to manage, and they can cost more.
When virtual networks are connected through both a gateway and virtual network peering, traffic flows through the peering configuration
VPN
command to peer connections
az network vnet peering create \
> –name SalesVNet-To-MarketingVNet \
> –remote-vnet MarketingVNet \
> –resource-group learn-65e72839-7c90-4f1b-b29a-cbbdebc8dab7 \
> –vnet-name SalesVNet \
> –allow-vnet-access
Network security groups
Network security groups filter network traffic to and from Azure resources. Network security groups contain security rules that you configure to allow or deny inbound and outbound traffic. You can use network security groups to filter traffic between VMs or subnets, both within a virtual network and from the internet
Network security group assignment and evaluation
Network security groups are assigned to a network interface or a subnet. When you assign a network security group to a subnet, the rules apply to all network interfaces in that subnet. You can restrict traffic further by associating a network security group to the network interface of a VM
Network security group assignment and evaluation 2
Inbound traffic is first evaluated by the network security group applied to the subnet, and then by the network security group applied to the network interface. Conversely, outbound traffic from a VM is first evaluated by the network security group applied to the network interface, and then by the network security group applied to the subnet
Network security group assignment and evaluation 3
Each subnet and network interface can have one network security group applied to it. Network security groups support TCP, UDP, and ICMP, and operate at Layer 4 of the OSI model
processing rules by rule number
For example, suppose your company has created a security rule to allow inbound traffic on port 3389 (RDP) to your web servers, with a priority of 200. Next, suppose that another admin has created a rule to deny inbound traffic on port 3389, with a priority of 150. The deny rule takes precedence, because it’s processed first. The rule with priority 150 is processed before the rule with priority 200
Default security rules
When you create a network security group, Azure creates several default rules. These default rules can’t be changed, but can be overridden with your own rules. These default rules allow connectivity within a virtual network and from Azure load balancers. They also allow outbound communication to the internet, and deny inbound traffic from the internet.
Service tags
You use service tags to simplify network security group security even further. You can allow or deny traffic to a specific Azure service, either globally or per region
Service tags represent a group of IP addresses, and help simplify the configuration of your security rules. For resources that you can specify by using a tag, you don’t need to know the IP address or port details.
Virtual network service endpoints
Use virtual network service endpoints to extend your private address space in Azure by providing a direct connection to your Azure services. Service endpoints let you secure your Azure resources to only your virtual network. Service traffic will remain on the Azure backbone, and doesn’t go out to the internet
How service endpoints work
To enable a service endpoint, you must do the following two things:
Turn off public access to the service.
Add the service endpoint to a virtual network.
When you enable a service endpoint, you restrict the flow of traffic, and enable your Azure VMs to access the service directly from your private address space. Devices cannot access the service from a public network. On a deployed VM vNIC, if you look at Effective routes, you’ll notice the service endpoint as the Next Hop Type
Service endpoints and hybrid networks
Service resources that you’ve secured by using virtual network service endpoints are not, by default, accessible from on-premises networks. To access resources from an on-premises network, use NAT IPs. If you use ExpressRoute for connectivity from on-premises to Azure, you have to identify the NAT IP addresses that are used by ExpressRoute. By default, each circuit uses two NAT IP addresses to connect to the Azure backbone network. You then need to add these IP addresses into the IP firewall configuration of the Azure service resource (for example, Azure Storage)
What is Azure Bastion?
Azure Bastion provides a secure remote connection from the Azure portal to Azure virtual machines (VMs) over Transport Layer Security (TLS). Provision Azure Bastion to the same Azure virtual network as your VMs or to a peered virtual network. Then connect to any VM on that virtual network or a peered virtual network directly from the Azure portal
Provide secure RDP and SSH connectivity to an internal VM
You can use Azure Bastion to easily open an RDP or SSH session from the Azure portal to a VM that’s not publicly exposed. Azure Bastion connects to your virtual machines over private IP. You don’t have to expose RDP ports, SSH ports, or public IP addresses for your internal VMs
Azure Bastion Key Features
Traffic initiated from Azure Bastion to target virtual machines stays within the virtual network or between peered virtual networks.
There’s no need to apply NSGs to the Azure Bastion subnet, because it’s hardened internally. For additional security, you can configure NSGs to allow only remote connections to the target virtual machines from the Azure Bastion host.
Azure Bastion helps protect against port scanning. RDP ports, SSH ports, and public IP addresses aren’t publicly exposed for your VMs.
Azure Bastion helps protect against zero-day exploits. It sits at the perimeter of your virtual network. So you don’t need to worry about hardening each of the virtual machines in your virtual network. The Azure platform keeps Azure Bastion up to date.
The service integrates with native security appliances for an Azure virtual network, like Azure Firewall.
You can use the service to monitor and manage remote connections
How does Azure Bastion work?
An Azure Bastion deployment is per virtual network or peered virtual network. It’s not per subscription, account, or virtual machine (VM). After you provision an Azure Bastion service in your virtual network, the RDP or SSH experience is available to all your VMs in the same virtual network
How does Azure Bastion work? 2
Browser connects to the Azure Bastion host. The browser connects to Azure Bastion over the internet by using Transport Layer Security (TLS) and the public IP of the Azure Bastion host. Azure Gateway Manager manages portal connections to the Azure Bastion service on port 443 or 4443.
Bastion connects to the VM by using RDP or SSH. Azure Bastion is deployed in a separate subnet called AzureBastionSubnet within the virtual network. You create the subnet when you deploy Azure Bastion. The subnet can have address spaces with a /27 subnet mask or larger. Don’t deploy other Azure resources to this subnet or change the subnet name.
Bastion streams the VM to the browser. Azure Bastion uses an HTML5-based web client that’s automatically streamed to your local device. The Azure Bastion service packages the session information by using a custom protocol. The packages are transmitted through TLS
Verify Azure Bastion
Direction Allow
Inbound RDP and SSH connections from the Azure Bastion subnet IP address range to your VM subnet.
Inbound TCP access from the internet on port 443 to the Azure Bastion public IP.
Inbound TCP access from Azure Gateway Manager on ports 443 or 4443. Azure Gateway Manager manages portal connections to the Azure Bastion service.
Outbound TCP access from the Azure platform on port 443. This traffic is used for diagnostic logging.
Deploy an Azure Bastion host in the Azure portal
Before you can deploy Azure Bastion, you need a virtual network. You can use an existing virtual network or deploy Azure Bastion as you create a virtual network. Create a subnet in the virtual network called AzureBastionSubnet. If you have a VM that’s on the same or a peered virtual network, you complete the deployment in the Azure portal by selecting Azure Bastion when you connect to the VM
Configure diagnostic settings to generate audit logs
Azure Bastion can log information about remote user sessions. Review the logs to see who connected to which workloads, at what time, from where, and other relevant logging information.
To generate these logs, you must configure diagnostic settings on Azure Bastion. It can take several hours for the logs to stream to a storage account. The following sections show you how to configure Azure Bastion diagnostic settings so you can try this in your own subscription later.
What is Azure DNS?
Azure DNS is a hosting service for DNS domains that provides name resolution by using Microsoft Azure infrastructure.
In this unit, you’ll learn what DNS is and how it works. Then learn about Azure DNS, and why you would use it.
How does DNS work?
A DNS server carries out one of two primary functions:
Maintains a local cache of recently accessed or used domain names and their IP addresses. This cache provides a faster response to a local domain lookup request. If the DNS server can’t find the requested domain, it passes the request to another DNS server. This process repeats at each DNS server until either a match is made, or the search times out.
Maintains the key-value pair database of IP addresses and any host or subdomain that the DNS server has authority over. This function is often associated with mail, web, and other internet domain services
DNS server assignment
In order for a computer, server, or other network-enabled device to access web-based resources, it must reference a DNS server.
When you connect by using your on-premises network, the DNS settings come from your server. When you connect by using an external location, like a hotel, the DNS settings come from the internet service provider (ISP).
DNS settings for your domain
As the administrator for your company, you want to set up a DNS server by using Azure DNS. In this instance, the DNS server will act as a start of authority (SOA) for your domain
DNS record types
A is the host record, and is the most common type of DNS record. It maps the domain or host name to the IP address.
CNAME is the canonical name, or the alias for an A record. If you had different domain names that all accessed the same website, you would use CNAME.
MX is the mail exchange record. It maps mail requests to your mail server, whether hosted on-premises or in the cloud.
TXT is the text record. It’s used to associate text strings with a domain name. Azure and Microsoft 365 use TXT records to verify domain ownership.
The SOA and NS records are created automatically when you create a DNS zone by using Azure DNS.
What is Azure DNS? 2
Azure DNS allows you to host and manage your domains by using a globally distributed name server infrastructure. It allows you to manage all of your domains by using your existing Azure credentials.
Azure DNS acts as the SOA for the domain.
You can’t use Azure DNS to register a domain name. You use a third-party domain registrar to register your domain