Subnet Design and Network Segmentation

Watch the video to deepen your understanding.
SubscribeComplete the full lesson to earn 25 points — 50 with Pro
Work through each section, then tap “Mark as Complete” on the last one.
✦ Skip the page breaks, the wait, and see fewer ads — read each lesson on a single page with Pro
Lesson: Subnet Design and Network Segmentation
Introduction
In modern cloud and on-premises infrastructure, a "flat" network—where every device can communicate with every other device—is a significant security and performance liability. Subnetting is the process of dividing a large network into smaller, distinct sub-networks (subnets). Network Segmentation is the architectural practice of isolating these subnets to control traffic flow.
By designing effective subnets, you achieve three primary goals:
- Security: Restricting lateral movement for attackers.
- Performance: Reducing broadcast traffic and congestion.
- Manageability: Organizing resources based on function, environment, or sensitivity.
The Mechanics of Subnetting
Subnetting relies on the Subnet Mask (or CIDR notation), which tells a device which part of an IP address represents the network and which part represents the individual host.
Practical Example: Designing a Three-Tier Architecture
Imagine you are deploying a web application. A secure design requires three distinct segments:
- Public Tier (DMZ): Contains Load Balancers and Web Servers.
- Application Tier: Contains the business logic servers.
- Data Tier: Contains databases.
If we have the network range 10.0.0.0/16, we can divide it as follows:
| Tier | Subnet Range | CIDR | Purpose |
|---|---|---|---|
| Public | 10.0.1.0/24 | /24 | Internet-facing assets |
| App | 10.0.2.0/24 | /24 | Internal logic |
| Data | 10.0.3.0/24 | /24 | Sensitive storage |
Code Snippet: Defining Subnets (Terraform)
When deploying infrastructure as code (IaC), you define these boundaries explicitly. Below is a snippet using Terraform for an AWS VPC:
resource "aws_subnet" "public_subnet" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.1.0/24"
tags = { Name = "Public-Tier" }
}
resource "aws_subnet" "data_subnet" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.3.0/24"
tags = { Name = "Data-Tier" }
}
Network Segmentation Strategies
Segmentation is not just about IP ranges; it is about the policies enforced between them.
1. Security Groups (Stateful Firewalls)
Security groups act as virtual firewalls at the instance level. They allow you to define "Allow" rules.
- Best Practice: The Database subnet should only accept traffic on port 5432 (PostgreSQL) from the Application subnet's IP range. It should deny all traffic from the Public subnet.
2. Network Access Control Lists (NACLs)
NACLs act at the subnet level and are stateless. They are often used as a "second line of defense" to block specific malicious IP ranges or to provide a coarse-grained filter for all traffic entering or leaving a subnet.
3. Micro-segmentation
In advanced environments, you may implement micro-segmentation, where security policies are applied to individual workloads or containers regardless of their physical location or subnet. This is common in Kubernetes environments using Network Policies.
💡 Pro-Tip: The Principle of Least Privilege
Always design your network segments so that resources only communicate with the specific services they require to function. If a web server doesn't need to talk to the database directly (because it talks to the app server instead), the network policy should explicitly block that connection.
Best Practices
- Plan for Growth: Do not create subnets that are too small. If you anticipate needing 200 hosts, use a
/24(256 addresses) rather than a/25(128 addresses) to allow for future expansion. - Use Non-Overlapping Ranges: If you plan to connect your VPC/Network to a corporate office or another cloud environment, ensure your IP ranges do not overlap. This is the #1 cause of routing failures.
- Separate Environments: Always keep Production, Staging, and Development in separate VPCs or at least separate, strictly firewalled subnets. Never allow a Dev server to initiate a connection to a Production database.
- Automate Policy: Use Infrastructure as Code (IaC) to define your segmentation. Manual changes in a web console lead to "configuration drift," where security rules become inconsistent over time.
Common Pitfalls
- The "One Subnet for Everything" Trap: Avoid putting all your assets in a single subnet just because it is easier to configure. This makes security auditing and traffic monitoring nearly impossible.
- Over-reliance on IP Filtering: Remember that IP addresses are dynamic. Use tags or security group referencing (e.g., "Allow traffic from Security Group A") rather than hardcoding IP addresses in your rules.
- Ignoring Egress Traffic: Most engineers focus on ingress (what comes in). Don't forget to restrict egress (what goes out). Databases should generally not be able to initiate outbound connections to the public internet.
Key Takeaways
- Subnetting is the logical division of your network IP space to organize resources and improve performance.
- Segmentation uses firewalls, NACLs, and routing policies to control traffic flow between those subnets.
- Tiered Architecture (Public/App/Data) is the industry standard for securing applications.
- Security is iterative: Always apply the Principle of Least Privilege. If a service doesn't need a connection, block it by default.
- Automation is essential: Use IaC to ensure network configurations are version-controlled, repeatable, and auditable.
By mastering subnet design, you transition from simply "connecting computers" to building a resilient, defensible infrastructure capable of scaling with your organization's needs.
Reach the last section to complete this lesson and earn points — you're on section 1 of 3.
- Introduction to Azure Monitor
- Azure Monitor Architecture and Data Sources
- Configuring Log Analytics Workspaces
- Designing Log Routing Solutions
- Configuring Diagnostic Settings
- Application Insights for Solution Architects
- Network Watcher and Network Monitoring
- Azure Monitor Alerts and Action Groups
- Workbooks and Custom Dashboards
- Designing a Comprehensive Monitoring Strategy
- Logging and Monitoring Quiz5q
- Microsoft Entra ID for Solution Architects
- Designing Identity Solutions: B2B Collaboration
- Designing Identity Solutions: B2C Scenarios
- Conditional Access Policy Design
- Designing for Multi-Factor Authentication
- Managed Identities for Azure Resources
- Service Principals and App Registrations
- Role-Based Access Control Design
- Privileged Identity Management
- Microsoft Entra ID Protection
- Zero Trust Architecture with Microsoft Entra
- Authentication and Authorization Quiz5q
- Introduction to Azure Governance
- Designing Management Group Hierarchies
- Subscription Strategy Design
- Resource Group Organization Patterns
- Azure Policy Design and Assignment
- Custom Policy Definitions and Initiatives
- Resource Locks and Tagging Strategies
- Azure Blueprints and Landing Zones
- Cost Management and Budget Design
- Cloud Adoption Framework for Governance
- Governance Solutions Quiz5q
- Introduction to Azure Storage
- Storage Account Types and Replication
- Blob Storage Tiers and Lifecycle Management
- Azure Files and Azure NetApp Files
- Azure Managed Disks Design
- Azure Data Lake Storage Gen2
- Cosmos DB Consistency Models
- Cosmos DB Partitioning and Throughput Design
- Cosmos DB API Selection Guide
- Table Storage and Queue Storage Design
- Storage Security and Encryption
- Non-Relational Storage Quiz5q
- Azure SQL Database Service Tiers
- Azure SQL Managed Instance Design
- Azure Database for MySQL and PostgreSQL
- Database Scaling: Vertical and Horizontal
- Read Replicas and Geo-Replication
- Database Security and Auditing Design
- Transparent Data Encryption and Always Encrypted
- Caching with Azure Cache for Redis
- Azure SQL Elastic Pools Design
- Relational Storage Quiz5q
- Azure Data Factory Design Patterns
- Data Integration Pipeline Architecture
- Azure Synapse Analytics Design
- Azure Databricks Integration Patterns
- Azure Stream Analytics for Real-Time Data
- Azure Event Hubs for Data Ingestion
- Data Migration Strategies and Tools
- Azure Purview for Data Governance
- Data Integration Quiz5q
- Introduction to High Availability in Azure
- Availability Zones and Availability Sets
- Azure Load Balancer Design
- Application Gateway and WAF Design
- Azure Front Door and Global Load Balancing
- Azure Traffic Manager Routing Methods
- Multi-Region Architecture Design
- SLA Design and Composite SLAs
- Health Probes and Failover Configuration
- Azure Service Fabric for Stateful HA
- High Availability Quiz5q
- Azure Backup Architecture and Vaults
- Backup Policies for VMs and Databases
- Azure Site Recovery Design
- RTO and RPO Planning Strategies
- Geo-Redundant and Cross-Region Recovery
- Hybrid and On-Premises Backup Solutions
- Resiliency Patterns and Chaos Engineering
- Disaster Recovery Testing and Drills
- Azure Immutable Backup and Soft Delete
- Backup and Disaster Recovery Quiz5q
- Introduction to Azure Compute Options
- Virtual Machine Design and Sizing
- VM Scale Sets and Autoscaling Strategies
- Azure Batch for Large-Scale Workloads
- Azure App Service Plans and Design
- App Service Environments and Isolation
- Azure Container Instances
- Azure Kubernetes Service Architecture
- AKS Networking and Storage Design
- Azure Functions and Serverless Design
- Durable Functions and Orchestration
- Compute Decision Framework
- Azure Virtual Desktop Design
- Compute Solutions Quiz5q
- Microservices Architecture Patterns
- Azure API Management Design
- Azure Service Bus Messaging Design
- Azure Event Grid and Event-Driven Architecture
- Azure Event Hubs for Streaming
- Azure Logic Apps and Integration Workflows
- Azure SignalR and Web PubSub
- Caching Strategies and Azure CDN
- App Configuration and Feature Flags
- Designing for Scalability and Performance
- Azure Container Apps Design
- Application Architecture Quiz5q
- Virtual Network Design and Address Planning
- Subnet Design and Network Segmentation
- Hub-Spoke Network Topology
- Azure Virtual WAN Design
- VPN Gateway Design and Configuration
- ExpressRoute Circuit Design
- Network Security Groups Design
- Azure Firewall and Firewall Manager
- Azure DDoS Protection Design
- Private Endpoints and Private Link
- Azure DNS and DNS Architecture
- Network Performance and Traffic Routing
- Azure Bastion and Secure Access
- Network Solutions Quiz5q
- Azure Migrate Overview and Assessment
- Migration Assessment and Discovery
- Azure Cloud Adoption Framework for Migration
- VM Migration with Azure Migrate
- Database Migration with Azure DMS
- Application Migration to App Service
- Containerizing Applications for Migration
- Migration Cost Planning and Optimization
- Data Box and Offline Migration Methods
- Migrations Quiz5q
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles the points you earn on every lesson and quiz so you progress twice as fast, unlocks half of every practice exam — plus full case studies — with the Learn & Exam study modes, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× points per lesson & quiz
- ✓ 50% of every exam unlocked
- ✓ Learn & Exam modes
- ✓ Distraction-free lessons