mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
commit
0be79a72a3
6 changed files with 33 additions and 14 deletions
|
@ -7,7 +7,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
LUCI_TITLE:=Firewall and Portforwarding application
|
LUCI_TITLE:=Firewall and Portforwarding application
|
||||||
LUCI_DEPENDS:=+@LINUX_5_4:firewall +@LINUX_5_15:uci-firewall
|
LUCI_DEPENDS:=+@LINUX_5_4:firewall +@(LINUX_5_15||LINUX_6_1):uci-firewall
|
||||||
|
|
||||||
PKG_LICENSE:=Apache-2.0
|
PKG_LICENSE:=Apache-2.0
|
||||||
PKG_VERSION:=omr-202103
|
PKG_VERSION:=omr-202103
|
||||||
|
|
|
@ -131,31 +131,47 @@ if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||||
|
|
||||||
printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH
|
printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH
|
||||||
else
|
else
|
||||||
ID=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $3}')
|
ID=$(ip mptcp endpoint show | grep -m 1 "dev $DEVICE" | awk '{print $3}')
|
||||||
IFF=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $4}')
|
IFF=$(ip mptcp endpoint show | grep -m 1 "dev $DEVICE" | awk '{print $4}')
|
||||||
IP=$(ip a show $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
|
IP=$(ip a show $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
|
||||||
[ -z "$ID" ] && [ -n "$IP" ] && ID=$(ip mptcp endpoint show | grep "$IP" | awk '{print $3}')
|
[ -z "$ID" ] && [ -n "$IP" ] && ID=$(ip mptcp endpoint show | grep "$IP" | awk '{print $3}')
|
||||||
RMID=$(ip mptcp endpoint show | grep '::ffff' | awk '{ print $3 }')
|
RMID=$(ip mptcp endpoint show | grep '::ffff' | awk '{ print $3 }')
|
||||||
[ -n "$RMID" ] && ip mptcp endpoint delete id $RMID 2>&1 >/dev/null
|
[ -n "$RMID" ] && ip mptcp endpoint delete id $RMID 2>&1 >/dev/null
|
||||||
case $TYPE in
|
case $TYPE in
|
||||||
"off")
|
"off")
|
||||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
[ -n "$ID" ] && {
|
||||||
|
for i in $ID; do
|
||||||
|
ip mptcp endpoint delete id $i 2>&1 >/dev/null
|
||||||
|
done
|
||||||
|
}
|
||||||
exit 0;;
|
exit 0;;
|
||||||
"on")
|
"on")
|
||||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
[ -n "$ID" ] && {
|
||||||
|
for i in $ID; do
|
||||||
|
ip mptcp endpoint delete id $i 2>&1 >/dev/null
|
||||||
|
done
|
||||||
|
}
|
||||||
for i in $IP; do
|
for i in $IP; do
|
||||||
ip mptcp endpoint add $i dev $DEVICE subflow fullmesh
|
ip mptcp endpoint add $i dev $DEVICE subflow fullmesh
|
||||||
done
|
done
|
||||||
exit 0;;
|
exit 0;;
|
||||||
"signal")
|
"signal")
|
||||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
[ -n "$ID" ] && {
|
||||||
|
for i in $ID; do
|
||||||
|
ip mptcp endpoint delete id $i 2>&1 >/dev/null
|
||||||
|
done
|
||||||
|
}
|
||||||
for i in $IP; do
|
for i in $IP; do
|
||||||
#ip mptcp endpoint add $i dev $DEVICE signal subflow fullmesh
|
#ip mptcp endpoint add $i dev $DEVICE signal subflow fullmesh
|
||||||
ip mptcp endpoint add $i dev $DEVICE signal
|
ip mptcp endpoint add $i dev $DEVICE signal
|
||||||
done
|
done
|
||||||
exit 0;;
|
exit 0;;
|
||||||
"backup")
|
"backup")
|
||||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
[ -n "$ID" ] && {
|
||||||
|
for i in $ID; do
|
||||||
|
ip mptcp endpoint delete id $i 2>&1 >/dev/null
|
||||||
|
done
|
||||||
|
}
|
||||||
for i in $IP; do
|
for i in $IP; do
|
||||||
ip mptcp endpoint add $i dev $DEVICE backup fullmesh
|
ip mptcp endpoint add $i dev $DEVICE backup fullmesh
|
||||||
done
|
done
|
||||||
|
|
|
@ -25,7 +25,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||||
define Package/$(PKG_NAME)
|
define Package/$(PKG_NAME)
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
CATEGORY:=Network
|
CATEGORY:=Network
|
||||||
DEPENDS:=+libell @LINUX_5_15
|
DEPENDS:=+libell @(LINUX_5_15||LINUX_6_1)
|
||||||
TITLE:=mptcpd
|
TITLE:=mptcpd
|
||||||
URL:=https://github.com/intel/mptcpd
|
URL:=https://github.com/intel/mptcpd
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -21,7 +21,7 @@ MY_DEPENDS := \
|
||||||
mc \
|
mc \
|
||||||
f2fs-tools \
|
f2fs-tools \
|
||||||
openmptcprouter \
|
openmptcprouter \
|
||||||
dnsmasq-full \
|
dnsmasq-full dnsmasq_full_ipset \
|
||||||
uhttpd \
|
uhttpd \
|
||||||
uhttpd-mod-ubus \
|
uhttpd-mod-ubus \
|
||||||
curl \
|
curl \
|
||||||
|
@ -82,7 +82,7 @@ MY_DEPENDS := \
|
||||||
luci-app-acl block-mount blockd fstools luci-app-shutdown libwebp luci-proto-gre tcptraceroute luci-proto-mbim kmod-rtl8xxxu kmod-ath9k-htc luci-app-ttyd luci-mod-dashboard (TARGET_x86||TARGET_x86_64):rtl8192eu-firmware kmod-usb2 libustream-openssl (TARGET_x86||TARGET_x86_64):kmod-ixgbevf (TARGET_x86||TARGET_x86_64):kmod-igbvf \
|
luci-app-acl block-mount blockd fstools luci-app-shutdown libwebp luci-proto-gre tcptraceroute luci-proto-mbim kmod-rtl8xxxu kmod-ath9k-htc luci-app-ttyd luci-mod-dashboard (TARGET_x86||TARGET_x86_64):rtl8192eu-firmware kmod-usb2 libustream-openssl (TARGET_x86||TARGET_x86_64):kmod-ixgbevf (TARGET_x86||TARGET_x86_64):kmod-igbvf \
|
||||||
hwinfo (TARGET_x86||TARGET_x86_64):dmidecode luci-app-packet-capture kmod-bonding luci-proto-bonding luci-app-sysupgrade \
|
hwinfo (TARGET_x86||TARGET_x86_64):dmidecode luci-app-packet-capture kmod-bonding luci-proto-bonding luci-app-sysupgrade \
|
||||||
luci-theme-openwrt-2020 luci-proto-wireguard luci-app-wireguard kmod-crypto-lib-blake2s (TARGET_x86||TARGET_x86_64):kmod-r8125 TARGET_x86_64:kmod-atlantic \
|
luci-theme-openwrt-2020 luci-proto-wireguard luci-app-wireguard kmod-crypto-lib-blake2s (TARGET_x86||TARGET_x86_64):kmod-r8125 TARGET_x86_64:kmod-atlantic \
|
||||||
LINUX_5_15:mptcpd (TARGET_x86||TARGET_x86_64):kmod-igc kmod-mmc-spi kmod-macsec usbutils
|
(LINUX_5_15||LINUX_6_1):mptcpd (TARGET_x86||TARGET_x86_64):kmod-igc kmod-mmc-spi kmod-macsec usbutils
|
||||||
# !TARGET_mvebu:kmod-usb-net-smsc75xx
|
# !TARGET_mvebu:kmod-usb-net-smsc75xx
|
||||||
# libnetfilter-conntrack ebtables ebtables-utils ip-full nstat \
|
# libnetfilter-conntrack ebtables ebtables-utils ip-full nstat \
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ _setup_fw() {
|
||||||
[ -n "$ifnames" ] && rule="$rule -i $(echo "${ifnames}" | sed 's/ /-i /g')"
|
[ -n "$ifnames" ] && rule="$rule -i $(echo "${ifnames}" | sed 's/ /-i /g')"
|
||||||
if [ -n "$rule" ] && [ -n "$lookup" ]; then
|
if [ -n "$rule" ] && [ -n "$lookup" ]; then
|
||||||
$IPTABLESAVE --counters | grep -v "0x${lookup}" | $IPTABLERESTORE -w --counters
|
$IPTABLESAVE --counters | grep -v "0x${lookup}" | $IPTABLERESTORE -w --counters
|
||||||
$IPTABLERESTORE --wait=60 --noflush <<-EOF
|
$IPTABLERESTORE --noflush <<-EOF
|
||||||
*mangle
|
*mangle
|
||||||
-A omr-gre-tunnel ${rule} -j MARK --set-mark 0x${lookup}
|
-A omr-gre-tunnel ${rule} -j MARK --set-mark 0x${lookup}
|
||||||
COMMIT
|
COMMIT
|
||||||
|
@ -48,7 +48,7 @@ _setup_fw() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$($IPTABLESAVE | grep omr-gre-tunnel)" ]; then
|
if [ -z "$($IPTABLESAVE | grep omr-gre-tunnel)" ]; then
|
||||||
$IPTABLERESTORE --wait=60 --noflush <<-EOF
|
$IPTABLERESTORE --noflush <<-EOF
|
||||||
*mangle
|
*mangle
|
||||||
:omr-gre-tunnel -
|
:omr-gre-tunnel -
|
||||||
-I PREROUTING 1 -m addrtype ! --dst-type LOCAL -j omr-gre-tunnel
|
-I PREROUTING 1 -m addrtype ! --dst-type LOCAL -j omr-gre-tunnel
|
||||||
|
|
|
@ -236,9 +236,12 @@ for intf in $allintf; do
|
||||||
uci -q add_list firewall.zone_vpn.network="${intf}"
|
uci -q add_list firewall.zone_vpn.network="${intf}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
#uci -q batch <<-EOF >/dev/null
|
||||||
|
# set firewall.zone_lan.mtu_fix='1'
|
||||||
|
# set firewall.zone_vpn.mtu_fix='1'
|
||||||
|
#EOF
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
set firewall.zone_lan.mtu_fix='1'
|
|
||||||
set firewall.zone_vpn.mtu_fix='1'
|
|
||||||
set firewall.@include[0].reload='1'
|
set firewall.@include[0].reload='1'
|
||||||
commit firewall
|
commit firewall
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue