mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
Glorytun UDP support and fix 6in4
This commit is contained in:
parent
e11e60bc5d
commit
af8dc743c2
8 changed files with 22 additions and 15 deletions
|
@ -10,7 +10,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=6in4
|
PKG_NAME:=6in4
|
||||||
PKG_VERSION:=27
|
PKG_VERSION:=270
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,11 @@ start_service() {
|
||||||
config_foreach start_instance glorytun
|
config_foreach start_instance glorytun
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reload_service() {
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
service_triggers() {
|
service_triggers() {
|
||||||
procd_add_reload_trigger glorytun network
|
procd_add_reload_trigger glorytun network
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,15 +15,20 @@ uci -q batch <<-EOF >/dev/null
|
||||||
delete network.glorytun=interface
|
delete network.glorytun=interface
|
||||||
set network.glorytun=interface
|
set network.glorytun=interface
|
||||||
set network.glorytun.ifname=tun0
|
set network.glorytun.ifname=tun0
|
||||||
set network.glorytun.proto=static
|
# set network.glorytun.proto=static
|
||||||
set network.glorytun.ipaddr=10.0.0.2
|
# set network.glorytun.ipaddr=10.0.0.2
|
||||||
set network.glorytun.netmask=255.255.255.0
|
# set network.glorytun.netmask=255.255.255.0
|
||||||
set network.glorytun.gateway=10.0.0.1
|
# set network.glorytun.gateway=10.0.0.1
|
||||||
set network.glorytun.ip4table=vpn
|
set network.glorytun.ip4table=vpn
|
||||||
set network.glorytun.multipath=off
|
set network.glorytun.multipath=off
|
||||||
set network.glorytun.leasetime=12h
|
set network.glorytun.leasetime=12h
|
||||||
commit network
|
commit network
|
||||||
EOF
|
EOF
|
||||||
|
# set network.glorytun.proto=static
|
||||||
|
# set network.glorytun.ipaddr=10.0.0.2
|
||||||
|
# set network.glorytun.netmask=255.255.255.0
|
||||||
|
# set network.glorytun.gateway=10.0.0.1
|
||||||
|
|
||||||
if [ "$(uci -q show firewall | grep vpn)" = "" ]; then
|
if [ "$(uci -q show firewall | grep vpn)" = "" ]; then
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
add firewall zone
|
add firewall zone
|
||||||
|
|
|
@ -113,7 +113,8 @@ if [ "$multipath_config" = "master" ]; then
|
||||||
fi
|
fi
|
||||||
multipath_config="on"
|
multipath_config="on"
|
||||||
fi
|
fi
|
||||||
|
[ "$multipath_config" = "on" ] && glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 up > /dev/null 2>&1
|
||||||
|
[ "$multipath_config" = "backup" ] && glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 backup > /dev/null 2>&1
|
||||||
[ "$multipath_status" = "$multipath_config" ] && exit 0
|
[ "$multipath_status" = "$multipath_config" ] && exit 0
|
||||||
_log "Multipath $OMR_TRACKER_DEVICE switched to $multipath_config"
|
_log "Multipath $OMR_TRACKER_DEVICE switched to $multipath_config"
|
||||||
multipath "$OMR_TRACKER_DEVICE" "$multipath_config"
|
multipath "$OMR_TRACKER_DEVICE" "$multipath_config"
|
||||||
glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 up > /dev/null 2>&1
|
|
||||||
|
|
|
@ -8,18 +8,14 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=omr-6in4
|
PKG_NAME:=omr-6in4
|
||||||
PKG_VERSION:=0.1
|
PKG_VERSION:=0.2
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
MY_DEPENDS := \
|
|
||||||
6in4
|
|
||||||
|
|
||||||
define Package/$(PKG_NAME)
|
define Package/$(PKG_NAME)
|
||||||
SECTION:=OMR
|
SECTION:=OMR
|
||||||
CATEGORY:=OpenMPTCProuter
|
CATEGORY:=OpenMPTCProuter
|
||||||
DEPENDS:=$(foreach p,$(MY_DEPENDS),+$(p))
|
|
||||||
TITLE:=OpenMPTCProuter 6in4
|
TITLE:=OpenMPTCProuter 6in4
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ reload_service() {
|
||||||
iface=$(uci -q get glorytun.vpn.dev)
|
iface=$(uci -q get glorytun.vpn.dev)
|
||||||
[ -z "$iface" ] && exit 0
|
[ -z "$iface" ] && exit 0
|
||||||
addr=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
addr=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
||||||
peer=$(ip -4 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n")
|
peer=$(ip -4 r list dev $iface | grep kernel | awk '/proto kernel/ {print $1}' | tr -d "\n")
|
||||||
if [ "$addr" != "$(uci -q get network.omr6in4.ipaddr)" ] || [ "$peer" != "$(uci -q get network.omr6in4.peeraddr)" ]; then
|
if [ "$addr" != "$(uci -q get network.omr6in4.ipaddr)" ] || [ "$peer" != "$(uci -q get network.omr6in4.peeraddr)" ]; then
|
||||||
uci -q batch <<-EOF
|
uci -q batch <<-EOF
|
||||||
set network.omr6in4.ipaddr=$addr
|
set network.omr6in4.ipaddr=$addr
|
||||||
|
|
|
@ -35,7 +35,7 @@ MY_DEPENDS := \
|
||||||
luci-app-nginx-ha luci-app-omr-tracker luci-app-qos \
|
luci-app-nginx-ha luci-app-omr-tracker luci-app-qos \
|
||||||
luci-app-vnstat omr-quota luci-app-omr-quota \
|
luci-app-vnstat omr-quota luci-app-omr-quota \
|
||||||
luci-app-mptcp luci-app-openmptcprouter luci-app-omr-bypass \
|
luci-app-mptcp luci-app-openmptcprouter luci-app-omr-bypass \
|
||||||
omr-6in4 ip6tables-mod-nat luci-proto-ipv6 6to4 6in4 6rd iputils-traceroute6 \
|
omr-ipv6 ip6tables-mod-nat luci-proto-ipv6 6to4 6in4 6rd iputils-traceroute6 \
|
||||||
speedtestc ethtool \
|
speedtestc ethtool \
|
||||||
kmod-rtl8xxxu kmod-rtl8192cu kmod-net-rtl8192su comgt kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan usb-modeswitch uqmi adb-enablemodem umbim kmod-mii kmod-usb-net kmod-usb-wdm kmod-usb-net-qmi-wwan kmod-usb-net-cdc-mbim
|
kmod-rtl8xxxu kmod-rtl8192cu kmod-net-rtl8192su comgt kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan usb-modeswitch uqmi adb-enablemodem umbim kmod-mii kmod-usb-net kmod-usb-wdm kmod-usb-net-qmi-wwan kmod-usb-net-cdc-mbim
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue