Skip to content

Instantly share code, notes, and snippets.

@mikaelhg
Created April 15, 2026 15:27
Show Gist options
  • Select an option

  • Save mikaelhg/9f4193ac9c6ff060706a197db545deff to your computer and use it in GitHub Desktop.

Select an option

Save mikaelhg/9f4193ac9c6ff060706a197db545deff to your computer and use it in GitHub Desktop.
Cake DOCSIS
#!/bin/bash
set -e
# Disable WiFi power management to get on the 160 MHz band
iw dev wlp1s0f0 set power_save off || true
# Load congestion control and virtual interface modules
modprobe tcp_bbr || true
modprobe sch_cake || true
modprobe -r ifb || true
modprobe ifb numifbs=1 || true
ip link set dev ifb0 up
sysctl -qp network-tuning.conf 2>/dev/null || true
tc qdisc del dev wlp1s0f0 root 2>/dev/null || true
tc qdisc del dev wlp1s0f0 ingress 2>/dev/null || true
tc qdisc del dev ifb0 root 2>/dev/null || true
tc qdisc add dev wlp1s0f0 root cake \
bandwidth 95mbit \
besteffort \
ack-filter \
wash \
overhead 80 \
rtt 20ms
tc qdisc add dev ifb0 root cake \
bandwidth 550mbit \
triple-isolate \
besteffort \
ingress \
wash \
overhead 80 \
rtt 20ms
# Ingress Hook: Create ingress qdisc on physical device
tc qdisc add dev wlp1s0f0 handle ffff: ingress
# Mirroring: Redirect all incoming traffic from wlp1s0f0 to ifb0 for shaping
tc filter add dev wlp1s0f0 parent ffff: protocol all u32 \
match u32 0 0 action mirred egress redirect dev ifb0
tc qdisc show dev wlp1s0f0
tc qdisc show dev ifb0
net.core.default_qdisc=cake
net.ipv4.tcp_congestion_control=bbr
net.ipv4.tcp_notsent_lowat = 16384
net.ipv4.tcp_fastopen=3
net.ipv4.tcp_mtu_probing=1
net.ipv4.tcp_rmem=4096 87380 67108864
net.ipv4.tcp_wmem=4096 65536 67108864
net.core.rmem_max=67108864
net.core.wmem_max=67108864
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_delack_min=10
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=0
net.core.somaxconn=1024
net.core.netdev_max_backlog=5000
net.ipv4.tcp_sack=1
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_timestamps=1
net.ipv4.ip_local_port_range=10240 65535
net.ipv4.conf.all.arp_filter=1
net.ipv4.conf.all.accept_source_route=0
net.ipv4.conf.all.accept_redirects=0
net.ipv4.conf.all.send_redirects=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment