1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 02:51:50 +00:00

Add syn retries parameters and fixes

This commit is contained in:
Ycarus 2018-12-23 14:14:28 +01:00
parent 975fd9942a
commit 9c5b7130e5
4 changed files with 15 additions and 3 deletions

View file

@ -463,6 +463,11 @@ function settings_add()
local tcp_fin_timeout = luci.http.formvalue("tcp_fin_timeout")
luci.sys.exec("sysctl -w net.ipv4.tcp_fin_timeout=%s" % tcp_fin_timeout)
luci.sys.exec("sed -i 's:^net.ipv4.tcp_fin_timeout=[0-9]*:net.ipv4.tcp_fin_timeout=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % tcp_fin_timeout)
-- Set tcp_syn_retries
local tcp_syn_retries = luci.http.formvalue("tcp_syn_retries")
luci.sys.exec("sysctl -w net.ipv4.tcp_syn_retries=%s" % tcp_syn_retries)
luci.sys.exec("sed -i 's:^net.ipv4.tcp_syn_retries=[0-9]*:net.ipv4.tcp_syn_retries=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % tcp_syn_retries)
-- Disable IPv6
local disable_ipv6 = luci.http.formvalue("disable_ipv6") or 0

View file

@ -82,6 +82,12 @@
<input type="text" name="tcp_fin_timeout" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_fin_timeout")):match(" %d+"))%>">
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:IPv4 TCP SYN retries%></label>
<div class="cbi-value-field">
<input type="text" name="tcp_syn_retries" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_syn_retries")):match(" %d+"))%>">
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Disable IPv6%></label>
<div class="cbi-value-field">

View file

@ -78,8 +78,8 @@ start_service() {
set_ipv6_state $disable_ipv6
fi
# 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
sed -i -e '/tcp_fin_timeout/d' -e '/tcp_keepalive_time/d' -e '/nf_conntrack_max/d' -e '/tcp_syn_retries/d' /etc/sysctl.conf
sed -i -e '/tcp_fin_timeout/d' -e '/tcp_keepalive_time/d' -e '/nf_conntrack_max/d' -e '/tcp_syn_retries/d' /etc/sysctl.d/10-default.conf
}
reload_service() {

View file

@ -1,3 +1,4 @@
net.ipv4.tcp_keepalive_time=7200
net.ipv6.conf.all.disable_ipv6=0
net.ipv4.tcp_fin_timeout=40
net.ipv4.tcp_fin_timeout=40
net.ipv4.tcp_syn_retries=3