Turn off tcp timestamps

This commit is contained in:
Bob Mottram 2017-09-22 17:00:40 +01:00
parent 624a6b4f97
commit 980689992a
1 changed files with 9 additions and 0 deletions

View File

@ -290,11 +290,20 @@ function configure_internet_protocol {
sed -i "s|#net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf sed -i "s|#net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf
sed -i "s|net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf sed -i "s|net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf
fi fi
# Randomize kernel
if ! grep -q "kernel.randomize_va_space" /etc/sysctl.conf; then if ! grep -q "kernel.randomize_va_space" /etc/sysctl.conf; then
echo "kernel.randomize_va_space=2" >> /etc/sysctl.conf echo "kernel.randomize_va_space=2" >> /etc/sysctl.conf
else else
sed -i 's|kernel.randomize_va_space.*|kernel.randomize_va_space=2|g' /etc/sysctl.conf sed -i 's|kernel.randomize_va_space.*|kernel.randomize_va_space=2|g' /etc/sysctl.conf
fi fi
# Turn off the tcp_timestamps
if ! grep -q "net.ipv4.tcp_timestamps" /etc/sysctl.conf; then
echo "net.ipv4.tcp_timestamps=0" >> /etc/sysctl.conf
else
sed -i 's|net.ipv4.tcp_timestamps.*|net.ipv4.tcp_timestamps=0|g' /etc/sysctl.conf
fi
mark_completed $FUNCNAME mark_completed $FUNCNAME
} }