From a0c21d570e5adc3cc704c320c3a8a2ddf09f9ddb Mon Sep 17 00:00:00 2001 From: Ycarus Date: Thu, 14 Jun 2018 22:39:42 +0200 Subject: [PATCH] Fix tcp keepalive change --- .../luasrc/controller/openmptcprouter.lua | 6 ++++-- luci-app-openmptcprouter/root/etc/init.d/openmptcprouter | 1 + .../root/etc/sysctl.d/zzz_openmptcprouter.conf | 2 +- shadowsocks-libev/files/shadowsocks-libev.init | 5 +++++ shadowsocks-libev/files/shadowsocks.conf | 4 ++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index ab2f83701..682135a58 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -188,8 +188,10 @@ function wizard_add() end luci.sys.call("(env -i /bin/ubus call network reload) >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/glorytun restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/mlvpn restart >/dev/null 2>/dev/null") + --luci.sys.call("/etc/init.d/shadowsocks restart >/dev/null 2>/dev/null") + --luci.sys.call("/etc/init.d/glorytun restart >/dev/null 2>/dev/null") + --luci.sys.call("/etc/init.d/glorytun-udp restart >/dev/null 2>/dev/null") + --luci.sys.call("/etc/init.d/mlvpn restart >/dev/null 2>/dev/null") if gostatus == true then luci.http.redirect(luci.dispatcher.build_url("admin/system/openmptcprouter/status")) else diff --git a/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter b/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter index 8a8ee9980..3c195bbcd 100755 --- a/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter +++ b/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter @@ -27,6 +27,7 @@ start_service() { } # remove sysctl already defined in /etc/sysctl.d/ sed -i -e '/tcp_fin_timeout/d' -e '/tcp_keepalive_time/d' -e '/nf_conntrack_max/d' /etc/sysctl.conf + sed -i -e '/tcp_fin_timeout/d' -e '/tcp_keepalive_time/d' -e '/nf_conntrack_max/d' /etc/sysctl.d/10-default.conf } reload_service() { diff --git a/luci-app-openmptcprouter/root/etc/sysctl.d/zzz_openmptcprouter.conf b/luci-app-openmptcprouter/root/etc/sysctl.d/zzz_openmptcprouter.conf index e8a345cee..510841c4f 100644 --- a/luci-app-openmptcprouter/root/etc/sysctl.d/zzz_openmptcprouter.conf +++ b/luci-app-openmptcprouter/root/etc/sysctl.d/zzz_openmptcprouter.conf @@ -1,2 +1,2 @@ -net.ipv4.tcp_keepalive_time=1200 +net.ipv4.tcp_keepalive_time=2400 net.ipv6.conf.all.disable_ipv6=0 \ No newline at end of file diff --git a/shadowsocks-libev/files/shadowsocks-libev.init b/shadowsocks-libev/files/shadowsocks-libev.init index 4734f37d5..e03cb4cdf 100644 --- a/shadowsocks-libev/files/shadowsocks-libev.init +++ b/shadowsocks-libev/files/shadowsocks-libev.init @@ -317,6 +317,11 @@ stop_service() { rm -rf "$ss_confdir" } +reload_service() { + stop + start +} + _rules_status() { [ -n "$(iptables -t nat -L | grep ss_rules_forward)" ] && return 1 return 0 diff --git a/shadowsocks-libev/files/shadowsocks.conf b/shadowsocks-libev/files/shadowsocks.conf index 4e9a29dad..c901598ac 100644 --- a/shadowsocks-libev/files/shadowsocks.conf +++ b/shadowsocks-libev/files/shadowsocks.conf @@ -23,7 +23,7 @@ net.ipv4.tcp_tw_recycle = 0 # short FIN timeout net.ipv4.tcp_fin_timeout = 30 # short keepalive time -net.ipv4.tcp_keepalive_time = 2400 +#net.ipv4.tcp_keepalive_time = 2400 # outbound port range net.ipv4.ip_local_port_range = 10000 65000 # max SYN backlog @@ -37,7 +37,7 @@ net.ipv4.tcp_rmem = 4096 87380 134217728 # TCP write buffer net.ipv4.tcp_wmem = 4096 65536 134217728 # turn on path MTU discovery -net.ipv4.tcp_mtu_probing = 0 +net.ipv4.tcp_mtu_probing = 1 # for low-latency network, use cubic instead # net.ipv4.tcp_congestion_control = balia