Iptables rules to limit time & quota based access

Here are the rules i have add to my GNU/Linux Firewall to limit time and quota for my kids for internet and Xbox live

To limit Quota ( I have just allotted 2GB will increase later on)

iptables -I FORWARD 5  -s -p tcp -m quota –quota 2147483648 -j ACCEPT

iptables -I FORWARD 6  -s  -j DROP

For quota ofcourse i have to reset the quota again. I will try to automate it some how

To limit time

iptables -I FORWARD 7 -s -p tcp -m multiport –dport http,https -o eth0 -i eth1     -m time –timestart 16:00 –timestop 18:00 –weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun -j ACCEPT

Reference:  http://linuxgazette.net/108/odonovan.html

(Above said link had a little typo in time based rule is –days instead of –weekdays

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s