Browse Source

snmpd: Set bandwidth of of VLAN, B.A.T.M.A.N., bridge and vEth interface to 100Mb/s

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 5 years ago
parent
commit
b3949ff93f
1 changed files with 19 additions and 7 deletions
  1. 19 7
      snmpd/snmpd.conf

+ 19 - 7
snmpd/snmpd.conf

@@ -4,6 +4,10 @@
 {%- set sys_location = node_config.get ('sysLocation', "Please fix sysLocation...") %}
 {%- set nms_list = salt['pillar.get'] ('globals:snmp:nms_list', []) %}
 
+{%- set sites_config = salt['pillar.get'] ('sites', {}) %}
+{%- set ifaces = salt['ffho_net.get_interface_config'] (node_config, sites_config) %}
+
+
 #
 # /etc/snmp/snmpd.conf (Salt managed)
 #
@@ -34,13 +38,21 @@ rocommunity	{{ ro_community }}	{{ entry }}
 #
 # Network interfaces
 #
-{%- if 'gateway' in node_config.get ('roles', []) %}
-# Set B.A.T.M.A.N. related devices to 100 MBit/s
-# FIXME: For all sites 'n stuff
-interface	bat0		6	100000000
-interface	inter-gw-vpn	6	100000000
-interface	mesh-vpn-v4	6	100000000
-interface	mesh-vpn-v6	6	100000000
+# Set bandwidth of VLAN, B.A.T.M.A.N., bridge and vEth interface to 100Mb/s
+# The default is 10Mb/s which makes LibreNMS whine quite a lot if there is
+# a little traffic. 100Mb/s currently seems a decent idea for us but is not
+# an ideal value for everyone.
+{%- for iface in ifaces|sort %}
+ {%- set config = ifaces.get (iface) %}
+ {%- if 'vlan-raw-device' in config or "batman" in config or "bridge" in config or config.get ('link-type', '') == 'veth' %}
+interface	{{ iface }}	6	100000000
+ {%- endif %}
+{%- endfor %}
+
+{%- if "fastd" in node_config.get ('roles') %}
+  {%- for site in node_config.get ('sites') %}
+interface	{{ site }}_intergw	6	100000000
+  {%- endfor %}
 {%- endif %}
 
 {%- set ovpn_networks = [] %}