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

fix zjlab

This commit is contained in:
suyuan 2023-03-20 16:27:41 +08:00
parent 4af794be24
commit df7c9c169f
8 changed files with 14 additions and 14 deletions

View file

@ -3,8 +3,8 @@
. "$(readlink -f "$1")"
INTF=gt-${DEV}
[ -z "$LOCALIP" ] && LOCALIP="10.255.255.1"
[ -z "$BROADCASTIP" ] && BROADCASTIP="10.255.255.3"
[ -z "$LOCALIP" ] && LOCALIP="172.255.255.1"
[ -z "$BROADCASTIP" ] && BROADCASTIP="172.255.255.3"
while [ -z "$(ip link show $INTF 2>/dev/null)" ]; do
sleep 2
done

View file

@ -3,8 +3,8 @@
. "$(readlink -f "$1")"
INTF=gt-udp-${DEV}
[ -z "$LOCALIP" ] && LOCALIP="10.255.254.1"
[ -z "$BROADCASTIP" ] && BROADCASTIP="10.255.254.3"
[ -z "$LOCALIP" ] && LOCALIP="172.255.254.1"
[ -z "$BROADCASTIP" ] && BROADCASTIP="172.255.254.3"
while [ -z "$(ip link show $INTF 2>/dev/null)" ]; do
sleep 2
done

View file

@ -3,7 +3,7 @@ Name=gt-udp-tun*
[Network]
Description=Glorytun server device
Address=10.255.254.1/24
Address=172.255.254.1/24
DHCPServer=yes
IPMasquerade=yes

View file

@ -6,7 +6,7 @@ MTUBytes=1500
[Network]
Description=Glorytun server device
Address=10.255.255.1/24
Address=172.255.255.1/24
DHCPServer=yes
IPMasquerade=yes

View file

@ -25,8 +25,8 @@ echo "Done"
echo "-------------------------------------------------------------------------------------------------------------------------------"
echo "OMR Pi-hole configuration..."
cat > /etc/lighttpd/external.conf << 'EOF'
server.bind="10.255.255.1"
$SERVER["socket"] == "10.255.254.1:80" { }
server.bind="172.255.255.1"
$SERVER["socket"] == "172.255.254.1:80" { }
$SERVER["socket"] == "10.255.252.1:80" { }
$SERVER["socket"] == "10.255.251.1:80" { }
$SERVER["socket"] == "10.255.253.1:80" { }
@ -54,6 +54,6 @@ systemctl -q restart pihole-FTL
echo "Done"
echo "======================================================================================================================================"
echo "To use Pi-hole in OpenMPTCProuter, you need to 'Save & Apply' the wizard again in System->OpenMPTCProuter then reboot OpenMPTCProuter."
echo "Web interface will be available on 10.255.255.1 if you use Glorytun TCP, 10.255.254.1 if you use Glorytun UDP."
echo "Web interface will be available on 172.255.255.1 if you use Glorytun TCP, 172.255.254.1 if you use Glorytun UDP."
echo "======================================================================================================================================"
exit 0

View file

@ -39,7 +39,7 @@ _glorytun_tcp() {
done
if [ -f /etc/openmptcprouter-vps-admin/current-vpn ] && [ "$(cat /etc/openmptcprouter-vps-admin/current-vpn)" = "glorytun_tcp" ]; then
localip="$(cat /etc/glorytun-tcp/tun0 | grep LOCALIP | cut -d '=' -f2)"
[ -z "$localip" ] && localip="10.255.255.1"
[ -z "$localip" ] && localip="172.255.255.1"
remoteip="$(echo $localip | sed 's/\.1/\.2/')"
if [ "$(ping -c 5 -w 5 $remoteip | grep '100%')" != "" ] && ([ -z "$(pgrep glorytun-tcp)" ] || [ "$(expr $(date +%s) - $(stat -c %Y /proc/$(pgrep glorytun-tcp)/exe ))" -gt "300" ]); then
logger -t "OMR-Service" "No answer from VPN client end, restart Glorytun-TCP"

View file

@ -1,3 +1,3 @@
VPS_ADDR=10.255.255.1
OMR_ADDR=10.255.255.2
VPS_ADDR=172.255.255.1
OMR_ADDR=172.255.255.2
VPS_IFACE=gt-tun0

View file

@ -21,8 +21,8 @@ MASQUERADE 10.255.247.0/24,\
10.255.251.0/24,\
10.255.252.0/24,\
10.255.253.0/24,\
10.255.254.0/24,\
10.255.255.0/24,\
172.255.254.0/24,\
172.255.255.0/24,\
169.254.0.0/16,\
172.16.0.0/12,\
192.168.0.0/16 $NET_IFACE