CG
SkillsImplementing Network Segmentation with Firewall Zones
Start Free
Back to Skills Library
Network Security🟡 Intermediate

Implementing Network Segmentation with Firewall Zones

Design and implement network segmentation using firewall security zones, VLANs, ACLs, and microsegmentation policies to restrict lateral movement and enforce least-privilege network access.

7 min read5 code examples

Prerequisites

  • Network topology documentation with asset inventory
  • Firewall supporting zone-based policies (Palo Alto, Fortinet, Cisco Firepower)
  • Managed switches with VLAN support (802.1Q trunking)
  • Traffic flow documentation or NetFlow data for baseline analysis
  • Compliance requirements (PCI DSS scope, HIPAA ePHI boundaries)

Implementing Network Segmentation with Firewall Zones

Overview

Network segmentation divides a flat network into isolated security zones with firewall-enforced boundaries to contain breaches, restrict lateral movement, and enforce least-privilege access between workloads. Segmentation is a foundational control required by PCI DSS, HIPAA, NIST 800-53, and zero trust architectures. Modern segmentation combines traditional VLAN-based approaches with microsegmentation at the workload level for granular east-west traffic control. This guide covers designing zone architectures, configuring inter-zone firewall policies, implementing VLAN segmentation on switches, and deploying microsegmentation for dynamic environments.

Prerequisites

  • Network topology documentation with asset inventory
  • Firewall supporting zone-based policies (Palo Alto, Fortinet, Cisco Firepower)
  • Managed switches with VLAN support (802.1Q trunking)
  • Traffic flow documentation or NetFlow data for baseline analysis
  • Compliance requirements (PCI DSS scope, HIPAA ePHI boundaries)

Core Concepts

Zone Architecture Tiers

ZoneTrust LevelExamplesAccess Policy
InternetNonePublic internetDefault deny inbound
DMZLowWeb servers, mail relays, DNSLimited inbound, restricted outbound
GuestLowGuest WiFi, visitor networkInternet only, no internal access
CorporateMediumEmployee workstations, printersControlled access to internal resources
Server/Data CenterHighApplication servers, databasesStrict ACLs, limited admin access
PCI CDECriticalPayment systems, card dataPCI DSS compliant isolation
ManagementCriticalNetwork devices, hypervisors, IPMIHighly restricted, jump box only
OT/SCADACriticalIndustrial control systemsAir-gapped or strictly firewalled

Segmentation Approaches

ApproachScopeGranularityUse Case
VLAN SegmentationLayer 2Subnet-levelDepartment separation, guest isolation
Firewall ZonesLayer 3-7Zone-to-zoneInter-zone policy enforcement
ACLs on RoutersLayer 3-4Subnet/portQuick filtering at routing boundaries
MicrosegmentationLayer 3-7Workload-levelZero trust, container environments
SGT/TrustSecLayer 2-7Tag-basedIdentity-based segmentation

Implementation Steps

Step 1: Map Traffic Flows and Define Zones

Before implementing segmentation, capture baseline traffic:

# Capture NetFlow data to understand existing traffic patterns
nfdump -R /var/cache/nfdump/ -s srcip/bytes -n 50

# Identify east-west traffic between subnets
nfdump -R /var/cache/nfdump/ -s record/bytes \
  'src net 10.0.0.0/8 and dst net 10.0.0.0/8' -n 100

# Map application dependencies
# Document which servers need to communicate with which other servers

Step 2: Configure VLANs on Switches

! Core switch VLAN configuration
vlan 10
 name Management
vlan 20
 name Corporate-Users
vlan 30
 name Servers
vlan 40
 name PCI-CDE
vlan 50
 name Guest
vlan 60
 name DMZ
vlan 99
 name Native-Unused

! Trunk port to firewall
interface GigabitEthernet1/0/1
 description Trunk-to-Firewall
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport trunk allowed vlan 10,20,30,40,50,60
 switchport trunk native vlan 99
 switchport nonegotiate

! Access port for corporate users
interface range GigabitEthernet1/0/2-24
 switchport mode access
 switchport access vlan 20
 spanning-tree portfast

