Skip to content

Expert · Automation, SDN and cloud networking · topic 53 of 57 · 35 min

Virtualisation, VRFs and cloud networking

Explanation

A hypervisor lets one physical server run many virtual machines, connected by a virtual switch. VRFs give one router several separate routing tables. In the cloud you build your own private network (a VPC or VNet) with subnets, route tables, an internet gateway, a NAT gateway, and firewalls called security groups (stateful) and network ACLs (stateless).

Virtualisation: many machines on one server

A physical server is often busy only 10 to 20 percent of the time. Virtualisation splits it into many virtual machines (VMs). Each VM is a complete computer in software, with its own operating system, CPU share, memory and network card. The program that creates and runs VMs is called a hypervisor.

Type 1 (bare metal)Type 2 (hosted)
Runs onDirectly on the server hardwareOn top of a normal operating system
ExamplesVMware ESXi, Microsoft Hyper-V, KVMOracle VirtualBox, VMware Workstation
Used forData centres and the cloudLabs and testing on a laptop

VMs need a network too. The hypervisor provides a virtual switch, a software switch inside the server. Each VM's virtual network card plugs into it, and it connects to the physical network through the server's real network cards, usually on an 802.1Q trunk so different VMs can sit in different VLANs.

Containers are a lighter form of virtualisation. A container packs one application and its libraries, but shares the host's operating system kernel instead of running a whole OS. Containers start in seconds and use less memory than VMs. Docker builds and runs containers, and Kubernetes runs many of them across many servers.

VRFs: several routers inside one

A VRF (virtual routing and forwarding instance) is a separate routing table on one router. Interfaces placed in a VRF can only route to other interfaces in the same VRF. So one physical router can serve two customers, or keep a company's guest and staff networks fully apart, even if both use the same addresses such as 10.0.0.0/24. Using VRFs without MPLS is called VRF-lite.

output
ip vrf CUST-A
ip vrf CUST-B
!
interface GigabitEthernet0/1
 ip vrf forwarding CUST-A
 ip address 10.0.0.1 255.255.255.0
interface GigabitEthernet0/2
 ip vrf forwarding CUST-B
 ip address 10.0.0.1 255.255.255.0
!
show ip route vrf CUST-A
Cisco IOS: two customers use the same subnet on one router without clashing. Newer IOS versions also offer the vrf definition syntax.
Careful: Putting an interface into a VRF with ip vrf forwarding removes its IP address. Always enter the VRF command first and the IP address after it. Also remember that ping and show ip route look at the global table unless you add vrf NAME.

Cloud service and deployment models

ModelYou manageProvider managesExample
IaaS (infrastructure as a service)OS, apps, data, and your network designHardware, data centre, hypervisorVirtual machines and VPCs on AWS, Azure or Google Cloud
PaaS (platform as a service)Your app and dataServers, OS, runtimeA managed database or app hosting service
SaaS (software as a service)Only your data and usersEverything elseGmail, Microsoft 365, Zoho

Deployment models say who uses the cloud. A public cloud is shared by many customers. A private cloud is used by one organisation. A hybrid cloud connects the two, for example a bank keeping its core banking servers in its own data centre and its website in the public cloud. A community cloud is shared by organisations with common needs, such as government departments.

Cloud networking building blocks

In IaaS you design your own private network inside the provider's data centre. AWS and Google Cloud call it a VPC (virtual private cloud); Azure calls it a VNet (virtual network). It works like the networks you have built in this course.

  • VPC or VNet: your private address range, for example 10.0.0.0/16. On AWS an IPv4 VPC can be from /16 down to /28.
  • Subnets: smaller ranges inside the VPC, for example 10.0.1.0/24 for web servers and 10.0.2.0/24 for databases. On AWS each subnet lives in one availability zone (one data centre group), and AWS and Azure keep 5 addresses of every subnet for themselves.
  • Route table: the routing table for a subnet. A public subnet has a default route (0.0.0.0/0) to an internet gateway; a private subnet does not.
  • Internet gateway: lets resources with public IP addresses reach and be reached from the internet.
  • NAT gateway: lets servers in a private subnet start connections to the internet (for updates) while nobody on the internet can start a connection to them.
  • Security group: a stateful firewall attached to a VM or its network interface. It has allow rules only. Stateful means reply traffic is allowed back automatically.
  • Network ACL: a stateless filter on a whole subnet, with numbered allow and deny rules. Stateless means you must allow the reply traffic too, usually the high ephemeral ports.

Connecting the office to the cloud

There are three common ways. Over the internet, using HTTPS to public services, is simple but has no private path. A site-to-site IPsec VPN builds an encrypted tunnel over the internet between your office router or firewall and the cloud's VPN gateway; it is cheap and quick to set up. A private dedicated link, such as AWS Direct Connect or Azure ExpressRoute, is a circuit through a telecom partner that does not cross the public internet; it gives steadier speed and delay, at a higher cost.

Location matters too. AWS has the Mumbai (ap-south-1) and Hyderabad (ap-south-2) regions; Azure has Central India (Pune), South India (Chennai) and West India (Mumbai); Google Cloud has Mumbai and Delhi. Indian companies choose these for low delay to their users and for data rules, such as the RBI requirement to store payment system data in India.

