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

Use static address for glorytun

This commit is contained in:
Ycarus 2018-05-29 18:02:40 +02:00
parent 78e3bef74a
commit c1c3adc1d3
3 changed files with 9 additions and 3 deletions

View file

@ -7,3 +7,6 @@ config glorytun 'vpn'
option mptcp '1' option mptcp '1'
option proto 'tcp' option proto 'tcp'
option chacha20 '1' option chacha20 '1'
option localip '10.0.0.2'
option remoteip '10.0.0.1'
option mtuauto '1'

View file

@ -17,9 +17,9 @@ set_default() {
local iface local iface
config_get iface "$config" dev config_get iface "$config" dev
[ "$iface" = "$DEVICE" ] && { [ "$iface" = "$DEVICE" ] && {
config_get localip "$config" localip config_get localip "$config" localip
config_get remoteip "$config" remoteip config_get remoteip "$config" remoteip
[ "$remoteip" != "" ] && [ "$localip" != "" ] && ip addr add $localip peer $remoteip dev $DEVICE [ "$remoteip" != "" ] && [ "$localip" != "" ] && ifconfig $DEVICE $localip pointopoint $remoteip up
} }
} }

View file

@ -15,7 +15,10 @@ 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=dhcp 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
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