n2n_v2: improve dhcp support (#9498)

* Update n2n_v2.config

* Update n2n_v2.init
This commit is contained in:
Suysker 2022-06-08 13:09:40 +08:00 committed by GitHub
parent df4850bfc4
commit 03b8c9a652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@ config edge
config supernode config supernode
option enabled '0' option enabled '0'
option port '1235' option port '1235'
option subnet '10.0.0.0-10.0.0.0/24'
config route config route
option enabled '0' option enabled '0'

View File

@ -41,7 +41,8 @@ start_instance() {
config_get_bool enabled "$cfg" 'enabled' '0' config_get_bool enabled "$cfg" 'enabled' '0'
[ "$enabled" = "0" ] && return 1 [ "$enabled" = "0" ] && return 1
config_get port "$cfg" 'port' config_get port "$cfg" 'port'
/usr/bin/supernode -p $port & config_get subnet "$cfg" 'subnet'
/usr/bin/supernode -p $port -a $subnet &
iptables -I INPUT -p udp --dport $port -j ACCEPT -m comment --comment 'n2n supernode port' iptables -I INPUT -p udp --dport $port -j ACCEPT -m comment --comment 'n2n supernode port'
;; ;;
route) route)