Forum

can Hiawatha reference a list of IPs as a variable?

jeff_melton
22 February 2016, 15:29
I'm using a monitoring service that may send requests from a number of different IPs that I can't consolidate into a single CIDR reference. I'd like to be able to

set MonitorService = <ip0>, <ip1>, ..., <ip18>


Then use that variable in the BanlistMask, LogfileMask and RequestLimitMask settings. Since Hiawatha won't start when I do that, I assume it doesn't support a list of IPs as a variable. Am I wrong, or is there not currently a way to do this?
Hugo Leisink
22 February 2016, 15:35
The variables you set work as a simple text search and replace option. So, anywhere Hiawtha finds 'MonitorService', it will replace it with '<ip0>, <ip1>, ..., <ip18>'. The BanlistMask, LogfileMask and RequestLimitMask settings have the same value pattern: (allow|deny) <ip-address>[/netmask]. Use that also in the value for MonitorService.

set MonitorService = allow <ip0>, allow <ip1>, ..., allow <ip18>, deny all
jeff_melton
22 February 2016, 16:23
Excellent! Thank you!
This topic has been closed.