Home » DHCP Architecture: DHCP Relay, Failover, Option 82, Snooping, Starvation Attack และ IPv6 DHCPv6
DHCP Architecture: DHCP Relay, Failover, Option 82, Snooping, Starvation Attack และ IPv6 DHCPv6
DHCP Architecture: DHCP Relay, Failover, Option 82, Snooping, Starvation Attack และ IPv6 DHCPv6
DHCP (Dynamic Host Configuration Protocol) จัดสรร IP addresses อัตโนมัติให้ devices บน network DHCP Relay ส่ง DHCP requests ข้าม subnets, Failover ให้ redundancy สำหรับ DHCP service, Option 82 เพิ่ม information เกี่ยวกับ location ของ client, DHCP Snooping ป้องกัน rogue DHCP servers, Starvation Attack เป็น DoS attack ที่ exhaust DHCP pool และ DHCPv6 ให้ address assignment สำหรับ IPv6
DHCP ดูเหมือน simple protocol แต่เป็นจุดอ่อนที่ถูกโจมตีบ่อย: rogue DHCP server แจก wrong gateway → redirect traffic ทั้งหมด (man-in-the-middle), DHCP starvation exhaust ทุก IP → legitimate users ไม่ได้ IP, DHCP scope exhaustion จาก IoT devices ที่เพิ่มขึ้นเร็ว ทุกปัญหาต้องการ proper DHCP architecture: snooping, relay, failover, monitoring
DHCP Process (DORA)
| Step |
Message |
Direction |
Description |
| 1 |
Discover |
Client → Broadcast |
Client ส่ง broadcast หา DHCP server (ยังไม่มี IP) |
| 2 |
Offer |
Server → Client |
Server เสนอ IP address + options (gateway, DNS, lease time) |
| 3 |
Request |
Client → Broadcast |
Client ตอบรับ offer (broadcast เพื่อแจ้ง DHCP servers อื่น) |
| 4 |
Acknowledge |
Server → Client |
Server ยืนยัน → client ได้ IP address + start lease timer |
DHCP Relay (IP Helper)
| Feature |
รายละเอียด |
| Problem |
DHCP Discover เป็น broadcast → ไม่ข้าม router/L3 switch (broadcast domain boundary) |
| Solution |
DHCP Relay Agent บน router/L3 switch: รับ broadcast → convert เป็น unicast → forward ไป DHCP server |
| Config |
ip helper-address [DHCP server IP] — configure บน SVI หรือ interface ของแต่ละ VLAN |
| Multiple Servers |
ใส่ helper-address หลาย servers → relay forward ไปทุก server (redundancy) |
| giaddr |
Relay agent ใส่ interface IP ใน giaddr field → server รู้ว่า client อยู่ subnet ไหน → จัดสรร IP ถูก scope |
DHCP Failover
| Model |
How |
Use Case |
| Split Scope (50/50) |
แบ่ง DHCP scope: Server A จัดสรร 50%, Server B จัดสรร 50% |
Simple redundancy — ทั้ง 2 servers active |
| Split Scope (80/20) |
Primary server จัดสรร 80%, secondary 20% — primary preferred |
Primary-secondary model — ลด IP waste |
| Hot Standby |
Primary active, secondary standby → failover เมื่อ primary down |
Windows DHCP failover (hot standby mode) |
| Load Balance |
Both servers active, share requests based on MAC hash |
Windows DHCP failover (load balance mode) |
| Kea HA |
ISC Kea: hot-standby หรือ load-balancing with lease sync |
Linux DHCP (ISC Kea replaces ISC dhcpd) |
DHCP Option 82
| Feature |
รายละเอียด |
| คืออะไร |
DHCP Relay Agent Information Option — เพิ่ม info เกี่ยวกับ physical location ของ client |
| Circuit ID |
ระบุ physical port ที่ client เชื่อมต่อ (switch name + port number) |
| Remote ID |
ระบุ relay agent (switch MAC หรือ hostname) |
| Use Case |
ISP: assign IP based on physical port (apartment building, hotel room) |
| Policy |
DHCP server ใช้ Option 82 data เพื่อ assign specific IP range per port/location |
DHCP Snooping
| Feature |
รายละเอียด |
| คืออะไร |
Layer 2 security feature ที่ filter DHCP messages เพื่อป้องกัน rogue DHCP servers |
| Trusted Ports |
Ports ที่เชื่อม DHCP server หรือ uplinks — allow DHCP Offer/ACK |
| Untrusted Ports |
Access ports (end devices) — drop DHCP Offer/ACK จาก untrusted port |
| Binding Table |
สร้าง table: MAC ↔ IP ↔ VLAN ↔ Port — ใช้กับ DAI และ IP Source Guard |
| Rate Limiting |
Limit DHCP packets per second per port → ป้องกัน DHCP starvation attack |
| DAI Integration |
Dynamic ARP Inspection ใช้ DHCP snooping binding table เพื่อ validate ARP |
DHCP Attacks
| Attack |
How |
Prevention |
| Rogue DHCP |
Attacker runs DHCP server → แจก wrong gateway/DNS → MITM |
DHCP Snooping (untrusted ports drop DHCP Offer) |
| DHCP Starvation |
Flood DHCP Discover ด้วย random MACs → exhaust all IPs in pool |
Port security (limit MACs) + DHCP snooping rate limit |
| DHCP Spoofing |
Spoof DHCP Release สำหรับ victim → victim loses IP |
DHCP snooping validates source MAC/IP |
DHCPv6 vs SLAAC
| Feature |
SLAAC |
Stateless DHCPv6 |
Stateful DHCPv6 |
| Address |
Auto-generate from prefix + EUI-64/random |
SLAAC (auto) |
DHCPv6 server assigns |
| DNS |
RDNSS (Router Advertisement) |
DHCPv6 provides DNS |
DHCPv6 provides DNS |
| Gateway |
Router Advertisement |
Router Advertisement |
Router Advertisement |
| Tracking |
ไม่มี central record |
ไม่มี (stateless) |
Server tracks assignments (like DHCPv4) |
| RA Flags |
M=0, O=0 |
M=0, O=1 |
M=1, O=1 |
| Use Case |
Simple networks, IoT |
Need DNS from DHCP server |
Need tracking, specific IP assignments |
ทิ้งท้าย: DHCP = Simple Protocol, Complex Architecture
DHCP Architecture DORA: Discover → Offer → Request → Acknowledge (broadcast → unicast assignment) Relay: ip helper-address forwards DHCP across subnets — giaddr tells server which scope Failover: split scope (50/50 or 80/20), hot standby, load balance — ensure DHCP availability Option 82: circuit ID (port) + remote ID (switch) — location-based IP assignment (ISP, hotels) Snooping: trusted/untrusted ports, drop rogue DHCP offers, binding table, rate limiting Attacks: rogue DHCP (MITM), starvation (exhaust pool), spoofing (release victim IP) — snooping prevents all DHCPv6: SLAAC (auto, simple), stateless DHCPv6 (+ DNS), stateful DHCPv6 (full tracking like DHCPv4) Key: DHCP snooping is mandatory on every access switch — it enables DAI and IP Source Guard too
อ่านเพิ่มเติมเกี่ยวกับ IPv6 Migration Dual-Stack NAT64 DNS64 และ Network Access Control 802.1X NAC RADIUS ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com