Configuring Network Segmentation with VLANs
When to Use
- Segmenting an enterprise network into isolated security zones (corporate, servers, DMZ, guest, IoT)
- Meeting compliance requirements (PCI-DSS, HIPAA, SOC 2) that mandate network isolation for sensitive data
- Reducing blast radius of security incidents by preventing lateral movement between network segments
- Isolating high-risk devices (IoT, BYOD, legacy systems) from critical infrastructure
- Implementing defense-in-depth by combining VLANs with firewall rules and access control lists
Do not use VLANs as the sole security control without Layer 3 filtering, for isolating networks that require air-gapping, or without proper switch hardening against VLAN hopping attacks.
Prerequisites
- Managed switches supporting 802.1Q VLAN trunking (Cisco Catalyst, HP Aruba, Juniper EX, etc.)
- Layer 3 switch or firewall for inter-VLAN routing and access control
- Network design document specifying VLAN assignments, IP subnets, and traffic flow requirements
- Console or SSH access to switches with privileged configuration mode
- Understanding of 802.1Q trunking, STP, and inter-VLAN routing concepts
Workflow
Step 1: Design the VLAN Architecture
# Define VLANs based on security zones and function
VLAN Plan:
VLAN 10 - CORPORATE (10.10.10.0/24) - Employee workstations
VLAN 20 - SERVERS (10.10.20.0/24) - Internal servers
VLAN 30 - DMZ (10.10.30.0/24) - Internet-facing servers
VLAN 40 - GUEST (10.10.40.0/24) - Guest WiFi
VLAN 50 - IOT (10.10.50.0/24) - IoT/OT devices
VLAN 60 - VOIP (10.10.60.0/24) - VoIP phones
VLAN 100 - MANAGEMENT (10.10.100.0/24) - Switch/AP management
VLAN 999 - QUARANTINE (10.10.99.0/24) - Isolated/compromised hosts
VLAN 998 - NATIVE_UNUSED - Native VLAN (no traffic)
# Traffic flow matrix:
# CORPORATE -> SERVERS: Allowed (specific ports)
# CORPORATE -> DMZ: Allowed (HTTP/HTTPS only)
# CORPORATE -> GUEST: Denied
# CORPORATE -> IOT: Denied
# GUEST -> Any Internal: Denied
# IOT -> SERVERS: Allowed (specific ports to specific hosts only)
# DMZ -> SERVERS: Allowed (database ports only)
# MANAGEMENT -> All: Allowed (from management stations only)
Step 2: Configure VLANs on Cisco Catalyst Switch
! Enter configuration mode
enable
configure terminal
! Create VLANs
vlan 10
name CORPORATE
exit
vlan 20
name SERVERS
exit
vlan 30
name DMZ
exit
vlan 40
name GUEST
exit
vlan 50
name IOT
exit
vlan 60
name VOIP
exit
vlan 100
name MANAGEMENT
exit
vlan 998
name NATIVE_UNUSED
exit
vlan 999
name QUARANTINE
exit
! Configure access ports for workstations (VLAN 10)
interface range GigabitEthernet1/0/1-24
switchport mode access
switchport access vlan 10
switchport nonegotiate
spanning-tree portfast
spanning-tree bpduguard enable
no shutdown
exit
! Configure access ports for servers (VLAN 20)
interface range GigabitEthernet1/0/25-36
switchport mode access
switchport access vlan 20
switchport nonegotiate
spanning-tree portfast
spanning-tree bpduguard enable
no shutdown
exit
! Configure trunk ports to other switches
interface GigabitEthernet1/0/48
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk native vlan 998
switchport trunk allowed vlan 10,20,30,40,50,60,100
switchport nonegotiate
no shutdown
exit
! Configure trunk to firewall/router
interface GigabitEthernet1/0/47
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk native vlan 998
switchport trunk allowed vlan 10,20,30,40,50,60,100
switchport nonegotiate
no shutdown
exit
! Shutdown unused ports
interface range GigabitEthernet1/0/37-46
shutdown
switchport mode access
switchport access vlan 999
exit
Step 3: Harden Switch Against VLAN Hopping
! Disable DTP on all ports (prevents switch spoofing)
interface range GigabitEthernet1/0/1-46
switchport nonegotiate
exit
! Set native VLAN to unused VLAN on all trunks
interface range GigabitEthernet1/0/47-48
switchport trunk native vlan 998
exit
! Enable DHCP Snooping
ip dhcp snooping
ip dhcp snooping vlan 10,20,30,40,50,60
interface GigabitEthernet1/0/47
ip dhcp snooping trust
exit
! Enable Dynamic ARP Inspection
ip arp inspection vlan 10,20,30,40,50,60
interface GigabitEthernet1/0/47
ip arp inspection trust
exit
! Enable IP Source Guard (prevents IP spoofing)
interface range GigabitEthernet1/0/1-36
ip verify source
exit
! Enable Port Security
interface range GigabitEthernet1/0/1-24
switchport port-security
switchport port-security maximum 2
switchport port-security violation restrict
switchport port-security aging time 60
exit
! Set VTP to transparent mode (prevents VTP attacks)
vtp mode transparent
! Enable BPDU Guard globally
spanning-tree portfast bpduguard default
! Enable Storm Control
interface range GigabitEthernet1/0/1-36
storm-control broadcast level 10
storm-control multicast level 10
storm-control action shutdown
exit
Step 4: Configure Inter-VLAN Routing with ACLs
! On the Layer 3 switch or firewall, configure SVIs
interface Vlan10
ip address 10.10.10.1 255.255.255.0
no shutdown
exit
interface Vlan20
ip address 10.10.20.1 255.255.255.0
no shutdown
exit
interface Vlan30
ip address 10.10.30.1 255.255.255.0
no shutdown
exit
interface Vlan40
ip address 10.10.40.1 255.255.255.0
no shutdown
exit
interface Vlan50
ip address 10.10.50.1 255.255.255.0
no shutdown
exit
! ACL: Corporate to Servers (allow specific services)
ip access-list extended CORP-TO-SERVERS
permit tcp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 80
permit tcp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 443
permit tcp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 445
permit udp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 53
permit icmp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 echo
deny ip any any log
exit
! ACL: Guest to Internet only (deny all internal)
ip access-list extended GUEST-OUTBOUND
deny ip 10.10.40.0 0.0.0.255 10.0.0.0 0.255.255.255
deny ip 10.10.40.0 0.0.0.255 172.16.0.0 0.15.255.255
deny ip 10.10.40.0 0.0.0.255 192.168.0.0 0.0.255.255
permit tcp 10.10.40.0 0.0.0.255 any eq 80
permit tcp 10.10.40.0 0.0.0.255 any eq 443
permit udp 10.10.40.0 0.0.0.255 any eq 53
deny ip any any log
exit
! ACL: IoT limited access
ip access-list extended IOT-OUTBOUND
permit tcp 10.10.50.0 0.0.0.255 host 10.10.20.10 eq 443
permit tcp 10.10.50.0 0.0.0.255 any eq 443
permit udp 10.10.50.0 0.0.0.255 host 10.10.20.1 eq 53
deny ip 10.10.50.0 0.0.0.255 10.10.50.0 0.0.0.255 log
deny ip any any log
exit
! Apply ACLs to VLAN interfaces
interface Vlan10
ip access-group CORP-TO-SERVERS out
exit
interface Vlan40
ip access-group GUEST-OUTBOUND in
exit
interface Vlan50
ip access-group IOT-OUTBOUND in
exit
Step 5: Configure DHCP and DNS per VLAN
! DHCP pools for each VLAN
ip dhcp pool CORPORATE
network 10.10.10.0 255.255.255.0
default-router 10.10.10.1
dns-server 10.10.20.10
domain-name corp.example.com
lease 1
exit
ip dhcp pool GUEST
network 10.10.40.0 255.255.255.0
default-router 10.10.40.1
dns-server 1.1.1.1 8.8.8.8
lease 0 4
exit
ip dhcp pool IOT
network 10.10.50.0 255.255.255.0
default-router 10.10.50.1
dns-server 10.10.20.10
lease 7
exit
! Exclude gateway and server IPs from DHCP pools
ip dhcp excluded-address 10.10.10.1 10.10.10.10
ip dhcp excluded-address 10.10.40.1 10.10.40.10
ip dhcp excluded-address 10.10.50.1 10.10.50.10
Step 6: Verify and Test Segmentation
# From a workstation on VLAN 10 (Corporate):
# Should succeed:
ping 10.10.20.10 # Server access
curl https://10.10.20.10 # HTTPS to server
# Should fail:
ping 10.10.40.100 # Guest VLAN - should be blocked
ping 10.10.50.100 # IoT VLAN - should be blocked
# From a device on VLAN 40 (Guest):
# Should succeed:
ping 8.8.8.8 # Internet access
curl https://www.google.com
# Should fail:
ping 10.10.10.1 # Corporate gateway - blocked
ping 10.10.20.10 # Server - blocked
# Verify switch configuration
show vlan brief
show interfaces trunk
show ip arp inspection statistics
show ip dhcp snooping binding
show port-security
show ip access-lists
# Run VLAN hopping tests (from authorized pentest)
# These should all fail if hardening is correct:
# 1. DTP negotiation - should fail (nonegotiate)
# 2. Double tagging - should fail (native VLAN 998)
# 3. ARP spoofing - should fail (DAI enabled)
Key Concepts
| Term |
Definition |
| VLAN (Virtual LAN) |
Logical network partition at Layer 2 that groups switch ports into isolated broadcast domains, regardless of physical location |
| 802.1Q Trunking |
IEEE standard for VLAN tagging that adds a 4-byte header to Ethernet frames, identifying which VLAN a frame belongs to across trunk links |
| Inter-VLAN Routing |
Layer 3 forwarding of traffic between VLANs using a router, Layer 3 switch, or firewall with access control lists |
| Native VLAN |
VLAN assigned to untagged frames on trunk ports; should be set to an unused VLAN to prevent VLAN hopping attacks |
| DHCP Snooping |
Switch feature that validates DHCP messages and builds a binding table of IP-MAC-port mappings, preventing rogue DHCP servers |
| Port Security |
Switch feature that limits the number of MAC addresses per port and takes action (shutdown, restrict) when violated |
Tools & Systems
- Cisco Catalyst/Nexus: Enterprise managed switches with comprehensive VLAN, trunking, and security feature support
- HP Aruba CX: Enterprise switches with REST API management and VLAN segmentation capabilities
- pfSense/OPNsense: Open-source firewalls for inter-VLAN routing with stateful access control
- NetBox: Open-source IPAM and DCIM tool for documenting VLAN assignments, IP addressing, and network topology
- Nmap: Network scanner for verifying segmentation effectiveness by testing reachability across VLAN boundaries
Common Scenarios
Scenario: Implementing PCI-DSS Compliant Network Segmentation for Retail
Context: A retail chain must isolate their payment card processing systems from the general corporate network to meet PCI-DSS requirements. The current flat network has point-of-sale terminals, employee workstations, inventory servers, and guest WiFi on a single VLAN. The environment uses Cisco Catalyst 9300 switches.
Approach:
- Design VLAN architecture: POS terminals on VLAN 50 (CDE), corporate on VLAN 10, servers on VLAN 20, guest on VLAN 40
- Create VLANs on all access-layer switches and configure access ports by function
- Configure trunk links between switches with explicit VLAN allowed lists (no "all" trunks)
- Set native VLAN to 998 (unused) on all trunks and disable DTP on every port
- Configure ACLs on the Layer 3 switch: CDE VLAN can only reach the payment processor's IP on port 443; no other inter-VLAN traffic to/from CDE
- Enable DHCP snooping, DAI, and port security on all access ports
- Verify segmentation with penetration testing from each VLAN, confirming CDE is fully isolated
Pitfalls:
- Leaving DTP enabled on access ports, allowing VLAN hopping to reach the CDE
- Using VLAN 1 as the native VLAN, enabling double-tagging attacks
- Not restricting trunk allowed VLANs, carrying all VLANs including CDE to non-essential switches
- Creating ACLs that allow "any" source to reach CDE servers instead of specific POS terminal IPs
Output Format
## Network Segmentation Implementation Report
**Network**: Retail Store #42
**Switch Platform**: Cisco Catalyst 9300
**VLANs Configured**: 8
### VLAN Summary
| VLAN ID | Name | Subnet | Ports | Purpose |
|---------|------|--------|-------|---------|
| 10 | CORPORATE | 10.10.10.0/24 | Gi1/0/1-24 | Employee workstations |
| 20 | SERVERS | 10.10.20.0/24 | Gi1/0/25-36 | Internal servers |
| 30 | DMZ | 10.10.30.0/24 | Gi2/0/1-4 | Internet-facing |
| 40 | GUEST | 10.10.40.0/24 | WiFi AP trunk | Guest WiFi |
| 50 | CDE | 10.10.50.0/24 | Gi2/0/5-12 | POS terminals |
| 100 | MGMT | 10.10.100.0/24 | Gi1/0/48 | Switch management |
| 998 | NATIVE | N/A | Trunks only | Unused native |
| 999 | QUARANTINE | 10.10.99.0/24 | Unused ports | Isolation |
### Security Hardening Status
| Control | Status |
|---------|--------|
| DTP Disabled (nonegotiate) | All ports |
| Native VLAN (998) | All trunks |
| DHCP Snooping | VLANs 10,20,40,50 |
| Dynamic ARP Inspection | VLANs 10,20,40,50 |
| Port Security | Access ports |
| BPDU Guard | Access ports |
| Unused Ports Shutdown | 10 ports in VLAN 999 |
| VTP Transparent Mode | Enabled |
1---2name: configuring-network-segmentation-with-vlans-23description: 'Designs and implements VLAN-based (802.1Q) network segmentation on4 managed switches to isolate zones such as corporate, servers, DMZ, guest, and5 IoT, and to limit lateral movement paths. Use when segmenting an enterprise network6 into isolated security zones, meeting compliance mandates (PCI-DSS, HIPAA, SOC7 2) for network isolation, or reducing blast radius from a security incident.89 '10domain: cybersecurity11subdomain: network-security12tags:13- network-security14- vlan15- network-segmentation16- switch-security17- 802.1q18version: '1.0'19author: mahipal20license: Apache-2.021nist_csf:22- PR.IR-0123- DE.CM-0124- ID.AM-0325- PR.DS-0226mitre_attack:27- T104628- T104029- T1557.00230- T102131- T101832metadata:33 source: https://skillmd.com/skills/26zl/configuring-network-segmentation-with-vlans-234---3536# Configuring Network Segmentation with VLANs3738## When to Use3940- Segmenting an enterprise network into isolated security zones (corporate, servers, DMZ, guest, IoT)41- Meeting compliance requirements (PCI-DSS, HIPAA, SOC 2) that mandate network isolation for sensitive data42- Reducing blast radius of security incidents by preventing lateral movement between network segments43- Isolating high-risk devices (IoT, BYOD, legacy systems) from critical infrastructure44- Implementing defense-in-depth by combining VLANs with firewall rules and access control lists4546**Do not use** VLANs as the sole security control without Layer 3 filtering, for isolating networks that require air-gapping, or without proper switch hardening against VLAN hopping attacks.4748## Prerequisites4950- Managed switches supporting 802.1Q VLAN trunking (Cisco Catalyst, HP Aruba, Juniper EX, etc.)51- Layer 3 switch or firewall for inter-VLAN routing and access control52- Network design document specifying VLAN assignments, IP subnets, and traffic flow requirements53- Console or SSH access to switches with privileged configuration mode54- Understanding of 802.1Q trunking, STP, and inter-VLAN routing concepts5556## Workflow5758### Step 1: Design the VLAN Architecture5960```61# Define VLANs based on security zones and function6263VLAN Plan:64 VLAN 10 - CORPORATE (10.10.10.0/24) - Employee workstations65 VLAN 20 - SERVERS (10.10.20.0/24) - Internal servers66 VLAN 30 - DMZ (10.10.30.0/24) - Internet-facing servers67 VLAN 40 - GUEST (10.10.40.0/24) - Guest WiFi68 VLAN 50 - IOT (10.10.50.0/24) - IoT/OT devices69 VLAN 60 - VOIP (10.10.60.0/24) - VoIP phones70 VLAN 100 - MANAGEMENT (10.10.100.0/24) - Switch/AP management71 VLAN 999 - QUARANTINE (10.10.99.0/24) - Isolated/compromised hosts72 VLAN 998 - NATIVE_UNUSED - Native VLAN (no traffic)7374# Traffic flow matrix:75# CORPORATE -> SERVERS: Allowed (specific ports)76# CORPORATE -> DMZ: Allowed (HTTP/HTTPS only)77# CORPORATE -> GUEST: Denied78# CORPORATE -> IOT: Denied79# GUEST -> Any Internal: Denied80# IOT -> SERVERS: Allowed (specific ports to specific hosts only)81# DMZ -> SERVERS: Allowed (database ports only)82# MANAGEMENT -> All: Allowed (from management stations only)83```8485### Step 2: Configure VLANs on Cisco Catalyst Switch8687```88! Enter configuration mode89enable90configure terminal9192! Create VLANs93vlan 1094 name CORPORATE95 exit96vlan 2097 name SERVERS98 exit99vlan 30100 name DMZ101 exit102vlan 40103 name GUEST104 exit105vlan 50106 name IOT107 exit108vlan 60109 name VOIP110 exit111vlan 100112 name MANAGEMENT113 exit114vlan 998115 name NATIVE_UNUSED116 exit117vlan 999118 name QUARANTINE119 exit120121! Configure access ports for workstations (VLAN 10)122interface range GigabitEthernet1/0/1-24123 switchport mode access124 switchport access vlan 10125 switchport nonegotiate126 spanning-tree portfast127 spanning-tree bpduguard enable128 no shutdown129 exit130131! Configure access ports for servers (VLAN 20)132interface range GigabitEthernet1/0/25-36133 switchport mode access134 switchport access vlan 20135 switchport nonegotiate136 spanning-tree portfast137 spanning-tree bpduguard enable138 no shutdown139 exit140141! Configure trunk ports to other switches142interface GigabitEthernet1/0/48143 switchport mode trunk144 switchport trunk encapsulation dot1q145 switchport trunk native vlan 998146 switchport trunk allowed vlan 10,20,30,40,50,60,100147 switchport nonegotiate148 no shutdown149 exit150151! Configure trunk to firewall/router152interface GigabitEthernet1/0/47153 switchport mode trunk154 switchport trunk encapsulation dot1q155 switchport trunk native vlan 998156 switchport trunk allowed vlan 10,20,30,40,50,60,100157 switchport nonegotiate158 no shutdown159 exit160161! Shutdown unused ports162interface range GigabitEthernet1/0/37-46163 shutdown164 switchport mode access165 switchport access vlan 999166 exit167```168169### Step 3: Harden Switch Against VLAN Hopping170171```172! Disable DTP on all ports (prevents switch spoofing)173interface range GigabitEthernet1/0/1-46174 switchport nonegotiate175 exit176177! Set native VLAN to unused VLAN on all trunks178interface range GigabitEthernet1/0/47-48179 switchport trunk native vlan 998180 exit181182! Enable DHCP Snooping183ip dhcp snooping184ip dhcp snooping vlan 10,20,30,40,50,60185interface GigabitEthernet1/0/47186 ip dhcp snooping trust187 exit188189! Enable Dynamic ARP Inspection190ip arp inspection vlan 10,20,30,40,50,60191interface GigabitEthernet1/0/47192 ip arp inspection trust193 exit194195! Enable IP Source Guard (prevents IP spoofing)196interface range GigabitEthernet1/0/1-36197 ip verify source198 exit199200! Enable Port Security201interface range GigabitEthernet1/0/1-24202 switchport port-security203 switchport port-security maximum 2204 switchport port-security violation restrict205 switchport port-security aging time 60206 exit207208! Set VTP to transparent mode (prevents VTP attacks)209vtp mode transparent210211! Enable BPDU Guard globally212spanning-tree portfast bpduguard default213214! Enable Storm Control215interface range GigabitEthernet1/0/1-36216 storm-control broadcast level 10217 storm-control multicast level 10218 storm-control action shutdown219 exit220```221222### Step 4: Configure Inter-VLAN Routing with ACLs223224```225! On the Layer 3 switch or firewall, configure SVIs226interface Vlan10227 ip address 10.10.10.1 255.255.255.0228 no shutdown229 exit230interface Vlan20231 ip address 10.10.20.1 255.255.255.0232 no shutdown233 exit234interface Vlan30235 ip address 10.10.30.1 255.255.255.0236 no shutdown237 exit238interface Vlan40239 ip address 10.10.40.1 255.255.255.0240 no shutdown241 exit242interface Vlan50243 ip address 10.10.50.1 255.255.255.0244 no shutdown245 exit246247! ACL: Corporate to Servers (allow specific services)248ip access-list extended CORP-TO-SERVERS249 permit tcp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 80250 permit tcp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 443251 permit tcp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 445252 permit udp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 53253 permit icmp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 echo254 deny ip any any log255 exit256257! ACL: Guest to Internet only (deny all internal)258ip access-list extended GUEST-OUTBOUND259 deny ip 10.10.40.0 0.0.0.255 10.0.0.0 0.255.255.255260 deny ip 10.10.40.0 0.0.0.255 172.16.0.0 0.15.255.255261 deny ip 10.10.40.0 0.0.0.255 192.168.0.0 0.0.255.255262 permit tcp 10.10.40.0 0.0.0.255 any eq 80263 permit tcp 10.10.40.0 0.0.0.255 any eq 443264 permit udp 10.10.40.0 0.0.0.255 any eq 53265 deny ip any any log266 exit267268! ACL: IoT limited access269ip access-list extended IOT-OUTBOUND270 permit tcp 10.10.50.0 0.0.0.255 host 10.10.20.10 eq 443271 permit tcp 10.10.50.0 0.0.0.255 any eq 443272 permit udp 10.10.50.0 0.0.0.255 host 10.10.20.1 eq 53273 deny ip 10.10.50.0 0.0.0.255 10.10.50.0 0.0.0.255 log274 deny ip any any log275 exit276277! Apply ACLs to VLAN interfaces278interface Vlan10279 ip access-group CORP-TO-SERVERS out280 exit281interface Vlan40282 ip access-group GUEST-OUTBOUND in283 exit284interface Vlan50285 ip access-group IOT-OUTBOUND in286 exit287```288289### Step 5: Configure DHCP and DNS per VLAN290291```292! DHCP pools for each VLAN293ip dhcp pool CORPORATE294 network 10.10.10.0 255.255.255.0295 default-router 10.10.10.1296 dns-server 10.10.20.10297 domain-name corp.example.com298 lease 1299 exit300301ip dhcp pool GUEST302 network 10.10.40.0 255.255.255.0303 default-router 10.10.40.1304 dns-server 1.1.1.1 8.8.8.8305 lease 0 4306 exit307308ip dhcp pool IOT309 network 10.10.50.0 255.255.255.0310 default-router 10.10.50.1311 dns-server 10.10.20.10312 lease 7313 exit314315! Exclude gateway and server IPs from DHCP pools316ip dhcp excluded-address 10.10.10.1 10.10.10.10317ip dhcp excluded-address 10.10.40.1 10.10.40.10318ip dhcp excluded-address 10.10.50.1 10.10.50.10319```320321### Step 6: Verify and Test Segmentation322323```bash324# From a workstation on VLAN 10 (Corporate):325# Should succeed:326ping 10.10.20.10 # Server access327curl https://10.10.20.10 # HTTPS to server328329# Should fail:330ping 10.10.40.100 # Guest VLAN - should be blocked331ping 10.10.50.100 # IoT VLAN - should be blocked332333# From a device on VLAN 40 (Guest):334# Should succeed:335ping 8.8.8.8 # Internet access336curl https://www.google.com337338# Should fail:339ping 10.10.10.1 # Corporate gateway - blocked340ping 10.10.20.10 # Server - blocked341342# Verify switch configuration343show vlan brief344show interfaces trunk345show ip arp inspection statistics346show ip dhcp snooping binding347show port-security348show ip access-lists349350# Run VLAN hopping tests (from authorized pentest)351# These should all fail if hardening is correct:352# 1. DTP negotiation - should fail (nonegotiate)353# 2. Double tagging - should fail (native VLAN 998)354# 3. ARP spoofing - should fail (DAI enabled)355```356357## Key Concepts358359| Term | Definition |360|------|------------|361| **VLAN (Virtual LAN)** | Logical network partition at Layer 2 that groups switch ports into isolated broadcast domains, regardless of physical location |362| **802.1Q Trunking** | IEEE standard for VLAN tagging that adds a 4-byte header to Ethernet frames, identifying which VLAN a frame belongs to across trunk links |363| **Inter-VLAN Routing** | Layer 3 forwarding of traffic between VLANs using a router, Layer 3 switch, or firewall with access control lists |364| **Native VLAN** | VLAN assigned to untagged frames on trunk ports; should be set to an unused VLAN to prevent VLAN hopping attacks |365| **DHCP Snooping** | Switch feature that validates DHCP messages and builds a binding table of IP-MAC-port mappings, preventing rogue DHCP servers |366| **Port Security** | Switch feature that limits the number of MAC addresses per port and takes action (shutdown, restrict) when violated |367368## Tools & Systems369370- **Cisco Catalyst/Nexus**: Enterprise managed switches with comprehensive VLAN, trunking, and security feature support371- **HP Aruba CX**: Enterprise switches with REST API management and VLAN segmentation capabilities372- **pfSense/OPNsense**: Open-source firewalls for inter-VLAN routing with stateful access control373- **NetBox**: Open-source IPAM and DCIM tool for documenting VLAN assignments, IP addressing, and network topology374- **Nmap**: Network scanner for verifying segmentation effectiveness by testing reachability across VLAN boundaries375376## Common Scenarios377378### Scenario: Implementing PCI-DSS Compliant Network Segmentation for Retail379380**Context**: A retail chain must isolate their payment card processing systems from the general corporate network to meet PCI-DSS requirements. The current flat network has point-of-sale terminals, employee workstations, inventory servers, and guest WiFi on a single VLAN. The environment uses Cisco Catalyst 9300 switches.381382**Approach**:3831. Design VLAN architecture: POS terminals on VLAN 50 (CDE), corporate on VLAN 10, servers on VLAN 20, guest on VLAN 403842. Create VLANs on all access-layer switches and configure access ports by function3853. Configure trunk links between switches with explicit VLAN allowed lists (no "all" trunks)3864. Set native VLAN to 998 (unused) on all trunks and disable DTP on every port3875. Configure ACLs on the Layer 3 switch: CDE VLAN can only reach the payment processor's IP on port 443; no other inter-VLAN traffic to/from CDE3886. Enable DHCP snooping, DAI, and port security on all access ports3897. Verify segmentation with penetration testing from each VLAN, confirming CDE is fully isolated390391**Pitfalls**:392- Leaving DTP enabled on access ports, allowing VLAN hopping to reach the CDE393- Using VLAN 1 as the native VLAN, enabling double-tagging attacks394- Not restricting trunk allowed VLANs, carrying all VLANs including CDE to non-essential switches395- Creating ACLs that allow "any" source to reach CDE servers instead of specific POS terminal IPs396397## Output Format398399```400## Network Segmentation Implementation Report401402**Network**: Retail Store #42403**Switch Platform**: Cisco Catalyst 9300404**VLANs Configured**: 8405406### VLAN Summary407408| VLAN ID | Name | Subnet | Ports | Purpose |409|---------|------|--------|-------|---------|410| 10 | CORPORATE | 10.10.10.0/24 | Gi1/0/1-24 | Employee workstations |411| 20 | SERVERS | 10.10.20.0/24 | Gi1/0/25-36 | Internal servers |412| 30 | DMZ | 10.10.30.0/24 | Gi2/0/1-4 | Internet-facing |413| 40 | GUEST | 10.10.40.0/24 | WiFi AP trunk | Guest WiFi |414| 50 | CDE | 10.10.50.0/24 | Gi2/0/5-12 | POS terminals |415| 100 | MGMT | 10.10.100.0/24 | Gi1/0/48 | Switch management |416| 998 | NATIVE | N/A | Trunks only | Unused native |417| 999 | QUARANTINE | 10.10.99.0/24 | Unused ports | Isolation |418419### Security Hardening Status420421| Control | Status |422|---------|--------|423| DTP Disabled (nonegotiate) | All ports |424| Native VLAN (998) | All trunks |425| DHCP Snooping | VLANs 10,20,40,50 |426| Dynamic ARP Inspection | VLANs 10,20,40,50 |427| Port Security | Access ports |428| BPDU Guard | Access ports |429| Unused Ports Shutdown | 10 ports in VLAN 999 |430| VTP Transparent Mode | Enabled |431```