mesh-olsr12-openvpn: init
This commit is contained in:
parent
d6335865ea
commit
34373e92a5
13
package/gluon-mesh-olsr12-openvpn/Makefile
Normal file
13
package/gluon-mesh-olsr12-openvpn/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=gluon-mesh-olsr12-openvpn
|
||||||
|
PKG_VERSION=1
|
||||||
|
|
||||||
|
include ../gluon.mk
|
||||||
|
|
||||||
|
define Package/gluon-mesh-olsr12-openvpn
|
||||||
|
TITLE:=olsrd v1 to v2 migration fallback vpn
|
||||||
|
DEPENDS:= +gluon-mesh-olsrd +openvpn
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackageGluon,gluon-mesh-olsr12-openvpn))
|
@ -1,4 +1,5 @@
|
|||||||
if need_boolean({'mesh', 'olsrd', 'olsr12', 'enable'}, false) then
|
if need_boolean({'mesh', 'olsrd', 'olsr12', 'enable'}, false) then
|
||||||
need_number({'mesh', 'olsrd', 'olsr12', 'port'}, false)
|
need_number({'mesh', 'olsrd', 'olsr12', 'port'}, false)
|
||||||
|
need_string({'mesh', 'olsrd', 'olsr12', 'ca'})
|
||||||
need_string({'mesh', 'olsrd', 'olsr12', 'server'})
|
need_string({'mesh', 'olsrd', 'olsr12', 'server'})
|
||||||
end
|
end
|
@ -8,20 +8,46 @@ local sysconfig = require 'gluon.sysconfig'
|
|||||||
local util = require 'gluon.util'
|
local util = require 'gluon.util'
|
||||||
local olsrd = require 'gluon.olsrd'
|
local olsrd = require 'gluon.olsrd'
|
||||||
|
|
||||||
|
uci:delete('openvpn', 'olsr12_vpn')
|
||||||
|
|
||||||
if site.mesh.olsrd.olsr12.enable() then
|
if site.mesh.olsrd.olsr12.enable() then
|
||||||
-- TODO: gluon_wired once added in mesh-olsrd
|
-- TODO: gluon_wired once added in mesh-olsrd
|
||||||
uci:section('network', 'interface', 'olsr12', {
|
uci:section('network', 'interface', 'olsr12', {
|
||||||
proto = 'vxlan',
|
ifname = 'olsr12',
|
||||||
vid = 111,
|
proto = 'tap',
|
||||||
|
|
||||||
port = site.mesh.olsrd.olsr12.port(598),
|
|
||||||
peeraddr = site.mesh.olsrd.olsr12.server(),
|
|
||||||
|
|
||||||
mtu = 1300,
|
|
||||||
|
|
||||||
zone = 'mesh',
|
zone = 'mesh',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local cred = io.open('/tmp/olsr12', 'w')
|
||||||
|
cred:write(sysconfig.primary_mac .. '\n' .. sysconfig.primary_mac .. '\n')
|
||||||
|
cred:close()
|
||||||
|
|
||||||
|
local ca = io.open('/tmp/olsr12.ca', 'w')
|
||||||
|
ca:write(site.mesh.olsrd.olsr12.ca())
|
||||||
|
ca:close()
|
||||||
|
|
||||||
|
uci:section('openvpn', 'openvpn', 'olsr12_vpn', {
|
||||||
|
enabled = true,
|
||||||
|
client = true,
|
||||||
|
|
||||||
|
dev = 'olsr12',
|
||||||
|
dev_type = 'tap',
|
||||||
|
|
||||||
|
data_ciphers_fallback = 'none',
|
||||||
|
persist_key = true,
|
||||||
|
persist_tun = true,
|
||||||
|
|
||||||
|
ca = '/tmp/olsr12.ca',
|
||||||
|
|
||||||
|
verb = 3,
|
||||||
|
|
||||||
|
remote = {
|
||||||
|
site.mesh.olsrd.olsr12.server() .. " " .. site.mesh.olsrd.olsr12.port(1194)
|
||||||
|
},
|
||||||
|
|
||||||
|
auth_user_pass = '/tmp/olsr12',
|
||||||
|
})
|
||||||
|
|
||||||
uci:section('olsrd2', 'interface', 'olsr12_mesh', {
|
uci:section('olsrd2', 'interface', 'olsr12_mesh', {
|
||||||
ifname = { 'olsr12' },
|
ifname = { 'olsr12' },
|
||||||
bindto = uci:get_list('olsrd2', 'wired_mesh', 'bindto'),
|
bindto = uci:get_list('olsrd2', 'wired_mesh', 'bindto'),
|
||||||
@ -38,3 +64,4 @@ end
|
|||||||
uci:save('olsrd2')
|
uci:save('olsrd2')
|
||||||
uci:save('firewall')
|
uci:save('firewall')
|
||||||
uci:save('network')
|
uci:save('network')
|
||||||
|
uci:save('openvpn')
|
@ -1,13 +0,0 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=gluon-mesh-olsr12-vxlan
|
|
||||||
PKG_VERSION=1
|
|
||||||
|
|
||||||
include ../gluon.mk
|
|
||||||
|
|
||||||
define Package/gluon-mesh-olsr12-vxlan
|
|
||||||
TITLE:=olsrd v1 to v2 migration fallback vpn
|
|
||||||
DEPENDS:= +gluon-mesh-olsrd +vxlan
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackageGluon,gluon-mesh-olsr12-vxlan))
|
|
Loading…
Reference in New Issue
Block a user