time base restriction with iptables ?

Taking care of your Linux box.

time base restriction with iptables ?

Postby kashif » Wed Jun 10, 2009 11:06 am

aoa,

I am able to restrict the squid traffic through time base ACL in squid.

I am not using masquerade and forwarding per ip like


Code: Select all


-A FORWARD -s 17x.x.53.54 -p tcp -m tcp --dport 443 -j ACCEPT

-A FORWARD -s 17x.x.53.54 -p tcp -m tcp --dport 1863 -j ACCEPT

-A FORWARD -s 17x.x.53.54 -p tcp -m tcp --dport 5190 -j ACCEPT
.
.
.
.

and at end

-A FORWARD -p tcp -m tcp --dport 443 -j DROP
-A FORWARD -p tcp -j DROP
-A FORWARD -p udp -j DROP



Now problem is that I want to allow above mentioned traffic from 9 to 5 pm only, and should be restricted for rest of the hours.


How to accomplish this task?
**********************************************

As-Salaatu was-Salaamu Alaika Ya Sayyidi Ya Rasool ALLAH

**********************************************
kashif
Naib Subedar
 
Posts: 305
Joined: Wed Oct 15, 2003 2:44 am
Location: Okara

Postby osama » Wed Jun 10, 2009 5:25 pm

You should create 2 scripts and call those scripts through cron at required times.
Or create one script with if-else statements checking time then call that script in cron at required times
osama
Havaldaar
 
Posts: 117
Joined: Fri Aug 22, 2008 9:08 am


Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 2 guests

cron