Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: OLSR v1 & v2 support #2418

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contrib/ci/olsr-site/i18n
1 change: 1 addition & 0 deletions contrib/ci/olsr-site/modules
169 changes: 169 additions & 0 deletions contrib/ci/olsr-site/site.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
-- This is an example site configuration for Gluon v2018.2+
--
-- Take a look at the documentation located at
-- https://gluon.readthedocs.io/ for details.
--
-- This configuration will not work as is. You're required to make
-- community specific changes to it!
{
-- Used for generated hostnames, e.g. freifunk-abcdef123456. (optional)
-- hostname_prefix = 'freifunk-',

-- Name of the community.
site_name = 'Continious Integration',

-- Shorthand of the community.
site_code = 'ci',

-- 32 bytes of random data, encoded in hexadecimal
-- This data must be unique among all sites and domains!
-- Can be generated using: echo $(hexdump -v -n 32 -e '1/1 "%02x"' </dev/urandom)
domain_seed = 'e9608c4ff338b920992d629190e9ff11049de1dfc3f299eac07792dfbcda341c',

-- Prefixes used within the mesh.
-- prefix6 is required, prefix4 can be omitted if next_node.ip4
-- is not set.
prefix4 = '10.0.0.0/20',
prefix6 = 'fd::/64',

-- [olsr] prefix configuration
node_prefix6 = 'fdff:cafe:cafe:cafe::/64',
node_prefix4 = '10.12.0.0/16',
node_prefix4_range = 24,
node_prefix4_temporary = true,

-- Timezone of your community.
-- See https://openwrt.org/docs/guide-user/base-system/system_configuration#time_zones
timezone = 'CET-1CEST,M3.5.0,M10.5.0/3',

-- List of NTP servers in your community.
-- Must be reachable using IPv6!
-- ntp_servers = {'1.ntp.services.ffxx'},

-- Wireless regulatory domain of your community.
regdom = 'DE',

-- Wireless configuration for 2.4 GHz interfaces.
wifi24 = {
-- Wireless channel.
channel = 1,

-- ESSID used for client network.
ap = {
ssid = 'gluon-ci-ssid',
-- disabled = true, -- (optional)
},

mesh = {
-- Adjust these values!
id = 'ueH3uXjdp', -- usually you don't want users to connect to this mesh-SSID, so use a cryptic id that no one will accidentally mistake for the client WiFi
mcast_rate = 12000,
-- disabled = true, -- (optional)
},
},

-- Wireless configuration for 5 GHz interfaces.
-- This should be equal to the 2.4 GHz variant, except
-- for channel.
wifi5 = {
channel = 44,
outdoor_chanlist = '100-140',
ap = {
ssid = 'gluon-ci-ssid',
owe_ssid = "owe.gluon-ci-ssid",
owe_transition_mode = false,
},
mesh = {
-- Adjust these values!
id = 'ueH3uXjdp',
mcast_rate = 12000,
},
},


-- The next node feature allows clients to always reach the node it is
-- connected to using a known IP address.
next_node = {
-- anycast IPs of all nodes
-- name = { 'nextnode.location.community.example.org', 'nextnode', 'nn' },
ip4 = '10.0.0.1',
ip6 = 'fd::1',
},

mesh = {
vxlan = true,
-- [olsr] OLSR configuration with v1/v2 parallel mesh
olsrd = {
v1 = {
enable = true,
},
v2 = {
enable = true,
ip6_exclusive_mode = true,
}
},
},

mesh_vpn = {
-- enabled = true,
mtu = 1312,

fastd = {
-- Refer to https://fastd.readthedocs.io/en/latest/ to better understand
-- what these options do.

-- List of crypto-methods to use.
methods = {'salsa2012+umac'},
-- configurable = true,
-- syslog_level = 'warn',

groups = {
backbone = {
-- Limit number of connected peers to reduce bandwidth.
limit = 1,

-- List of peers.
peers = {
},

},
},
},

bandwidth_limit = {
-- The bandwidth limit can be enabled by default here.
enabled = false,

-- Default upload limit (kbit/s).
egress = 200,

-- Default download limit (kbit/s).
ingress = 3000,
},
},

autoupdater = {
-- Default branch. Don't forget to set GLUON_BRANCH when building!
branch = 'stable',

-- List of branches. You may define multiple branches.
branches = {
stable = {
name = 'stable',

-- List of mirrors to fetch images from. IPv6 required!
mirrors = {'http://1.updates.services.ffhl/stable/sysupgrade'},

-- Number of good signatures required.
-- Have multiple maintainers sign your build and only
-- accept it when a sufficient number of them have
-- signed it.
good_signatures = 2,

-- List of public keys of maintainers.
pubkeys = {
},
},
},
},
}
57 changes: 57 additions & 0 deletions contrib/ci/olsr-site/site.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## gluon site.mk makefile example

## GLUON_FEATURES
# Specify Gluon features/packages to enable;
# Gluon will automatically enable a set of packages
# depending on the combination of features listed

GLUON_FEATURES := \
autoupdater \
ebtables-filter-multicast \
ebtables-filter-ra-dhcp \
ebtables-limit-arp \
mesh-olsrd \
mesh-vpn-fastd \
respondd \
status-page \
web-advanced \
web-wizard

GLUON_FEATURES_standard := \
wireless-encryption-wpa3

