Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

🌐 Azure Network Lab

███╗   ██╗███████╗████████╗██╗    ██╗ ██████╗ ██████╗ ██╗  ██╗
████╗  ██║██╔════╝╚══██╔══╝██║    ██║██╔═══██╗██╔══██╗██║ ██╔╝
██╔██╗ ██║█████╗     ██║   ██║ █╗ ██║██║   ██║██████╔╝█████╔╝ 
██║╚██╗██║██╔══╝     ██║   ██║███╗██║██║   ██║██╔══██╗██╔═██╗ 
██║ ╚████║███████╗   ██║   ╚███╔███╔╝╚██████╔╝██║  ██║██║  ██╗
╚═╝  ╚═══╝╚══════╝   ╚═╝    ╚══╝╚══╝  ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝

                    __    ___    ____
                   / /   /   |  / __ )
                  / /   / /| | / __  |
                 / /___/ ___ |/ /_/ /
                /_____/_/  |_/_____/
          A Z U R E   N E T W O R K   L A B

            ☁️ AZURE NETWORK LAB ☁️
         ╔══════════════════════════════════╗
         ║          [ VIRTUAL WAN ]         ║
         ║     🔥 Firewall    🌐 VPN        ║
         ╚════╦══════════════════╦══════════╝
              ║                  ║
        ╔═════╩════╗       ╔═════╩════╗
        ║  SPOKE1  ║       ║  SPOKE2  ║
        ║Route Srv ║       ║  vHub    ║
        ╚══════════╝       ╚══════════╝

Terraform Azure License

Azure Network Lab banner

Core networking components overview

Learn Azure networking the right way—by building it. This Terraform project deploys a complete vWAN-centric networking environment you can explore, break, and rebuild. Covers Virtual WAN, Secured Hub, VPN connectivity, Route Server, and spoke networks following Microsoft best practices.

💡 Hands-on Learning: Deploy real enterprise network infrastructure in minutes. Perfect for AZ-700 certification prep, team training, or validating network architectures before production.

🧭 Master Control Panel (feature toggles)

The lab is driven by the deploy object in terraform.tfvars. Flip the flags to change the footprint, then run terraform plan and terraform apply.

Note: When deploy.route_server = true, Spoke1 is not connected to vHub (Azure limitation).


📋 Table of Contents


🎯 Overview

This lab deploys a Virtual WAN-centric architecture with:

ComponentPurpose
Virtual WAN + HubGlobal transit connectivity
Secured Hub (Azure Firewall)Centralized security inspection
vHub VPN GatewayBranch connectivity
Spoke VNetsWorkload isolation
Route ServerBGP route injection
Simulated On-PremisesVPN testing

📚 Documentation

Documentation map

The full wiki lives in wiki/ and mirrors the style of the Azure Landing Zone lab.

  • Start here: wiki/README.md
  • Deep dive guide: wiki/book.md
  • Architecture: wiki/architecture/overview.md
  • Scenarios: wiki/scenarios/README.md
  • Testing: wiki/testing/lab-testing-guide.md

🏛️ Architecture Diagram

Virtual WAN architecture overview

┌─────────────────────────────────────────────────────────────────────────────┐
│                              VIRTUAL WAN                                     │
│  ┌─────────────────────────────────────────────────────────────────────────┐│
│  │                          VIRTUAL HUB (10.10.0.0/23)                     ││
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐                      ││
│  │  │   Azure     │  │  vHub VPN   │  │   Route     │                      ││
│  │  │  Firewall   │  │   Gateway   │  │   Tables    │                      ││
│  │  │  (Secured)  │  │   (BGP)     │  │             │                      ││
│  │  └──────┬──────┘  └──────┬──────┘  └─────────────┘                      ││
│  │         │                │                                               ││
│  └─────────┼────────────────┼───────────────────────────────────────────────┘│
│            │                │                                                │
└────────────┼────────────────┼────────────────────────────────────────────────┘
             │                │
    ┌────────┴────────┐       │         ┌─────────────────────────┐
    │                 │       │         │                         │
    ▼                 ▼       ▼         ▼                         │
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐       │
│   SPOKE 1       │ │   SPOKE 2       │ │   ON-PREM       │       │
│  10.1.0.0/16    │ │  10.2.0.0/16    │ │ 192.168.0.0/16  │       │
│                 │ │                 │ │                 │       │
│ ┌─────────────┐ │ │ ┌─────────────┐ │ │ ┌─────────────┐ │       │
│ │Route Server │ │ │ │ Workload VM │ │ │ │ VPN Gateway │◄┼───────┘
│ │   (BGP)     │ │ │ └─────────────┘ │ │ │   (BGP)     │ │  S2S VPN
│ └──────┬──────┘ │ │                 │ │ └─────────────┘ │
│        │        │ │  vHub Connected │ │                 │
│ ┌──────▼──────┐ │ │                 │ │ ┌─────────────┐ │
│ │  NVA (RRAS) │ │ │                 │ │ │ NVA (RRAS)  │ │
│ │  ASN 65501  │ │ │                 │ │ └─────────────┘ │
│ └─────────────┘ │ │                 │ │                 │
│                 │ │                 │ │ ┌─────────────┐ │
│ ┌─────────────┐ │ │                 │ │ │ Workload VM │ │
│ │Workload VMs │ │ │                 │ │ └─────────────┘ │
│ │ (LB Pool)   │ │ │                 │ │                 │
│ └─────────────┘ │ │                 │ │                 │
└─────────────────┘ └─────────────────┘ └─────────────────┘
   Route Server        vHub Connected     VPN S2S to vHub
   (No vHub Conn)