! Access port for servers
interface range GigabitEthernet1/0/25-36
 switchport mode access
 switchport access vlan 30

! Prevent VLAN hopping
interface range GigabitEthernet1/0/37-48
 switchport mode access
 switchport access vlan 99
 shutdown

Step 3: Configure Firewall Zone Policies

Palo Alto zone-based policy:

# Define zones on firewall sub-interfaces
set network interface ethernet ethernet1/1 layer3 units ethernet1/1.10 tag 10 ip 10.0.10.1/24
set network interface ethernet ethernet1/1 layer3 units ethernet1/1.20 tag 20 ip 10.0.20.1/24
set network interface ethernet ethernet1/1 layer3 units ethernet1/1.30 tag 30 ip 10.0.30.1/24
set network interface ethernet ethernet1/1 layer3 units ethernet1/1.40 tag 40 ip 10.0.40.1/24

set zone Management network layer3 ethernet1/1.10
set zone Corporate network layer3 ethernet1/1.20
set zone Servers network layer3 ethernet1/1.30
set zone PCI-CDE network layer3 ethernet1/1.40

# Inter-zone policies (deny by default, explicitly allow)

# Corporate -> Servers (only specific apps)
set rulebase security rules Corp-to-Servers from Corporate to Servers
set rulebase security rules Corp-to-Servers application [ web-browsing ssl dns smtp ]
set rulebase security rules Corp-to-Servers action allow
set rulebase security rules Corp-to-Servers profile-setting group Standard-Profiles

# Corporate -> PCI (DENY)
set rulebase security rules Corp-to-PCI from Corporate to PCI-CDE
set rulebase security rules Corp-to-PCI action deny log-end yes

# Servers -> PCI (only payment processing)
set rulebase security rules Servers-to-PCI from Servers to PCI-CDE
set rulebase security rules Servers-to-PCI source [ 10.0.30.10 ]
set rulebase security rules Servers-to-PCI destination [ 10.0.40.10 ]
set rulebase security rules Servers-to-PCI application [ ssl ]
set rulebase security rules Servers-to-PCI service service-https
set rulebase security rules Servers-to-PCI action allow

# Management -> All (admin access via jump box)
set rulebase security rules Mgmt-Admin from Management to [ Servers PCI-CDE ]
set rulebase security rules Mgmt-Admin source [ 10.0.10.50 ]
set rulebase security rules Mgmt-Admin application [ ssh rdp ]
set rulebase security rules Mgmt-Admin source-user [ admin-group ]
set rulebase security rules Mgmt-Admin action allow

# Intra-zone deny (prevent lateral movement within zone)
set rulebase security rules Deny-Intrazone from Corporate to Corporate
set rulebase security rules Deny-Intrazone action deny log-end yes

# Default deny all
set rulebase security rules Deny-All from any to any
set rulebase security rules Deny-All action deny log-end yes

Step 4: Implement Inter-VLAN Routing ACLs

For additional layer 3 filtering on the router/L3 switch:

! ACL: Corporate can only reach specific server ports
ip access-list extended CORP-TO-SERVERS
 permit tcp 10.0.20.0 0.0.0.255 10.0.30.0 0.0.0.255 eq 80
 permit tcp 10.0.20.0 0.0.0.255 10.0.30.0 0.0.0.255 eq 443
 permit tcp 10.0.20.0 0.0.0.255 10.0.30.0 0.0.0.255 eq 25
 permit udp 10.0.20.0 0.0.0.255 10.0.30.10 0.0.0.0 eq 53
 deny ip 10.0.20.0 0.0.0.255 10.0.30.0 0.0.0.255 log

! ACL: PCI CDE isolation
ip access-list extended PCI-ISOLATION
 permit tcp host 10.0.30.10 host 10.0.40.10 eq 443
 permit tcp 10.0.10.50 0.0.0.0 10.0.40.0 0.0.0.255 eq 22
 deny ip any 10.0.40.0 0.0.0.255 log

