Created
September 1, 2017 08:01
-
-
Save recolic/965ff5bded3859d7cac716fe90099d24 to your computer and use it in GitHub Desktop.
One-key enable bbr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
uname -r | grep -E '^4\.(1[^\.]|9)' > /dev/null | |
(( $? == 1 )) && echo 'Linux kernel version must >= 4.9' && exit 1 | |
[[ `whoami` != root ]] && echo 'You must be root' && exit 1 | |
lsmod | grep bbr > /dev/null | |
(( $? == 1 )) && | |
modprobe tcp_bbr && | |
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf | |
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf && | |
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf && | |
sysctl -p | |
sysctl net.ipv4.tcp_available_congestion_control | |
sysctl net.ipv4.tcp_congestion_control | |
sysctl net.ipv4.tcp_congestion_control | grep bbr > /dev/null && echo 'Success.' || echo 'Failed.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment