mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Can choose interface for bypass traffic
This commit is contained in:
parent
9598b30c1a
commit
932cb1fa04
3 changed files with 36 additions and 1 deletions
|
@ -9,6 +9,8 @@
|
||||||
local dpi = uci:get_list("omr-bypass", "dpi", "proto")
|
local dpi = uci:get_list("omr-bypass", "dpi", "proto")
|
||||||
local tmpfile = os.tmpname()
|
local tmpfile = os.tmpname()
|
||||||
local dpi_available_proto = luci.util.execi("cat /proc/net/xt_ndpi/proto | awk '{print $3}' | sort -u | head -n -1")
|
local dpi_available_proto = luci.util.execi("cat /proc/net/xt_ndpi/proto | awk '{print $3}' | sort -u | head -n -1")
|
||||||
|
local ifaces = sys.net:devices()
|
||||||
|
local bypassif = uci:get("omr-bypass","defaults","ifname") or ""
|
||||||
%>
|
%>
|
||||||
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
|
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
|
||||||
<form class="inline" method="post" action="<%=url('admin/services/omr-bypass/add')%>">
|
<form class="inline" method="post" action="<%=url('admin/services/omr-bypass/add')%>">
|
||||||
|
@ -99,7 +101,32 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<div class="cbi-section-descr"><%:Set interface you want to use for bypassed traffic.%></div>
|
||||||
|
<div class="cbi-value">
|
||||||
|
<label class="cbi-value-title">Interface</label>
|
||||||
|
<div class="cbi-value-field">
|
||||||
|
<select class="cbi-input-select" name="interface" size="1">
|
||||||
|
<option value="" <% if iface == bypassif then %>selected="selected"<% end %>><%=iface%></option>
|
||||||
|
<%
|
||||||
|
for _, iface in ipairs(ifaces) do
|
||||||
|
if not (iface == "lo" or iface:match("^ifb.*")) then
|
||||||
|
%>
|
||||||
|
<option value="<%=iface%>" <% if iface == bypassif then %>selected="selected"<% end %>><%=iface%></option>
|
||||||
|
<%
|
||||||
|
end
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
</select>
|
||||||
|
<br />
|
||||||
|
<div class="cbi-value-description">
|
||||||
|
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
|
||||||
|
<%:If empty, multipath master interface is used if up else any other up interface.%>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<div class="cbi-page-actions">
|
<div class="cbi-page-actions">
|
||||||
<input type="hidden" name="token" value="<%=token%>" />
|
<input type="hidden" name="token" value="<%=token%>" />
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
config defaults
|
||||||
|
|
||||||
config bypass 'ips'
|
config bypass 'ips'
|
||||||
|
|
||||||
config bypass 'dpi'
|
config bypass 'dpi'
|
||||||
|
|
|
@ -13,6 +13,12 @@ if [ "$(uci -q get omr-bypass.dpi)" = "" ]; then
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$(uci -q get omr-bypass.default)" = "" ]; then
|
||||||
|
uci -q batch <<-EOF >/dev/null
|
||||||
|
set omr-bypass.defaults=defaults
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$(uci -q get ucitrack.@shadowsocks-libev[-1].affects)" = "" ]; then
|
if [ "$(uci -q get ucitrack.@shadowsocks-libev[-1].affects)" = "" ]; then
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
set ucitrack.@shadowsocks-libev[-1].affects=omr-bypass
|
set ucitrack.@shadowsocks-libev[-1].affects=omr-bypass
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue