Merge 842e1015e3
into 850499fdb3
This commit is contained in:
commit
b238251f76
@ -13,7 +13,7 @@ define Package/gluon-core
|
|||||||
SECTION:=gluon
|
SECTION:=gluon
|
||||||
CATEGORY:=Gluon
|
CATEGORY:=Gluon
|
||||||
TITLE:=Base files of 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
|
endef
|
||||||
|
|
||||||
define Package/gluon-core/description
|
define Package/gluon-core/description
|
||||||
|
36
package/gluon-dns-cache/Makefile
Normal file
36
package/gluon-dns-cache/Makefile
Normal file
@ -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))
|
||||||
|
|
39
package/gluon-dns-cache/README.md
Normal file
39
package/gluon-dns-cache/README.md
Normal file
@ -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.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
##### 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
|
||||||
|
|
3
package/gluon-dns-cache/check_site.lua
Normal file
3
package/gluon-dns-cache/check_site.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
need_string_match('dns.cacheentries', '^%d$')
|
||||||
|
need_string_array('dns.servers')
|
||||||
|
need_string_match('next_node.ip6', '^[%x:]+$')
|
14
package/gluon-dns-cache/files/lib/gluon/upgrade/820-dns-config
Executable file
14
package/gluon-dns-cache/files/lib/gluon/upgrade/820-dns-config
Executable file
@ -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')
|
@ -19,6 +19,9 @@ msgstr "Automatisch (RA/DHCPv6)"
|
|||||||
msgid "Enable PoE passthrough"
|
msgid "Enable PoE passthrough"
|
||||||
msgstr "PoE-Passthrough aktivieren"
|
msgstr "PoE-Passthrough aktivieren"
|
||||||
|
|
||||||
|
msgid "Encapsulate mesh into vxlan"
|
||||||
|
msgstr "Mesh in ein vxlan einpacken"
|
||||||
|
|
||||||
msgid "Enable meshing on the LAN interface"
|
msgid "Enable meshing on the LAN interface"
|
||||||
msgstr "Mesh auf dem LAN-Port aktivieren"
|
msgstr "Mesh auf dem LAN-Port aktivieren"
|
||||||
|
|
||||||
|
@ -19,6 +19,9 @@ msgstr "Automatique (RA/DHCPv6)"
|
|||||||
msgid "Enable PoE passthrough"
|
msgid "Enable PoE passthrough"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Encapsulate mesh into vxlan"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "Enable meshing on the LAN interface"
|
msgid "Enable meshing on the LAN interface"
|
||||||
msgstr "Activer le réseau MESH sur le port LAN"
|
msgstr "Activer le réseau MESH sur le port LAN"
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@ msgstr ""
|
|||||||
msgid "Enable PoE passthrough"
|
msgid "Enable PoE passthrough"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Encapsulate mesh into vxlan"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "Enable meshing on the LAN interface"
|
msgid "Enable meshing on the LAN interface"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -84,6 +84,10 @@ end
|
|||||||
|
|
||||||
s = f:section(SimpleSection, nil, nil)
|
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 = 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.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disabled
|
||||||
o.rmempty = false
|
o.rmempty = false
|
||||||
@ -94,6 +98,10 @@ if sysconfig.lan_ifname then
|
|||||||
o.rmempty = false
|
o.rmempty = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if uci:get('system', 'gpio_switch_poe_passthrough') then
|
if uci:get('system', 'gpio_switch_poe_passthrough') then
|
||||||
s = f:section(SimpleSection, nil, nil)
|
s = f:section(SimpleSection, nil, nil)
|
||||||
o = s:option(Flag, "poe_passthrough", translate("Enable PoE passthrough"))
|
o = s:option(Flag, "poe_passthrough", translate("Enable PoE passthrough"))
|
||||||
|
Loading…
Reference in New Issue
Block a user