From 14668700a7c97ef0afa07d7701eeeb26fe34d806 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Wed, 31 Mar 2021 16:22:45 +0200 Subject: [PATCH] Step to add ufw rules --- seqs/snmp.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/seqs/snmp.sh b/seqs/snmp.sh index 953a5d3..5d81515 100755 --- a/seqs/snmp.sh +++ b/seqs/snmp.sh @@ -90,6 +90,22 @@ step_2() { } v3AuthLoc="/var/lib/snmp/snmpd.conf" +step_5_info() { + echo "Add ufw rules for port 161 udp [INTERFACE]" + echoinfo " [INTERFACE] (default: eth0)" +} +step_5_alias() { ALIAS="ufw"; } +step_5() { + shift + local lInterface="eth0" + [ ! -z "$1" ] && lInterface="$1" + # Check if interface exists + ip -br a | grep -E "^$lInterface" >>/dev/null 2>&1 + endReturn -o $? "Interface $lInterface does not exist" + + exe ufw allow in on $lInterface to any port 161 proto udp comment "snmp" +} + step_20_info() { echo "Extend $toolName for Raspberry Pi"; } step_20_alias() { ALIAS="raspberry"; } step_20() {