mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-08-08 20:03:41 +08:00
n2n: Fix autostart error and add MTU configuration support (#3420)
* n2n: fix autostart error * n2n: Add MTU configuration support
This commit is contained in:
parent
ab8daea73a
commit
a99e700214
@ -28,6 +28,10 @@ ipaddr.optional = false
|
||||
netmask = s:option(Value, "netmask", translate("Interface netmask"))
|
||||
netmask.optional = false
|
||||
|
||||
mtu = s:option(Value, "mtu", translate("MTU"))
|
||||
mtu.datatype = "range(1,1500)"
|
||||
mtu.optional = false
|
||||
|
||||
supernode = s:option(Value, "supernode", translate("Supernode IP address"))
|
||||
supernode.optional = false
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2008-2012 OpenWrt.org
|
||||
|
||||
START=90
|
||||
START=99
|
||||
|
||||
start_instance() {
|
||||
local cfg="$1"
|
||||
@ -16,6 +16,7 @@ start_instance() {
|
||||
config_get mode "$cfg" 'mode'
|
||||
config_get ipaddr "$cfg" 'ipaddr'
|
||||
config_get netmask "$cfg" 'netmask'
|
||||
config_get mtu "$cfg" 'mtu'
|
||||
config_get supernode "$cfg" 'supernode'
|
||||
config_get port "$cfg" 'port'
|
||||
config_get community "$cfg" 'community'
|
||||
@ -23,7 +24,8 @@ start_instance() {
|
||||
config_get_bool route "$cfg" 'route' '0'
|
||||
[ "$route" = "1" ] && args='-r'
|
||||
[ "$mode" = 'dhcp' ] && ipaddr='0.0.0.0'
|
||||
/usr/sbin/edge -d $tunname -a ${mode}:${ipaddr} -c $community $([ -n "$key" ] && echo -k $key) -s ${netmask} -l ${supernode}:${port} $args
|
||||
[ "-$mtu" != "-" ] && mtu="-M $mtu"
|
||||
/usr/sbin/edge -d $tunname -a ${mode}:${ipaddr} -c $community $([ -n "$key" ] && echo -k $key) -s ${netmask} -l ${supernode}:${port} $args $mtu
|
||||
;;
|
||||
supernode)
|
||||
config_get_bool enabled "$cfg" 'enabled' '0'
|
||||
|
Loading…
x
Reference in New Issue
Block a user