! Apply ACLs to VLAN interfaces
interface Vlan20
 ip address 10.0.20.1 255.255.255.0
 ip access-group CORP-TO-SERVERS out

interface Vlan40
 ip address 10.0.40.1 255.255.255.0
 ip access-group PCI-ISOLATION in

Step 5: Validate Segmentation

#!/usr/bin/env python3
"""Network segmentation validation - tests connectivity between zones."""

import subprocess
import sys
import json
from datetime import datetime


class SegmentationValidator:
    """Test network segmentation controls between zones."""

    def __init__(self):
        self.results = []

    def test_connectivity(self, src_desc: str, dst_ip: str, port: int,
                          protocol: str = "tcp", expected: str = "blocked"):
        """Test if connectivity exists between source and destination."""
        try:
            if protocol == "tcp":
                cmd = ["nc", "-z", "-w", "3", dst_ip, str(port)]
            elif protocol == "udp":
                cmd = ["nc", "-z", "-u", "-w", "3", dst_ip, str(port)]
            elif protocol == "icmp":
                cmd = ["ping", "-c", "1", "-W", "3", dst_ip]
            else:
                return

            result = subprocess.run(cmd, capture_output=True, timeout=5)
            actual = "open" if result.returncode == 0 else "blocked"

        except subprocess.TimeoutExpired:
            actual = "blocked"
        except FileNotFoundError:
            actual = "error"

        status = "PASS" if actual == expected else "FAIL"

        self.results.append({
            "source": src_desc,
            "destination": f"{dst_ip}:{port}/{protocol}",
            "expected": expected,
            "actual": actual,
            "status": status,
        })

        symbol = "[+]" if status == "PASS" else "[!]"
        print(f"  {symbol} {src_desc} -> {dst_ip}:{port}/{protocol} "
              f"| Expected: {expected} | Actual: {actual} | {status}")

    def run_validation(self):
        """Run segmentation validation tests."""
        print(f"\n{'='*70}")
        print("NETWORK SEGMENTATION VALIDATION")
        print(f"{'='*70}")
        print(f"Date: {datetime.now().isoformat()}\n")

        # Tests that SHOULD be blocked
        print("[*] Testing controls that should BLOCK traffic:")
        self.test_connectivity("Corporate", "10.0.40.10", 443, "tcp", "blocked")
        self.test_connectivity("Corporate", "10.0.40.10", 22, "tcp", "blocked")
        self.test_connectivity("Guest", "10.0.30.10", 80, "tcp", "blocked")
        self.test_connectivity("Guest", "10.0.20.1", 0, "icmp", "blocked")

        # Tests that SHOULD be allowed
        print("\n[*] Testing controls that should ALLOW traffic:")
        self.test_connectivity("Corporate", "10.0.30.10", 443, "tcp", "open")
        self.test_connectivity("Corporate", "10.0.30.10", 80, "tcp", "open")
        self.test_connectivity("Management", "10.0.30.10", 22, "tcp", "open")

        # Summary
        passed = sum(1 for r in self.results if r["status"] == "PASS")
        failed = sum(1 for r in self.results if r["status"] == "FAIL")
        print(f"\n{'='*70}")
        print(f"Results: {passed} PASSED, {failed} FAILED out of {len(self.results)} tests")

        if failed > 0:
            print(f"\n[!] FAILED TESTS:")
            for r in self.results:
                if r["status"] == "FAIL":
                    print(f"  - {r['source']} -> {r['destination']}: "
                          f"expected {r['expected']}, got {r['actual']}")

        # Save report
        report = {
            "date": datetime.now().isoformat(),
            "total_tests": len(self.results),
            "passed": passed,
            "failed": failed,
            "results": self.results,
        }
        report_path = f"segmentation_test_{datetime.now().strftime('%Y%m%d')}.json"
        with open(report_path, 'w') as f:
            json.dump(report, f, indent=2)
        print(f"\nReport saved to: {report_path}")


if __name__ == "__main__":
    validator = SegmentationValidator()
    validator.run_validation()