📦 What Gets Deployed

Core Infrastructure

ResourceNamePurpose
Resource Grouprg-az700-labContainer for all resources
Virtual WANvwan-az700-labGlobal WAN fabric
Virtual Hubvhub-az700-labRegional hub (10.10.0.0/23)
Azure Firewallfw-vhub-az700-labSecured Hub with firewall
vHub VPN Gatewayvpngw-vhub-az700-labBranch VPN termination

Virtual Networks

VNetAddress SpacePurpose
Spoke110.1.0.0/16Route Server + NVA testing
Spoke210.2.0.0/16Standard vHub connectivity
OnPrem192.168.0.0/16Simulated on-premises

Virtual Machines

VMLocationPurpose
vm-spoke1-1Spoke1Workload (LB backend)
vm-spoke1-2Spoke1Workload (LB backend)
vm-spoke1-nvaSpoke1RRAS NVA for Route Server BGP
vm-spoke2-1Spoke2Workload
vm-onprem-1OnPremSimulated on-prem workload
vm-onprem-nvaOnPremRRAS NVA

Optional Components

ComponentVariableDefault
Azure Bastiondeploy.bastionfalse
Application Gateway (WAF)deploy.application_gatewayfalse
DNS Private Resolverdeploy.dns_resolvertrue
NAT Gatewaydeploy.nat_gatewaytrue
Route Serverdeploy.route_servertrue

🌐 Network Topology

Network topology summary

Address Space Allocation

NetworkCIDRPurpose
Virtual Hub10.10.0.0/23vWAN Hub
Spoke 110.1.0.0/16Route Server testing
├─ Workload10.1.1.0/24VMs
├─ NvaSubnet10.1.8.0/24NVA (10.1.8.10)
├─ RouteServerSubnet10.1.7.0/27Route Server
└─ Other subnets10.1.x.0/24LB, AppGw, PE, DNS, Bastion
Spoke 210.2.0.0/16vHub connected
└─ Workload10.2.1.0/24VMs
On-Premises192.168.0.0/16Simulated on-prem
├─ Default192.168.1.0/24VMs
├─ NvaSubnet192.168.2.0/24NVA (192.168.2.10)
└─ GatewaySubnet192.168.0.0/27VPN Gateway

🚀 Quick Start

Prerequisites

  • Azure subscription with Owner or Contributor rights
  • Terraform 1.9 or later
  • Azure CLI signed in (az login)

Deploy

# Clone the repository
git clone https://github.com/Jamonygr/azure-network-lab.git
cd azure-network-lab

# Copy and edit variables
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your values

# Initialize and deploy
terraform init
terraform plan -out=tfplan
terraform apply tfplan

Destroy

terraform destroy -auto-approve

🎛️ Feature Toggles

Control what gets deployed to optimize costs:

# terraform.tfvars

# Feature Toggles
deploy = {
  vwan          = true   # Virtual WAN
  vhub_firewall = true   # Azure Firewall in vHub (~$912/mo)
  vpn           = false  # VPN Gateways (vHub + OnPrem)
  route_server  = true   # Azure Route Server (~$360/mo)

  dns_resolver      = true   # DNS Private Resolver (~$180/mo)
  private_dns_zones = true   # Private DNS Zones
  bastion           = false  # Azure Bastion (~$140/mo)

  application_gateway = false # WAF v2 (~$250/mo)
  load_balancer       = true  # Internal Load Balancer
  nat_gateway         = true  # NAT Gateway (~$45/mo)

  private_endpoint = true   # Storage Account + Private Endpoint

  spoke1_vms = true   # VMs in Spoke1 VNet
  spoke2_vms = true   # VMs in Spoke2 VNet
  onprem_vms = false  # VMs in OnPrem VNet
  nvas       = true   # Network Virtual Appliances (RRAS/BGP)
}

