FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14175 questions

16819 answers

27671 comments

54159 members

0 votes
143 views 0 comments
by

Is it possible to restrict access to certain applications when a monthly data limit has reached i.e.

  • Tier 1 (always) - Application A 
  • Tier 2 (only when data limit is <250mb per month). Application B, C, D etc

We don't want to cut-off all traffic, but restrict some types (based on destination IP or port), if/when a predefined limit has been reached on a monthly basis?

1 Answer

–1 vote
by

Hi,

This would require a custom script and a few commands that should act on different conditions.

The first one you should act on is mdcollectdctl1. This command will give you various information about the usage of the data on your SIM that is being collected. What you can do with it is collect data of the month, once it reaches the limit you have - add and activate firewall rules:

To add them and change them I would suggest using UCI:





[email protected][24].enabled='1'
[email protected][24].src='lan'
[email protected][24].proto='tcp udp'
[email protected][24].dest='wan'
[email protected][24].name='block'
[email protected][24].dest_ip='79.98.28.174'
[email protected][24].target='DROP'
You can add these using uci add command.
Once you add all of these use uci commit firewall and luci-reload to save and reload.
Once you do this, traffic rule should be activated and working.
EB.
Best answer