Browse Source

wg-installer: allow defining link costs for hotplugs

Add options to set link costs in mesh routing daemons.

Signed-off-by: Nick Hainke <vincent@systemli.org>
lilik-openwrt-22.03
Nick Hainke 3 years ago
parent
commit
ee879d3747
3 changed files with 16 additions and 0 deletions
  1. +6
    -0
      net/wg-installer/wg-server/config/wgserver.conf
  2. +5
    -0
      net/wg-installer/wg-server/hotplug.d/99-mesh-babeld
  3. +5
    -0
      net/wg-installer/wg-server/hotplug.d/99-mesh-olsrd

+ 6
- 0
net/wg-installer/wg-server/config/wgserver.conf View File

@ -7,3 +7,9 @@ config server
option wg_pub '/root/wg.pub'
option wg_tmp_key '1'
option timeout_handshake '600'
config babeld_hotplug
option rxcost '1024'
config olsrd_hotplug
option LinkQualityMult 'default 0.1'

+ 5
- 0
net/wg-installer/wg-server/hotplug.d/99-mesh-babeld View File

@ -14,6 +14,11 @@ fi
if [ "${ACTION}" == "add" ]; then
uci add babeld interface
uci set babeld.@interface[-1].ifname="${INTERFACE}"
uci get wgserver.@babeld_hotplug[0].rxcost
if [ $? ]; then
babeld_rxcost="$(uci get wgserver.@babeld_hotplug[0].rxcost)"
uci set babeld.@interface[-1].rxcost="$babeld_rxcost"
fi
uci -c "$(dirname $(realpath /etc/config/babeld))" commit babeld
/etc/init.d/babeld reload
fi


+ 5
- 0
net/wg-installer/wg-server/hotplug.d/99-mesh-olsrd View File

@ -16,6 +16,11 @@ if [ "${ACTION}" == "add" ]; then
uci set olsrd.@Interface[-1].ignore=0
uci set olsrd.@Interface[-1].interface="${INTERFACE}"
uci set olsrd.@Interface[-1].Mode="ether"
uci get wgserver.@olsrd_hotplug[0].LinkQualityMult
if [ $? ]; then
olsrd_LinkQualityMult="$(uci get wgserver.@olsrd_hotplug[0].LinkQualityMult)"
uci set olsrd.@Interface[-1].LinkQualityMult="$olsrd_LinkQualityMult"
fi
uci -c "$(dirname $(realpath /etc/config/olsrd))" commit olsrd
/etc/init.d/olsrd reload
fi


Loading…
Cancel
Save