1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge branch 'develop' into master

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-10-28 15:43:08 +01:00
commit c75e0a207a
6 changed files with 60 additions and 14 deletions

View file

@ -80,6 +80,9 @@ start_instance() {
procd_close_instance
tc qdisc replace dev ${dev} root cake
#ip link set $dev txqlen 100
#config_load network
#config_foreach add_glorytun_path interface

View file

@ -93,7 +93,7 @@ function wizard_add()
ucic:foreach("network", "interface", function(s)
local sectionname = s[".name"]
if sectionname:match("^wan(%d+)$") then
i = i + 1
i = tonumber(string.match(sectionname, '(%d+)$')) + 1
end
if ucic:get("network",sectionname,"multipath") == "master" then
multipath_master = true

View file

@ -4,7 +4,6 @@ START=88
SERVICE_DAEMONIZE=1
#SERVICE_SIG="KILL"
interface_multipath_settings() {
local mode port
local config="$1"
@ -71,3 +70,8 @@ start() {
stop() {
service_stop /usr/sbin/mlvpn
}
reload() {
stop
start
}

View file

@ -46,25 +46,39 @@ interface_macaddr_count() {
[ "$macaddr" = "$dmacaddr" ] && nbmac=$((nbmac+1))
}
interface_max_metric() {
local config="$1"
config_get metric "$config" metric
if [ "$metric" = "$count" ]; then
count=$((count+1))
config_set "$config" metric $count
fi
if [ "$metric" -gt "$count" ]; then
count=$metric
fi
}
interface_multipath_settings() {
local mode iface proto
local mode iface proto metric
local config="$1"
local intf="$2"
local enabled
config_get enabled "$config" auto "1"
config_get iface "$config" ifname
config_get txqueuelen "$config" txqueuelen
[ -z "$iface" ] && iface=$(ifstatus "$config" | jsonfilter -q -e '@["l3_device"]')
if [ "$(uci -q get openmptcprouter.${config}.metric)" = "" ]; then
count=$(($count+1))
count=$((count+1))
metric=$count
else
count="$(uci -q get openmptcprouter.${config}.metric)"
metric="$(uci -q get openmptcprouter.${config}.metric)"
fi
config_set "$config" metric $count
uci -q set network.${config}.metric=$count
uci -q set openmptcprouter.${config}.metric=$count
config_set "$config" metric $metric
uci -q set network.${config}.metric=$metric
uci -q set openmptcprouter.${config}.metric=$metric
config_get mode "$config" multipath
id=$count
id=$metric
[ "$mode" = "" ] && {
mode="$(uci -q get openmptcprouter.${config}.multipath)"
[ -n "$mode" ] && uci -q set network.${config}.multipath="$mode"
@ -221,11 +235,11 @@ interface_multipath_settings() {
#echo "ip route replace default via $gateway dev $iface"
ip route replace default via $gateway dev $iface
}
[ "$mode" = "off" ] && {
ifconfig $iface txqueuelen 50 > /dev/null 2>&1
} || {
if [ "$txqueuelen" != "" ]; then
ifconfig $iface txqueuelen $txqueuelen > /dev/null 2>&1
else
ifconfig $iface txqueuelen 100 > /dev/null 2>&1
}
fi
fi
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" != "1" ] && [ "$config" != "omr6in4" ]; then
# IPv6 Updates:
@ -398,6 +412,10 @@ start_service() {
mptcpintf=""
master=""
count="0"
config_load openmptcprouter
config_foreach interface_max_metric interface
config_load network
#config_foreach remove route
#config_foreach remove route6

View file

@ -668,6 +668,7 @@ _set_vpn_ip() {
vpnip_remote=$(ip -4 r list dev ${vpnifname} | grep via | grep -v default | grep -v / | grep -v metric | awk '{print $1}' | tr -d "\n")
[ -z "$vpnip_remote" ] && vpnip_remote=$(ip -4 r list dev ${vpnifname} | grep kernel | awk '{print $1}' | tr -d "\n")
[ -z "$vpnip_remote" ] && vpnip_remote=$(ip -4 r list dev ${vpnifname} | grep "proto static src" | awk '{print $3}' | tr -d "\n")
[ -z "$vpnip_remote" ] && vpnip_remote=$(ifstatus omrvpn | jsonfilter -e '@.route[0].nexthop')
ula="$(uci -q get network.globals.ula_prefix)"
ula_current="$(echo "$vps_config" | jsonfilter -q -e '@.ip6in4.ula')"
if [ "$vpnip_remote" != "" ] && [ "$vpnip_local" != "" ] && ([ "$vpnip_remote" != "$vpnip_remote_current" ] || [ "$vpnip_local" != "$vpnip_local_current" ] || [ "$ula" != "$ula_current" ]); then
@ -724,7 +725,7 @@ _vps_firewall_redirect_port() {
#uci -q delete firewall.$1
#return
fi
[ "$(v2ray.main.enabled)" = "0" ] && v2ray="0"
[ "$(uci -q get v2ray.main.enabled)" = "0" ] && v2ray="0"
[ "$proto" = "all" ] && proto="tcp udp"
[ "$proto" = "" ] && proto="tcp udp"
[ "$src" = "vpn" ] && [ -n "$proto" ] && [ -n "$src_dport" ] && [ "$enabled" != "0" ] && {

View file

@ -131,6 +131,26 @@ if [ "$(uci -q get firewall.fwlantovpn)" = "" ]; then
commit firewall
EOF
fi
if [ "$(uci -q get firewall.blockquicproxy)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set firewall.blockquicproxy=rule
set firewall.blockquicproxy.name='Block QUIC Proxy'
set firewall.blockquicproxy.proto='udp'
set firewall.blockquicproxy.dest_port='443'
set firewall.blockquicproxy.target='DROP'
set firewall.blockquicproxy.src='lan'
set firewall.blockquicall=rule
set firewall.blockquicall.name='Block QUIC All'
set firewall.blockquicall.proto='udp'
set firewall.blockquicall.src='*'
set firewall.blockquicall.dest='*'
set firewall.blockquicall.dest_port='443'
set firewall.blockquicall.target='DROP'
commit firewall
EOF
fi
uci -q batch <<-EOF >/dev/null
set firewall.@zone[0].mtu_fix='1'
set firewall.zone_vpn.mtu_fix='1'