Martineau
Part of the Furniture
@Martineau can you share the script you have made?
I write scripts for personal use - the amount of time and effort to 'publish it officially' and adapt it to accommodate every weird user environment isn't something I need to expend, given the script provides ample help and examples for its intended original design usage.…... there isn't much documentation on this script as you haven't posted it officially?
The script probably won't fully address your non-standard requirements, but should show what commands are required to achieve your unique goal.
You should then be able to test the script interactively and also display its helpful syntax and examples.So I created the file "BlockWiFiClient.sh" in /jffs/scripts/ and did the chmod a+rx on it.
Once you are satisfied with the interactive script testing, and have identified the appropriate parameters then yes you will need to use firewall-start to ensure your custom rules are applied during the boot process.From what I understand I should create another script in the same folder called "firewall-start".
And in this I should include:
"/jffs/scripts/BlockWiFiClient.sh 192.168.1.51 192.168.1.23 accept"
Is that correct?
The script defaults to the following three psuedo rules (assuming .22 and .33 are the two LAN resources you wish to grant access to from the nominated client IP range)How do I block a range of IP adresses (192.168.1.51-192.168.1.254) from accessing a range of other IP's? 192.168.1.1-192.168.1.50
Code:
Rule1 - ALLOW access from 192.168.1.51-192.168.1-254 to 192.168.1.22 -j ACCEPT
Rule2 - ALLOW access from 192.168.1.51-192.168.1-254 to 192.168.1.33 -j ACCEPT
Rule3 - BLOCK access from 192.168.1.51-192.168.1-254 to 192.168.1.0/24 -j DROP
Code:
Rule3 - BLOCK access from 192.168.1.51-192.168.1-254 to 192.168.1.1-192.168.1.50 -j DROP
Furthermore, as you require two non-contiguous CIDR IP ranges, Rules 1-3 will each need to be expanded into multiple CIDR rules.
EDIT: Having reviewed your unusual requirements, I suspect that a simplified bespoke BlockWiFiClient.sh script will be required.
Last edited: