Skip to content

Instantly share code, notes, and snippets.

@hakuno
Last active June 4, 2020 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakuno/c820364ec86619031867c9e907248023 to your computer and use it in GitHub Desktop.
Save hakuno/c820364ec86619031867c9e907248023 to your computer and use it in GitHub Desktop.
Make sure iptables and conntrack don't interfere with our traffic
Example
client$ iptables -I INPUT 1 --src 192.168.254.0/24 -j ACCEPT
client$ iptables -t raw -I PREROUTING 1 --src 192.168.254.0/24 -j NOTRACK
server$ iptables -I INPUT 1 --src 192.168.254.0/24 -j ACCEPT
server$ iptables -t raw -I PREROUTING 1 --src 192.168.254.0/24 -j NOTRACK
Example
receiver$ iptables -I INPUT 1 -p udp --dport 4321 -j ACCEPT
receiver$ iptables -t raw -I PREROUTING 1 -p udp --dport 4321 -j NOTRACK
Example
iptables -t raw -I PREROUTING -d 198.18.0.12 -p udp -m udp --dport 1234 -j NOTRACK
Sources
https://blog.cloudflare.com/how-to-drop-10-million-packets/
https://blog.cloudflare.com/how-to-achieve-low-latency/
https://blog.cloudflare.com/how-to-receive-a-million-packets/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment