The n2n VPN package loses stability if the MTU is configured to be too large. The current n2n package does not permit the mtu to be adjusted and thus defaults to 1400 which is not a good level to use as a default setting. This patch adds the 'mtu' setting option in /etc/config/n2n and modifies the /etc/init.d/n2n script to look for that setting, defaulting to 1300 if it is not provided.
diff --git a/net/n2n/files/n2n.config b/net/n2n/files/n2n.config index bf4acfe..5088589 100644 --- a/net/n2n/files/n2n.config +++ b/net/n2n/files/n2n.config @@ -5,3 +5,4 @@ config edge option community '' option key '' option route '' + option mtu '' diff --git a/net/n2n/files/n2n.init b/net/n2n/files/n2n.init index 2454de2..b31ca64 100644 --- a/net/n2n/files/n2n.init +++ b/net/n2n/files/n2n.init @@ -18,7 +18,9 @@ start_instance() { config_get key "$cfg" 'key' config_get_bool route "$cfg" 'route' '0' [ "$route" = "1" ] && args='-r' - service_start /usr/sbin/edge -f $args -a $ipaddr -c $community -k $key -l ${supernode}:${port} + config_get key "$cfg" 'mtu' + [ -n "$mtu" ] || mtu='1300' + service_start /usr/sbin/edge -f $args -a $ipaddr -c $community -k $key -M $mtu -l ${supernode}:${port} ;; supernode) config_get port "$cfg" port -- "Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot." --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra. -- "Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot." --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel