From 03b8c9a652d9861a1982c7f8c1b7aab4f293d161 Mon Sep 17 00:00:00 2001 From: Suysker <61983976+Suysker@users.noreply.github.com> Date: Wed, 8 Jun 2022 13:09:40 +0800 Subject: [PATCH] n2n_v2: improve dhcp support (#9498) * Update n2n_v2.config * Update n2n_v2.init --- package/lean/n2n_v2/files/n2n_v2.config | 1 + package/lean/n2n_v2/files/n2n_v2.init | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package/lean/n2n_v2/files/n2n_v2.config b/package/lean/n2n_v2/files/n2n_v2.config index 929c08866..b35c523c4 100644 --- a/package/lean/n2n_v2/files/n2n_v2.config +++ b/package/lean/n2n_v2/files/n2n_v2.config @@ -14,6 +14,7 @@ config edge config supernode option enabled '0' option port '1235' + option subnet '10.0.0.0-10.0.0.0/24' config route option enabled '0' diff --git a/package/lean/n2n_v2/files/n2n_v2.init b/package/lean/n2n_v2/files/n2n_v2.init index 4ecd8c7ad..1135d889a 100755 --- a/package/lean/n2n_v2/files/n2n_v2.init +++ b/package/lean/n2n_v2/files/n2n_v2.init @@ -41,7 +41,8 @@ start_instance() { config_get_bool enabled "$cfg" 'enabled' '0' [ "$enabled" = "0" ] && return 1 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' ;; route)