Best Practices

  • Default Deny - Start with deny-all inter-zone rules and explicitly allow required traffic
  • Document Flows - Map all legitimate traffic flows before implementing restrictions
  • Segment by Sensitivity - Group assets by data classification and compliance scope
  • Intra-Zone Control - Block lateral movement within zones, not just between zones
  • Limit Management Access - Restrict management plane to a dedicated zone with jump boxes
  • Regular Validation - Test segmentation controls quarterly with automated tools
  • Monitor Denied Traffic - Log and review denied inter-zone traffic for policy refinement
  • PCI Scope Reduction - Use segmentation to minimize PCI DSS Cardholder Data Environment scope

Verification Criteria

Confirm successful execution by validating:

  • [ ] All prerequisite tools and access requirements are satisfied
  • [ ] Each workflow step completed without errors
  • [ ] Output matches expected format and contains expected data
  • [ ] No security warnings or misconfigurations detected
  • [ ] Results are documented and evidence is preserved for audit

Compliance Framework Mapping

This skill supports compliance evidence collection across multiple frameworks:

  • SOC 2: CC6.6 (System Boundaries), CC6.7 (Restriction on Transmission)
  • ISO 27001: A.13.1 (Network Security), A.13.2 (Information Transfer)
  • NIST 800-53: SC-7 (Boundary Protection), AC-17 (Remote Access), SI-4 (System Monitoring)
  • NIST CSF: PR.AC (Access Control), PR.PT (Protective Technology)

Claw GRC Tip: When this skill is executed by a registered agent, compliance evidence is automatically captured and mapped to the relevant controls in your active frameworks.

Deploying This Skill with Claw GRC

Agent Execution

Register this skill with your Claw GRC agent for automated execution:

# Install via CLI
npx claw-grc skills add implementing-network-segmentation-with-firewall-zones

# Or load dynamically via MCP
grc.load_skill("implementing-network-segmentation-with-firewall-zones")

Audit Trail Integration

When executed through Claw GRC, every step of this skill generates tamper-evident audit records:

  • SHA-256 chain hashing ensures no step can be modified after execution
  • Evidence artifacts (configs, scan results, logs) are automatically attached to relevant controls
  • Trust score impact — successful execution increases your agent's trust score

Continuous Compliance

Schedule this skill for recurring execution to maintain continuous compliance posture. Claw GRC monitors for drift and alerts when re-execution is needed.

References

  • CISA Zero Trust Microsegmentation Guidance
  • NIST SP 800-125B - Secure Virtual Network Configuration
  • PCI DSS v4.0 - Network Segmentation
  • Faddom Network Segmentation Best Practices 2025

Use with Claw GRC Agents

This skill is fully compatible with Claw GRC's autonomous agent system. Deploy it to any registered agent via MCP, and every execution will be logged in the tamper-evident audit trail.

// Load this skill in your agent
npx claw-grc skills add implementing-network-segmentation-with-firewall-zones
// Or via MCP
grc.load_skill("implementing-network-segmentation-with-firewall-zones")

Tags

network-segmentationfirewall-zonesvlanmicrosegmentationlateral-movementzero-trustacleast-west-traffic

Related Skills

Zero Trust Architecture

Implementing Microsegmentation with Guardicore

6m·intermediate
Network Security

Configuring Network Segmentation with Vlans

9m·intermediate
Network Security

Configuring Pfsense Firewall Rules

8m·intermediate
Network Security

Detecting Lateral Movement in Network

10m·intermediate
Container & Cloud-Native Security

Implementing Kubernetes Network Policy with Calico

3m·intermediate
OT & ICS Security

Implementing Network Segmentation for OT

8m·intermediate

Skill Details

Domain
Network Security
Difficulty
intermediate
Read Time
7 min
Code Examples
5

On This Page

OverviewPrerequisitesCore ConceptsImplementation StepsBest PracticesReferencesVerification CriteriaCompliance Framework MappingDeploying This Skill with Claw GRC

Deploy This Skill

Add this skill to your Claw GRC agent and start automating.

Get Started Free →