## GLUON_SITE_PACKAGES
# Specify additional Gluon/OpenWrt packages to include here;
# A minus sign may be prepended to remove a packages from the
# selection that would be enabled by default or due to the
# chosen feature flags

GLUON_SITE_PACKAGES := iwinfo

## DEFAULT_GLUON_RELEASE
# version string to use for images
# gluon relies on
# opkg compare-versions "$1" '>>' "$2"
# to decide if a version is newer or not.

DEFAULT_GLUON_RELEASE := 0.6+exp$(shell date '+%Y%m%d')

# Variables set with ?= can be overwritten from the command line

## GLUON_RELEASE
# call make with custom GLUON_RELEASE flag, to use your own release version scheme.
# e.g.:
# $ make images GLUON_RELEASE=23.42+5
# would generate images named like this:
# gluon-ff%site_code%-23.42+5-%router_model%.bin

GLUON_RELEASE ?= $(DEFAULT_GLUON_RELEASE)

# Default priority for updates.
GLUON_PRIORITY ?= 0

# Region code required for some images; supported values: us eu
GLUON_REGION ?= eu

# Languages to include
GLUON_LANGS ?= en de
76 changes: 76 additions & 0 deletions docs/features/olsrd.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
OLSRD
===========

Gluon supports OLSRD, both version 1 and 2 in the following modes:

- olsrd
- v4 only
- olsrd2
- v4 only
- v6 only
- dual-stack

olsrdv1 support is intended mostly for migration purposes
and as such v1 IPv6 support is not going to be added

Configuration
-------------

The LAN will automatically be determined by the specified prefix and prefix6

The following options exist

.. code-block:: lua
{
mesh {
olsrd = {
v1 = {
-- Enable v1
-- enable = true,

-- Set additional olsrd configuration
-- config = {
-- DebugLevel = 0,
-- IpVersion = 4,
-- AllowNoInt = yes,
-- },
},
v2 = {
-- Enable v2
enable = true,

-- Make v2 IPv6 exclusive
-- ip6_exclusive_mode = true,

-- Make v2 IPv4 exclusive (useful for v1 co-existence)
-- ip4_exclusive_mode = true,

-- Set additional olsrd2 configuration
-- config = {
--
-- }
}
}
}
}

Static IP managment
-------------------
This feature is enabled as part of olsrd support

Static IP managment has the following options

.. code-block:: lua
{
-- Auto-assign addresses from an IPv4 range
node_prefix4 = '10.12.23.0/16',
node_prefix4_range = 24, -- range of node_prefix4 that should be randomized with mac
node_prefix4_temporary = true, -- (def: true) flag to indicate whether or not this is a temporary range that will need manual change for permanent assignments or not

-- Auto-assign addresses from an IPv6 range
node_prefix6 = 'fdff:cafe:cafe:cafe:23::/64',
node_prefix6_range = 64, -- (def: 64) range of node_prefix6 that should be randomized with mac
node_prefix6_temporary = true, -- (def: false) flag to indicate whether or not this is a temporary range that will need manual change for permanent assignments or not
}

Note that these addresses are intended to be temporary (TODO: should they or would dynamic4 and dynamic4IsTmp be better?)
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre
features/dns-forwarder
features/monitoring
features/multidomain
features/olsrd
features/authorized-keys
features/roles
features/vpn
Expand Down
3 changes: 3 additions & 0 deletions package/features
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ when(_'status-page' and _'mesh-batman-adv-15', {
'gluon-status-page-mesh-batman-adv',
})

when(_'status-page' and _'mesh-olsrd', {
'gluon-status-page-mesh-olsrd'
})

when(_'mesh-babel', {
'gluon-radvd',
Expand Down
54 changes: 54 additions & 0 deletions package/gluon-mesh-olsrd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=gluon-mesh-olsrd
PKG_VERSION=1

PKG_BUILD_DEPENDS += libjson-c

include ../gluon.mk

define Package/gluon-mesh-olsrd
TITLE:=olsrd mesh
DEPENDS:= \
+gluon-core \
+kmod-macvlan \
@IPV6 +olsrd +oonf-olsrd2 \
+firewall \
+libgluonutil \
+libjson-c \
+libubox +libuclient \
+olsrd-mod-jsoninfo \
+olsrd-mod-httpinfo \
+olsrd-mod-txtinfo \
+liblua \
+ip-full \
+gluon-mmfd \
+gluon-l3roamd \
+gluon-radvd \
+lua-jsonc
PROVIDES:=gluon-mesh-provider
endef

define Package/gluon-mesh-olsrd/install
$(Gluon/Build/Install)

$(INSTALL_DIR) $(1)/usr/lib/lua/gluon
$(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd.so $(1)/usr/lib/lua/gluon/
$(INSTALL_DIR) $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libolsrdhelper.so $(1)/usr/lib/
endef

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/lua/gluon
$(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd.so $(1)/usr/lib/lua/gluon/
$(INSTALL_DIR) $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libolsrdhelper.so $(1)/usr/lib/

$(INSTALL_DIR) $(1)/usr/include/gluon-mesh-olsrd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libolsrdhelper.h $(1)/usr/include/gluon-mesh-olsrd/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libolsrdhelper.pc $(1)/usr/lib/pkgconfig/
endef


$(eval $(call BuildPackageGluon,gluon-mesh-olsrd))
Loading