Note: When deploy.route_server = true, Spoke1 does NOT connect to vHub (Azure limitation: VNet cannot have both Route Server and vHub remote gateway).


⚙️ Configuration Options

Essential Variables

# terraform.tfvars

# Required
subscription_id = "your-subscription-id"
admin_username  = "azureadmin"
admin_password  = "YourSecureP@ssw0rd!"
vpn_shared_key  = "YourVPNSharedKey123!"

# Optional
ctx = {
  project  = "az700-lab"
  location = "eastus2"
  tags = {
    Environment = "lab"
    Project     = "az700"
  }
}
vm_size = "Standard_B2s"

Network Configuration

# Address Spaces
vhub_address_prefix  = "10.10.0.0/23"
spoke1_address_space = ["10.1.0.0/16"]
spoke2_address_space = ["10.2.0.0/16"]
onprem_address_space = ["192.168.0.0/16"]

💰 Cost Estimation

Monthly Cost by Component

ComponentEstimated CostNotes
Azure Firewall (Standard)~$350/moAlways on
vHub VPN Gateway~$140/moScale unit 1
OnPrem VPN Gateway (VpnGw1)~$140/moFor S2S VPN
Route Server~$360/moOptional
Application Gateway (WAF_v2)~$250/moOptional
DNS Private Resolver~$180/moOptional
NAT Gateway~$45/moOptional
Azure Bastion (Basic)~$140/moOptional
VMs (6x Standard_B2s)~$150/moWindows Server Core
Storage, IPs, etc.~$50/moMiscellaneous

Cost Profiles

ProfileComponentsEst. Monthly
MinimalvWAN + Firewall + VPN + VMs~$800
Standard+ Route Server + NAT + DNS~$1,400
Full+ AppGw + Bastion~$1,800

📁 Project Structure

azure-network-lab/
├── README.md                  # This documentation
├── LICENSE                    # MIT License
├── main.tf                    # Root orchestration (lab only)
├── variables.tf               # Input variables
├── outputs.tf                 # Output values
├── locals.tf                  # Computed locals
├── moved.tf                  # State move declarations
├── providers.tf               # Provider configuration
├── terraform.tfvars           # Your configuration (gitignored)
├── terraform.tfvars.example   # Example configuration
├── wiki/                      # Documentation wiki
│
└── modules/                   # Reusable modules
    ├── application-gateway/
    ├── bastion/
    ├── dns-private-resolver/
    ├── load-balancer/
    ├── local-network-gateway/
    ├── log-analytics/
    ├── nat-gateway/
    ├── nsg/
    ├── private-dns-zone/
    ├── private-endpoint/
    ├── resource-group/
    ├── route-server/
    ├── storage-account/
    ├── tags/
    ├── vhub/
    ├── vhub-connection/
    ├── vhub-firewall/
    ├── vhub-vpn-gateway/
    ├── vm-windows/
    ├── vm-windows-nva/
    ├── vnet/
    ├── vnet-peering/
    ├── vpn-connection/
    ├── vpn-gateway/
    ├── vpn-site/
    └── vwan/

Deployment Phases

PhaseComponents
1. FoundationResource Group, Log Analytics
2. vWAN CorevWAN, vHub, Firewall, VPN Gateway
3. Virtual NetworksSpoke1, Spoke2, OnPrem VNets
4. NSGsNetwork Security Groups
5. vHub ConnectionsSpoke connections to hub
6. VPN InfrastructureOnPrem VPN, Site, Connection
7. Route ServerOptional Route Server
8. DNSPrivate DNS Zones, Resolver
9. Compute SupportLB, App GW, NAT GW, Bastion
10. Private EndpointsStorage, PE
11. VMsWorkload VMs
12. NVAsRRAS Network Virtual Appliances

🧪 Lab Scenarios

This environment supports the following AZ-700 exam topics:

ScenarioComponents Used
Virtual WAN ConfigurationvWAN, vHub, Hub Connections
Secured Virtual HubAzure Firewall in vHub
VPN Site-to-SitevHub VPN GW, OnPrem VPN GW, VPN Site
BGP RoutingVPN with BGP, Route Server
Route Server + NVARoute Server, RRAS NVA, BGP Peering
Private DNSPrivate DNS Zones, VNet Links
Private EndpointsStorage PE, Private DNS Integration
Load BalancingInternal Load Balancer
Application GatewayWAF v2
DNS ResolutionDNS Private Resolver

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments


Built with ❤️ for learning Azure networking

Last Updated: December 2024

关于 About

Learn Azure networking with this hands-on Terraform lab. Deploys a complete vWAN environment with Secured Hub, VPN, Route Server, and spoke networks. Great for AZ-700 certification prep and networking PoCs.

语言 Languages

HCL100.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
14
Total Commits
峰值: 12次/周
Less
More

核心贡献者 Contributors