Careful: Common cloud mistakes: (1) Making the VPC too small or overlapping with the office range. If the office uses 10.0.0.0/16 and the VPC also does, the VPN cannot route between them. Plan addresses before you build. (2) Opening a security group to 0.0.0.0/0 on SSH port 22. Allow only your office IP or use a bastion or session manager. (3) Forgetting the return traffic in a stateless network ACL.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

Virtualisation, VRFs and cloud networking · 1/8

Virtualisation and cloud networking

In this lesson you will see how networks work inside servers and inside the cloud.

Prefer a video by a teacher? Find free videos on “cloud networking VPC subnets internet gateway NAT gateway security group vs NACL” on YouTube ↗

In real life: An online pharmacy on AWS Mumbai

A startup in Hyderabad runs its online pharmacy in the AWS Mumbai region. Its VPC is 10.50.0.0/16, chosen so it never overlaps the office range 192.168.0.0/16. Public subnets in two availability zones hold the load balancers; private subnets hold the app servers and the database. App servers download updates through a NAT gateway, the database security group allows port 5432 only from the app servers' security group, and the office connects over a site-to-site VPN. When orders grow, they plan to add AWS Direct Connect for a steadier link.

output
VPC 10.50.0.0/16  (ap-south-1, Mumbai)
  public-a   10.50.1.0/24   route 0.0.0.0/0 -> internet gateway
  public-b   10.50.2.0/24   route 0.0.0.0/0 -> internet gateway
  app-a      10.50.11.0/24  route 0.0.0.0/0 -> NAT gateway
  app-b      10.50.12.0/24  route 0.0.0.0/0 -> NAT gateway
  db-a       10.50.21.0/24  no internet route
  db-b       10.50.22.0/24  no internet route
A simple two-zone plan: public, app and database tiers.

Practice (0/3 done)

Task 1 · Code · Python

AWS keeps 5 addresses in every subnet for itself (network, VPC router, DNS, one for future use, and the last address). Write usable_cloud_ips(cidr) that returns how many addresses are left for your servers, using the ipaddress module. Example: "10.0.1.0/24" gives 251.

Task 2 · Code · Python

Write plan_ok(vpc, subnets). vpc is a CIDR string like "10.50.0.0/16" and subnets is a list of CIDR strings. Return True only if every subnet is inside the VPC AND no two subnets overlap. Otherwise return False.

Task 3 · Practice

Design the network for a college admission portal in the Azure Central India region or the AWS Mumbai region. The office uses 192.168.0.0/16. You need public web servers, private app servers and a private database, in two zones. Write the VPC or VNet range, the subnets, the route for each subnet, and the firewall rules.

Quick quiz

Question 1

1.Which is a type 1 hypervisor?

Question 2

2.What does a VRF give a router?

Question 3

3.A private app server must download updates from the internet but must not accept connections from it. What does its subnet route to?

Question 4

4.Which statement about security groups and network ACLs is true?

Question 5

5.Gmail used by a company is an example of which service model?

Question 6

6.Which is a private, dedicated connection to the cloud that does not cross the public internet?

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

Which is a type 1 hypervisor?

Answer: VMware ESXi

ESXi runs directly on the server hardware, so it is type 1. VirtualBox and Workstation run on top of an operating system (type 2).

What does a VRF give a router?

Answer: A separate routing table, so networks can be kept apart

Each VRF has its own routing table; interfaces in different VRFs cannot route to each other by default.

A private app server must download updates from the internet but must not accept connections from it. What does its subnet route to?

Answer: A NAT gateway

A NAT gateway lets private servers start outbound connections while blocking inbound ones.

Which statement about security groups and network ACLs is true?

Answer: Security groups are stateful; network ACLs are stateless

Security groups remember connections, so replies are allowed automatically. Network ACLs are stateless, have allow and deny rules, and apply to a subnet.

Gmail used by a company is an example of which service model?

Answer: SaaS

With SaaS you only use the finished software; the provider runs everything else.

Which is a private, dedicated connection to the cloud that does not cross the public internet?

Answer: AWS Direct Connect

Direct Connect (and Azure ExpressRoute) are private circuits. A site-to-site VPN is encrypted but still runs over the internet.

An app server in a private subnet must download OS updates but must not accept connections from the internet. What does its route table need?Related

Answer: 0.0.0.0/0 to a NAT gateway

A NAT gateway allows outbound connections from private subnets while blocking inbound ones.

From VPC basics: CIDR, subnets and gateways

Which services can use a gateway VPC endpoint?Related

Answer: S3 and DynamoDB

Gateway endpoints exist only for S3 and DynamoDB. Other services use interface endpoints.

From VPC security and connectivity

What is the main drawback of a private cloud compared with public cloud?Related

Answer: Up-front hardware cost and the need for a skilled team

You buy and run the hardware yourself, so you pay up front and need staff.

From Public, private, hybrid and multi-cloud

VNet A is peered with B, and B is peered with C. Can A reach C through B by default?Related

Answer: No, peering is not transitive

Peering connects only the two VNets in the pair. Use a hub with a firewall or direct peering for A to C.

From Azure networking, Functions, databases and monitoring

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. This is the last topic of “Automation, SDN and cloud networking”. The module exam comes next.
  2. Module 11 exam: Automation, SDN and cloud networking · 13 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Troubleshooting and the CCNA exam. 57 topics left in the course before the final exam.

← Previous: Configuration management: Ansible, Puppet, Chef and NETCONF