Search Posts on Binpipe Blog

Time Limit Using IPTABLES

Many people might not have gauged the power of IPTABLES!

One of the nice features is that you can use it to limit the time limit outbound traffic is allowed to pass through this firewall. (Say you have a windows network and this Linux machine is the gateway and you want to limit the time limit within which the user can access internet using iptables.)
You will realise that most software firewalls like Untangle or Smoothwall dont provide the feature of Time Limit Control in their open source versions. So fear not, heres the way to go!

To limit Time of Internet Access Allowed (You can change the time parameters in the rule as per your requirement):

iptables -I FORWARD 7 -s <SOURCEIP> -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

No comments:

Post a Comment

Hi, Leave a comment here and one of the binary piper's will reply soon :)