mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
sysctl retries1 and retries2 are customizable via the interface
This commit is contained in:
parent
c98d1ad183
commit
e9b6a9759d
4 changed files with 46 additions and 3 deletions
|
@ -741,6 +741,16 @@ function settings_add()
|
|||
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)
|
||||
|
||||
-- Set tcp_retries1
|
||||
local tcp_retries1 = luci.http.formvalue("tcp_retries1")
|
||||
luci.sys.exec("sysctl -w net.ipv4.tcp_retries1=%s" % tcp_retries1)
|
||||
luci.sys.exec("sed -i 's:^net.ipv4.tcp_retries1=[0-9]*:net.ipv4.tcp_retries1=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % tcp_retries1)
|
||||
|
||||
-- Set tcp_retries2
|
||||
local tcp_retries2 = luci.http.formvalue("tcp_retries2")
|
||||
luci.sys.exec("sysctl -w net.ipv4.tcp_retries2=%s" % tcp_retries2)
|
||||
luci.sys.exec("sed -i 's:^net.ipv4.tcp_retries2=[0-9]*:net.ipv4.tcp_retries2=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % tcp_retries2)
|
||||
|
||||
--local tcp_retries2 = luci.http.formvalue("tcp_retries2")
|
||||
--luci.sys.exec("sysctl -w net.ipv4.tcp_retries2=%s" % tcp_retries2)
|
||||
--luci.sys.exec("sed -i 's:^net.ipv4.tcp_retries2=[0-9]*:net.ipv4.tcp_retries2=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % tcp_retries2)
|
||||
|
|
|
@ -118,18 +118,50 @@
|
|||
<label class="cbi-value-title"><%:IPv4 TCP Keepalive time%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" name="tcp_keepalive_time" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_keepalive_time")):match(" %d+"))%>">
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:How often TCP sends out keepalive messages when keepalive is enabled.%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:IPv4 TCP FIN timeout%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" name="tcp_fin_timeout" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_fin_timeout")):match(" %d+"))%>">
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:The length of time an orphaned (no longer referenced by any application) connection will remain in the FIN_WAIT_2 state before it is aborted at the local end.%>
|
||||
</div>
|
||||
</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+"))%>">
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:Number of times initial SYNs for an active TCP connection attempt will be retransmitted.%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:IPv4 TCP SYN retries1%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" name="tcp_retries1" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_retries1")):match(" %d+"))%>">
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:This value influences the time, after which TCP decides, that something is wrong due to unacknowledged RTO retransmissions, and reports this suspicion to the network layer.%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:IPv4 TCP SYN retries2%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" name="tcp_retries2" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("sysctl net.ipv4.tcp_retries2")):match(" %d+"))%>">
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:This value influences the timeout of an alive TCP connection, when RTO retransmissions remain unacknowledged.%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
|
|
|
@ -83,8 +83,8 @@ 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' -e '/tcp_syn_retries/d' -e '/tcp_fastopen/d' -e '/tcp_retries2/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' -e '/tcp_fastopen/d' -e '/tcp_retries2/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' -e '/tcp_fastopen/d' -e '/tcp_retries2/d' -e '/tcp_retries1/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' -e '/tcp_fastopen/d' -e '/tcp_retries2/d' -e '/tcp_retries1/d' /etc/sysctl.d/10-default.conf
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
|
|
@ -2,6 +2,7 @@ net.ipv4.tcp_keepalive_time=7200
|
|||
net.ipv6.conf.all.disable_ipv6=0
|
||||
net.ipv4.tcp_fin_timeout=60
|
||||
net.ipv4.tcp_syn_retries=3
|
||||
net.ipv4.tcp_retries2=3
|
||||
net.ipv4.tcp_retries1=3
|
||||
net.ipv4.tcp_retries2=15
|
||||
net.ipv4.tcp_fastopen=3
|
||||
net.ipv4.tcp_low_latency=1
|
||||
|
|
Loading…
Reference in a new issue