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.
Common Misconfigurations & Verification
- Native VLAN = VLAN 1 (or a used VLAN): enables double-tagging hops. Set
switchport trunk native vlan 998 (an unused VLAN) on every trunk and verify with show interfaces trunk — the "Native vlan" column must show 998 on all trunks.
- DTP left on (dynamic auto/desirable): an attacker negotiates a trunk and reaches all VLANs. Force
switchport mode access + switchport nonegotiate on edge ports; confirm with show interfaces switchport | include Negotiation (should read "Off").
- Trunk allows all VLANs:
switchport trunk allowed vlan all carries CDE/MGMT everywhere. Pin explicit lists (...allowed vlan 10,20) and verify with show interfaces trunk allowed-vlan column.
- DAI/DHCP snooping enabled but trust misconfigured: if the uplink/gateway port isn't
ip arp inspection trust / ip dhcp snooping trust, legit DHCP breaks or spoofing slips through. Check show ip arp inspection statistics and show ip dhcp snooping binding.
- Inter-VLAN ACL applied wrong direction or missing
deny ... log: without a terminating logged deny you can't prove isolation. Verify hit counts with show ip access-lists after running the negative test.
- Verify segmentation actively: from a corporate host
ping/curl an IoT and guest host — both MUST fail; from guest, internal pings MUST fail while 8.8.8.8 succeeds. A successful cross-VLAN ping means routing/ACL leaks.
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-vlans3description: Designs and implements VLAN-based network segmentation on managed switches to isolate network zones, enforce access control between segments, and reduce the attack surface by limiting lateral movement paths in enterprise network environments.4license: Apache-2.05---6# Configuring Network Segmentation with VLANs78## When to Use910- Segmenting an enterprise network into isolated security zones (corporate, servers, DMZ, guest, IoT)11- Meeting compliance requirements (PCI-DSS, HIPAA, SOC 2) that mandate network isolation for sensitive data12- Reducing blast radius of security incidents by preventing lateral movement between network segments13- Isolating high-risk devices (IoT, BYOD, legacy systems) from critical infrastructure14- Implementing defense-in-depth by combining VLANs with firewall rules and access control lists1516**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.1718## Common Misconfigurations & Verification1920- **Native VLAN = VLAN 1 (or a used VLAN):** enables double-tagging hops. Set `switchport trunk native vlan 998` (an unused VLAN) on every trunk and verify with `show interfaces trunk` — the "Native vlan" column must show 998 on all trunks.21- **DTP left on (dynamic auto/desirable):** an attacker negotiates a trunk and reaches all VLANs. Force `switchport mode access` + `switchport nonegotiate` on edge ports; confirm with `show interfaces switchport | include Negotiation` (should read "Off").22- **Trunk allows all VLANs:** `switchport trunk allowed vlan all` carries CDE/MGMT everywhere. Pin explicit lists (`...allowed vlan 10,20`) and verify with `show interfaces trunk` allowed-vlan column.23- **DAI/DHCP snooping enabled but trust misconfigured:** if the uplink/gateway port isn't `ip arp inspection trust` / `ip dhcp snooping trust`, legit DHCP breaks or spoofing slips through. Check `show ip arp inspection statistics` and `show ip dhcp snooping binding`.24- **Inter-VLAN ACL applied wrong direction or missing `deny ... log`:** without a terminating logged deny you can't prove isolation. Verify hit counts with `show ip access-lists` after running the negative test.25- **Verify segmentation actively:** from a corporate host `ping`/`curl` an IoT and guest host — both MUST fail; from guest, internal pings MUST fail while `8.8.8.8` succeeds. A successful cross-VLAN ping means routing/ACL leaks.2627## Prerequisites2829- Managed switches supporting 802.1Q VLAN trunking (Cisco Catalyst, HP Aruba, Juniper EX, etc.)30- Layer 3 switch or firewall for inter-VLAN routing and access control31- Network design document specifying VLAN assignments, IP subnets, and traffic flow requirements32- Console or SSH access to switches with privileged configuration mode33- Understanding of 802.1Q trunking, STP, and inter-VLAN routing concepts3435## Workflow3637### Step 1: Design the VLAN Architecture3839```40# Define VLANs based on security zones and function4142VLAN Plan:43 VLAN 10 - CORPORATE (10.10.10.0/24) - Employee workstations44 VLAN 20 - SERVERS (10.10.20.0/24) - Internal servers45 VLAN 30 - DMZ (10.10.30.0/24) - Internet-facing servers46 VLAN 40 - GUEST (10.10.40.0/24) - Guest WiFi47 VLAN 50 - IOT (10.10.50.0/24) - IoT/OT devices48 VLAN 60 - VOIP (10.10.60.0/24) - VoIP phones49 VLAN 100 - MANAGEMENT (10.10.100.0/24) - Switch/AP management50 VLAN 999 - QUARANTINE (10.10.99.0/24) - Isolated/compromised hosts51 VLAN 998 - NATIVE_UNUSED - Native VLAN (no traffic)5253# Traffic flow matrix:54# CORPORATE -> SERVERS: Allowed (specific ports)55# CORPORATE -> DMZ: Allowed (HTTP/HTTPS only)56# CORPORATE -> GUEST: Denied57# CORPORATE -> IOT: Denied58# GUEST -> Any Internal: Denied59# IOT -> SERVERS: Allowed (specific ports to specific hosts only)60# DMZ -> SERVERS: Allowed (database ports only)61# MANAGEMENT -> All: Allowed (from management stations only)62```6364### Step 2: Configure VLANs on Cisco Catalyst Switch6566```67! Enter configuration mode68enable69configure terminal7071! Create VLANs72vlan 1073 name CORPORATE74 exit75vlan 2076 name SERVERS77 exit78vlan 3079 name DMZ80 exit81vlan 4082 name GUEST83 exit84vlan 5085 name IOT86 exit87vlan 6088 name VOIP89 exit90vlan 10091 name MANAGEMENT92 exit93vlan 99894 name NATIVE_UNUSED95 exit96vlan 99997 name QUARANTINE98 exit99100! Configure access ports for workstations (VLAN 10)101interface range GigabitEthernet1/0/1-24102 switchport mode access103 switchport access vlan 10104 switchport nonegotiate105 spanning-tree portfast106 spanning-tree bpduguard enable107 no shutdown108 exit109110! Configure access ports for servers (VLAN 20)111interface range GigabitEthernet1/0/25-36112 switchport mode access113 switchport access vlan 20114 switchport nonegotiate115 spanning-tree portfast116 spanning-tree bpduguard enable117 no shutdown118 exit119120! Configure trunk ports to other switches121interface GigabitEthernet1/0/48122 switchport mode trunk123 switchport trunk encapsulation dot1q124 switchport trunk native vlan 998125 switchport trunk allowed vlan 10,20,30,40,50,60,100126 switchport nonegotiate127 no shutdown128 exit129130! Configure trunk to firewall/router131interface GigabitEthernet1/0/47132 switchport mode trunk133 switchport trunk encapsulation dot1q134 switchport trunk native vlan 998135 switchport trunk allowed vlan 10,20,30,40,50,60,100136 switchport nonegotiate137 no shutdown138 exit139140! Shutdown unused ports141interface range GigabitEthernet1/0/37-46142 shutdown143 switchport mode access144 switchport access vlan 999145 exit146```147148### Step 3: Harden Switch Against VLAN Hopping149150```151! Disable DTP on all ports (prevents switch spoofing)152interface range GigabitEthernet1/0/1-46153 switchport nonegotiate154 exit155156! Set native VLAN to unused VLAN on all trunks157interface range GigabitEthernet1/0/47-48158 switchport trunk native vlan 998159 exit160161! Enable DHCP Snooping162ip dhcp snooping163ip dhcp snooping vlan 10,20,30,40,50,60164interface GigabitEthernet1/0/47165 ip dhcp snooping trust166 exit167168! Enable Dynamic ARP Inspection169ip arp inspection vlan 10,20,30,40,50,60170interface GigabitEthernet1/0/47171 ip arp inspection trust172 exit173174! Enable IP Source Guard (prevents IP spoofing)175interface range GigabitEthernet1/0/1-36176 ip verify source177 exit178179! Enable Port Security180interface range GigabitEthernet1/0/1-24181 switchport port-security182 switchport port-security maximum 2183 switchport port-security violation restrict184 switchport port-security aging time 60185 exit186187! Set VTP to transparent mode (prevents VTP attacks)188vtp mode transparent189190! Enable BPDU Guard globally191spanning-tree portfast bpduguard default192193! Enable Storm Control194interface range GigabitEthernet1/0/1-36195 storm-control broadcast level 10196 storm-control multicast level 10197 storm-control action shutdown198 exit199```200201### Step 4: Configure Inter-VLAN Routing with ACLs202203```204! On the Layer 3 switch or firewall, configure SVIs205interface Vlan10206 ip address 10.10.10.1 255.255.255.0207 no shutdown208 exit209interface Vlan20210 ip address 10.10.20.1 255.255.255.0211 no shutdown212 exit213interface Vlan30214 ip address 10.10.30.1 255.255.255.0215 no shutdown216 exit217interface Vlan40218 ip address 10.10.40.1 255.255.255.0219 no shutdown220 exit221interface Vlan50222 ip address 10.10.50.1 255.255.255.0223 no shutdown224 exit225226! ACL: Corporate to Servers (allow specific services)227ip access-list extended CORP-TO-SERVERS228 permit tcp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 80229 permit tcp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 443230 permit tcp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 445231 permit udp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 eq 53232 permit icmp 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255 echo233 deny ip any any log234 exit235236! ACL: Guest to Internet only (deny all internal)237ip access-list extended GUEST-OUTBOUND238 deny ip 10.10.40.0 0.0.0.255 10.0.0.0 0.255.255.255239 deny ip 10.10.40.0 0.0.0.255 172.16.0.0 0.15.255.255240 deny ip 10.10.40.0 0.0.0.255 192.168.0.0 0.0.255.255241 permit tcp 10.10.40.0 0.0.0.255 any eq 80242 permit tcp 10.10.40.0 0.0.0.255 any eq 443243 permit udp 10.10.40.0 0.0.0.255 any eq 53244 deny ip any any log245 exit246247! ACL: IoT limited access248ip access-list extended IOT-OUTBOUND249 permit tcp 10.10.50.0 0.0.0.255 host 10.10.20.10 eq 443250 permit tcp 10.10.50.0 0.0.0.255 any eq 443251 permit udp 10.10.50.0 0.0.0.255 host 10.10.20.1 eq 53252 deny ip 10.10.50.0 0.0.0.255 10.10.50.0 0.0.0.255 log253 deny ip any any log254 exit255256! Apply ACLs to VLAN interfaces257interface Vlan10258 ip access-group CORP-TO-SERVERS out259 exit260interface Vlan40261 ip access-group GUEST-OUTBOUND in262 exit263interface Vlan50264 ip access-group IOT-OUTBOUND in265 exit266```267268### Step 5: Configure DHCP and DNS per VLAN269270```271! DHCP pools for each VLAN272ip dhcp pool CORPORATE273 network 10.10.10.0 255.255.255.0274 default-router 10.10.10.1275 dns-server 10.10.20.10276 domain-name corp.example.com277 lease 1278 exit279280ip dhcp pool GUEST281 network 10.10.40.0 255.255.255.0282 default-router 10.10.40.1283 dns-server 1.1.1.1 8.8.8.8284 lease 0 4285 exit286287ip dhcp pool IOT288 network 10.10.50.0 255.255.255.0289 default-router 10.10.50.1290 dns-server 10.10.20.10291 lease 7292 exit293294! Exclude gateway and server IPs from DHCP pools295ip dhcp excluded-address 10.10.10.1 10.10.10.10296ip dhcp excluded-address 10.10.40.1 10.10.40.10297ip dhcp excluded-address 10.10.50.1 10.10.50.10298```299300### Step 6: Verify and Test Segmentation301302```bash303# From a workstation on VLAN 10 (Corporate):304# Should succeed:305ping 10.10.20.10 # Server access306curl https://10.10.20.10 # HTTPS to server307308# Should fail:309ping 10.10.40.100 # Guest VLAN - should be blocked310ping 10.10.50.100 # IoT VLAN - should be blocked311312# From a device on VLAN 40 (Guest):313# Should succeed:314ping 8.8.8.8 # Internet access315curl https://www.google.com316317# Should fail:318ping 10.10.10.1 # Corporate gateway - blocked319ping 10.10.20.10 # Server - blocked320321# Verify switch configuration322show vlan brief323show interfaces trunk324show ip arp inspection statistics325show ip dhcp snooping binding326show port-security327show ip access-lists328329# Run VLAN hopping tests (from authorized pentest)330# These should all fail if hardening is correct:331# 1. DTP negotiation - should fail (nonegotiate)332# 2. Double tagging - should fail (native VLAN 998)333# 3. ARP spoofing - should fail (DAI enabled)334```335336## Key Concepts337338| Term | Definition |339|------|------------|340| **VLAN (Virtual LAN)** | Logical network partition at Layer 2 that groups switch ports into isolated broadcast domains, regardless of physical location |341| **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 |342| **Inter-VLAN Routing** | Layer 3 forwarding of traffic between VLANs using a router, Layer 3 switch, or firewall with access control lists |343| **Native VLAN** | VLAN assigned to untagged frames on trunk ports; should be set to an unused VLAN to prevent VLAN hopping attacks |344| **DHCP Snooping** | Switch feature that validates DHCP messages and builds a binding table of IP-MAC-port mappings, preventing rogue DHCP servers |345| **Port Security** | Switch feature that limits the number of MAC addresses per port and takes action (shutdown, restrict) when violated |346347## Tools & Systems348349- **Cisco Catalyst/Nexus**: Enterprise managed switches with comprehensive VLAN, trunking, and security feature support350- **HP Aruba CX**: Enterprise switches with REST API management and VLAN segmentation capabilities351- **pfSense/OPNsense**: Open-source firewalls for inter-VLAN routing with stateful access control352- **NetBox**: Open-source IPAM and DCIM tool for documenting VLAN assignments, IP addressing, and network topology353- **Nmap**: Network scanner for verifying segmentation effectiveness by testing reachability across VLAN boundaries354355## Common Scenarios356357### Scenario: Implementing PCI-DSS Compliant Network Segmentation for Retail358359**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.360361**Approach**:3621. Design VLAN architecture: POS terminals on VLAN 50 (CDE), corporate on VLAN 10, servers on VLAN 20, guest on VLAN 403632. Create VLANs on all access-layer switches and configure access ports by function3643. Configure trunk links between switches with explicit VLAN allowed lists (no "all" trunks)3654. Set native VLAN to 998 (unused) on all trunks and disable DTP on every port3665. 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 CDE3676. Enable DHCP snooping, DAI, and port security on all access ports3687. Verify segmentation with penetration testing from each VLAN, confirming CDE is fully isolated369370**Pitfalls**:371- Leaving DTP enabled on access ports, allowing VLAN hopping to reach the CDE372- Using VLAN 1 as the native VLAN, enabling double-tagging attacks373- Not restricting trunk allowed VLANs, carrying all VLANs including CDE to non-essential switches374- Creating ACLs that allow "any" source to reach CDE servers instead of specific POS terminal IPs375376## Output Format377378```379## Network Segmentation Implementation Report380381**Network**: Retail Store #42382**Switch Platform**: Cisco Catalyst 9300383**VLANs Configured**: 8384385### VLAN Summary386387| VLAN ID | Name | Subnet | Ports | Purpose |388|---------|------|--------|-------|---------|389| 10 | CORPORATE | 10.10.10.0/24 | Gi1/0/1-24 | Employee workstations |390| 20 | SERVERS | 10.10.20.0/24 | Gi1/0/25-36 | Internal servers |391| 30 | DMZ | 10.10.30.0/24 | Gi2/0/1-4 | Internet-facing |392| 40 | GUEST | 10.10.40.0/24 | WiFi AP trunk | Guest WiFi |393| 50 | CDE | 10.10.50.0/24 | Gi2/0/5-12 | POS terminals |394| 100 | MGMT | 10.10.100.0/24 | Gi1/0/48 | Switch management |395| 998 | NATIVE | N/A | Trunks only | Unused native |396| 999 | QUARANTINE | 10.10.99.0/24 | Unused ports | Isolation |397398### Security Hardening Status399400| Control | Status |401|---------|--------|402| DTP Disabled (nonegotiate) | All ports |403| Native VLAN (998) | All trunks |404| DHCP Snooping | VLANs 10,20,40,50 |405| Dynamic ARP Inspection | VLANs 10,20,40,50 |406| Port Security | Access ports |407| BPDU Guard | Access ports |408| Unused Ports Shutdown | 10 ports in VLAN 999 |409| VTP Transparent Mode | Enabled |410```