Home / Companies / Cloudflare / Blog / Post Details
Content Deep Dive

Abusing Linux's firewall: the hack that allowed us to build Spectrum

Blog post from Cloudflare

Post Details
Company
Date Published
Author
Marek Majkowski
Word Count
1,623
Language
English
Hacker News Points
15
Summary

Cloudflare has introduced Spectrum, a new feature that brings DDoS protection, load balancing, and content acceleration to any TCP-based protocol. The development of Spectrum faced technical challenges due to Linux's limitations in accepting connections on any valid TCP port from 1 to 65535. To overcome these issues, Cloudflare employed the "AnyIP" trick, which allows assigning whole IP prefixes (subnets) to the loopback interface, and utilized TPROXY iptables module for socket dispatch. These solutions enabled Spectrum to operate smoothly on the vanilla kernel without requiring any custom kernel patches.