Modern networks: cloud and automation
Lesson 4 of 6
4Modern networks: cloud and automation
The big pictureTen years ago, setting up a network for a new branch meant weeks of cabling and typing commands device by device. Today a full VPC with its subnets and firewalls is built in minutes from a text file, and a hundred switches are reconfigured by one script. The basics you learned have not changed, but the way they are applied has changed completely.
What the picture shows: In a modern network a change is written as code, reviewed, then pushed to the devices by a controller or an automation tool, and the result is watched.
Map of this part
The concepts in order, click any one to jump to it:
Two ways into the same idea
The cloud means renting a virtual network inside a huge data centre run by a company like AWS or Azure. You never see a cable, but you draw subnets and firewalls with clicks or a file. SDN means the "brain" that makes decisions moved out of each device to one place, so you change the whole network from one screen. And automation means writing the instructions once in a file and letting a tool apply them to a hundred devices with no copy-paste mistakes.
In AWS, for example: a VPC with a CIDR block, subnets in availability zones (AZs), route tables, an Internet Gateway for public subnets, a NAT Gateway for private ones to get out, stateful Security Groups per instance and stateless Network ACLs per subnet. SDN separates the control plane from the data plane: a northbound REST API for applications, and a southbound NETCONF/YANG, gNMI or OpenFlow interface to devices; examples are Cisco Catalyst Center and SD-WAN. Automation: Python with Netmiko or NAPALM, Jinja2 templates, agentless Ansible, Terraform for infrastructure as code, and JSON and YAML data. Monitoring: SNMP for counters, Syslog with severities 0 to 7, and NetFlow/IPFIX for who talked to whom. CCNA v2.0 adds AI in operations.
Before You Start
🧮Subnets
The cloud is split with CIDR.
🛡️Security
Security groups are stateful firewalls.
The Core Idea
1The network in the cloud: a VPC
A VPC is your own private network inside the cloud. You split it into a public subnet holding what the internet must see (the load balancer), and a private subnet holding the app and the database. The internet comes into the public one only; the private one goes out through NAT for its updates, and nobody comes in.
AWS reserves 5 addresses per subnet, not 2, so subtract 5.
import ipaddress
vpc = ipaddress.ip_network("10.0.0.0/16")
zones = ["a", "b"]
tiers = ["public", "app", "db"]
subnets = vpc.subnets(new_prefix=24) # 256 slices of /24
plan = {f"{tier}-{zone}": next(subnets) for tier in tiers for zone in zones}
for name, net in plan.items():
print(f"{name:<9} {net} ({net.num_addresses - 5} usable in AWS)")| Classic idea | In the cloud |
|---|---|
| Subnet | Subnet (AZ) |
| Routing table | Route table |
| Home router to the internet | Internet Gateway |
| PAT for private hosts | NAT Gateway |
| Stateful firewall per host | Security Group |
| Stateless ACL | Network ACL |
| Site-to-site VPN | VPN Gateway · Direct Connect |
2Software-defined networking (SDN)
In a classic network each device thinks on its own: it works out its routes and keeps its settings. In SDN the devices keep the fast forwarding (the data plane), and the thinking (the control plane) moves to a central controller. You write the policy once in the controller and it translates it for every device.
3Automation: the network as code
Instead of typing the same commands on twenty switches, you put the data in a file (which VLAN goes on which port), keep one template for the commands, and generate all the configs. The file lives in Git and is reviewed like any code, so you know who changed what and when.
Add a switch to the JSON and run: its config is ready without typing a single command line.
import json
inventory = json.loads("""
{
"vlans": {"10": "STAFF", "20": "GUEST", "30": "CAMERAS"},
"switches": {
"SW1": {"gi0/1": 10, "gi0/2": 20},
"SW2": {"gi0/1": 30, "gi0/2": 10}
}
}
""")
def config_for(name, ports):
lines = [f"hostname {name}"]
for vid, vname in inventory["vlans"].items():
lines += [f"vlan {vid}", f" name {vname}"]
for port, vid in ports.items():
lines += [f"interface {port}", " switchport mode access", f" switchport access vlan {vid}"]
return "\n".join(lines)
for name, ports in inventory["switches"].items():
print(f"--- {name} ---")
print(config_for(name, ports))| Tool | What it does |
|---|---|
| Python · Netmiko · NAPALM | Connect to devices over SSH or an API, run commands, read state |
| Ansible | YAML files describing the wanted state, with no agent on devices |
| Terraform | Builds cloud networks from files and tracks the difference |
| NETCONF · RESTCONF · gNMI | Structured interfaces with YANG models instead of scraping command text |
4Monitoring: know before anyone calls
A good network is watched all the time: SNMP reads counters (load, errors, temperature), Syslog gathers device messages in one place, and NetFlow records who talked to whom and how much. IPv6 now runs side by side with IPv4 (dual stack) and carries most of the traffic on many large networks, so watch both.
The number after the source name is the severity: the smaller it is, the worse.
import re
SEVERITY = ["emergency", "alert", "critical", "error", "warning", "notice", "info", "debug"]
logs = [
"%LINK-3-UPDOWN: Interface Gi0/1, changed state to down",
"%SYS-5-CONFIG_I: Configured from console by admin",
"%OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Gi0/0 from FULL to DOWN",
"%SYS-2-MALLOCFAIL: Memory allocation failed",
]
for line in logs:
facility, level, text = re.match(r"%(\w+)-(\d)-\w+: (.*)", line).groups()
level = int(level)
flag = "PAGE ON-CALL" if level <= 3 else "log only"
print(f"{level} {SEVERITY[level]:<9} {facility:<5} {flag:<12} {text}")show version from every device) before any script that changes things. Reading never takes a network down.Worked example
The task: your app in a private cloud subnet cannot download updates from the internet, though the site works from outside. The answer: traffic comes in through the load balancer in the public subnet, but the private subnet needs a NAT Gateway to get out. Check the private subnet's route table: it must have 0.0.0.0/0 → nat-gateway. If the route is there, check the outbound rules in the Security Group and the Network ACL, and remember a Network ACL is stateless, so the reply needs a rule too.
Myth vs Reality
| Myth | Reality |
|---|---|
| In the cloud you do not need networking. | Most cloud faults are subnets, routing and firewalls; the same ideas under new names. |
| Automation will end the network engineer's job. | It ends repetitive typing, and raises the value of people who understand networks and write code. |
| SDN means hardware no longer matters. | Devices still forward every packet; only the place decisions are made has moved. |
Where you meet it at work
☁️Cloud engineer
Designs VPCs, subnets and firewalls and writes them in Terraform.
🤖Network automation engineer
Python and Ansible to run hundreds of devices.
📊Network operations (NOC)
SNMP, Syslog and NetFlow dashboards around the clock.
Test your understanding
Where do the load balancer and the database go in a VPC?
Only what the internet must see goes public; data stays protected in private.
What moves to the controller in SDN?
The decisions are central; forwarding stays on the devices.
A Syslog message has severity 2. How serious is it?
0 emergency, 1 alert, 2 critical, 3 error, 4 warning, 5 notice, 6 info, 7 debug.
Which tool builds cloud networks from files and tracks the difference?
Infrastructure as code: you write the wanted state and the tool applies it.
In AWS, which component lets a private subnet reach the internet without accepting inbound connections?
An Internet Gateway is for public subnets; a NAT Gateway lets private ones out.
What is the core idea of SDN?
A central controller decides and the devices carry out.
Quick review cards
Check Your Understanding
Why does a Network ACL need a rule for replies and a security group does not?
The ACL is stateless and forgets the connection; the security group is stateful and lets replies back.
What is the point of keeping network config in Git?
A full history of every change, review before applying, and an easy rollback.
What does NetFlow answer that SNMP does not?
Who talked to whom, on which port and how much, not just total load.
Resources for this lesson
Grouped by type. Start with the official docs for precision, or an article or video for the explanation.
Official docs2
Articles2
Done with this lesson?
Sign in to save your progress.