diff --git a/package/gluon-core/Makefile b/package/gluon-core/Makefile index 9917a5e0..7baf2255 100644 --- a/package/gluon-core/Makefile +++ b/package/gluon-core/Makefile @@ -13,7 +13,7 @@ define Package/gluon-core SECTION:=gluon CATEGORY:=Gluon TITLE:=Base files of Gluon - DEPENDS:=+gluon-site +libgluonutil +lua-platform-info +lua-hash +luci-base +luci-lib-jsonc +odhcp6c +firewall +pretty-hostname + DEPENDS:=+gluon-site +libgluonutil +lua-platform-info +lua-hash +luci-base +luci-lib-jsonc +odhcp6c +firewall +pretty-hostname +kmod_vxlan +ip-full endef define Package/gluon-core/description diff --git a/package/gluon-dns-cache/Makefile b/package/gluon-dns-cache/Makefile new file mode 100644 index 00000000..55438b97 --- /dev/null +++ b/package/gluon-dns-cache/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gluon-dns-config +PKG_VERSION:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(GLUONDIR)/include/package.mk + +define Package/gluon-dns-config + SECTION:=gluon + CATEGORY:=Gluon + TITLE:=Use Node as DNS cache, configure using site.conf + DEPENDS:=+gluon-core +endef + +define Package/gluon-legacy/description + Use Node as DNS cache, configure using site.conf +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/gluon-dns-config/install + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,gluon-dns-config)) + diff --git a/package/gluon-dns-cache/README.md b/package/gluon-dns-cache/README.md new file mode 100644 index 00000000..c2a5a1bc --- /dev/null +++ b/package/gluon-dns-cache/README.md @@ -0,0 +1,39 @@ +##### Hintergrund +Es ist erstrebenswert, die Menge der kleinen Datenpakete vom Router zum +Supernode zu reduzieren. Dabei hilft es, die DNS-Anfragen der Clients zu +den Supernodes zu reduzieren. + +
+ +##### Das Packages +Durch dieses Package wird der Cache der Router-dnsmasq-Instanz, welche +auf Port 53 horcht, konfiguriert. Die Freifunk-Router halten dadurch +eine Anzahl von *dns.cacheentries* Einträgen im RAM des Routers vor. +Sollte ein DNS-Record im Cache nicht gefunden werden, wird einer der in +der Tabelle *dns.servers* angegebenen Server abgefragt. + +Dieses Paket konfiguriert neben dem Cache auch die Namensauflösung für +die Host-Namen "*nextnode*". Die IP-Adressen werden aus der *site.conf* +ausgelesen. + +#### Konfiguration +Die Konfiguration erfolgt per ***site.conf*** mit folgenden Parametern: +``` +dns = { + cacheentries = 5000, + servers = { '2a06:8187:fb00:53::53', }, +}, +``` + +* ***cacheentries*** ist die Anzahl der Einträge, die der Cache aufnehmen soll. +Je Eintrag werden ca 90 Byte RAM benötigt. Der Speicher für alle Einträge wird +als Block beim Systemstart reserviert. +* ***servers*** ist eine Namens-Liste von Servern, welche bei Cache-Misses angefragt werden. + + +--- + +Siehe auch: +https://wiki.openwrt.org/doc/uci/dhcp +http://flux242.blogspot.de/2012/06/dnsmasq-cache-size-tuning.html + diff --git a/package/gluon-dns-cache/check_site.lua b/package/gluon-dns-cache/check_site.lua new file mode 100644 index 00000000..69675e54 --- /dev/null +++ b/package/gluon-dns-cache/check_site.lua @@ -0,0 +1,3 @@ +need_string_match('dns.cacheentries', '^%d$') +need_string_array('dns.servers') +need_string_match('next_node.ip6', '^[%x:]+$') diff --git a/package/gluon-dns-cache/files/lib/gluon/upgrade/820-dns-config b/package/gluon-dns-cache/files/lib/gluon/upgrade/820-dns-config new file mode 100755 index 00000000..b4ed7b31 --- /dev/null +++ b/package/gluon-dns-cache/files/lib/gluon/upgrade/820-dns-config @@ -0,0 +1,14 @@ +#!/usr/bin/lua +local site = require 'gluon.site_config' +local uci = require('luci.model.uci').cursor() + +dnsmasq=uci:get_first("dhcp", "dnsmasq") + +uci:set('dhcp', dnsmasq, 'cachesize', site.dns.cacheentries) +uci:set('dhcp', dnsmasq, 'server', site.dns.servers) +uci:set('dhcp', dnsmasq, 'localise_queries', '1') +uci:set('dhcp', dnsmasq, 'localservice', '0') +domain = uci:add('dhcp', 'domain') +uci:set('dhcp', domain, 'name', 'nextnode') +uci:set('dhcp', domain, 'ip', site.next_node.ip6 ) +uci:save('dhcp') diff --git a/package/gluon-luci-portconfig/i18n/de.po b/package/gluon-luci-portconfig/i18n/de.po index a94e7d41..4d365b05 100644 --- a/package/gluon-luci-portconfig/i18n/de.po +++ b/package/gluon-luci-portconfig/i18n/de.po @@ -19,6 +19,9 @@ msgstr "Automatisch (RA/DHCPv6)" msgid "Enable PoE passthrough" msgstr "PoE-Passthrough aktivieren" +msgid "Encapsulate mesh into vxlan" +msgstr "Mesh in ein vxlan einpacken" + msgid "Enable meshing on the LAN interface" msgstr "Mesh auf dem LAN-Port aktivieren" diff --git a/package/gluon-luci-portconfig/i18n/fr.po b/package/gluon-luci-portconfig/i18n/fr.po index 3ec59395..c32c410f 100644 --- a/package/gluon-luci-portconfig/i18n/fr.po +++ b/package/gluon-luci-portconfig/i18n/fr.po @@ -19,6 +19,9 @@ msgstr "Automatique (RA/DHCPv6)" msgid "Enable PoE passthrough" msgstr "" +msgid "Encapsulate mesh into vxlan" +msgstr "" + msgid "Enable meshing on the LAN interface" msgstr "Activer le réseau MESH sur le port LAN" diff --git a/package/gluon-luci-portconfig/i18n/gluon-luci-portconfig.pot b/package/gluon-luci-portconfig/i18n/gluon-luci-portconfig.pot index 5945016b..9afd6dd7 100644 --- a/package/gluon-luci-portconfig/i18n/gluon-luci-portconfig.pot +++ b/package/gluon-luci-portconfig/i18n/gluon-luci-portconfig.pot @@ -10,6 +10,9 @@ msgstr "" msgid "Enable PoE passthrough" msgstr "" +msgid "Encapsulate mesh into vxlan" +msgstr "" + msgid "Enable meshing on the LAN interface" msgstr "" diff --git a/package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua b/package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua index c3be0e7a..6f7efd2e 100644 --- a/package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua +++ b/package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua @@ -84,6 +84,10 @@ end s = f:section(SimpleSection, nil, nil) +o = s:option(Flag, "mesh_vxlan", translate("Encapsulate mesh into vxlan")) +o.default = uci:get_bool("network", uci:get_first("network","vxlan") , "active") and o.enabled or o.disabled +o.rmempty = false + o = s:option(Flag, "mesh_wan", translate("Enable meshing on the WAN interface")) o.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disabled o.rmempty = false @@ -94,6 +98,10 @@ if sysconfig.lan_ifname then o.rmempty = false end + + + + if uci:get('system', 'gpio_switch_poe_passthrough') then s = f:section(SimpleSection, nil, nil) o = s:option(Flag, "poe_passthrough", translate("Enable PoE passthrough"))