LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   time base iptables rule (https://www.linuxquestions.org/questions/linux-security-4/time-base-iptables-rule-122271/)

karunesh 12-03-2003 08:51 AM

time base iptables rule
 
I want to change the iptables rules based on the time of the day automatically. Is there any way to do that apart from working with "cron".

:Pengy:

Hangdog42 12-03-2003 12:19 PM

I think you need to take the cron route. As far as I know, iptables has no concept of time.

karunesh 12-03-2003 01:32 PM

Thanks hangdog, actually I was just searcing on net about this then I came accross with "iptables patch-o-matic".And it says that you can create the time base rules.But I am not able to get the actual patch.

:Pengy:

Capt_Caveman 12-07-2003 06:16 PM

You can get patch-o-matic from the Netfilter website, but it is not trivial to implement. IIRC it requires a kernel recompilation to allow patch-o-matic support, (though it may just need to be compiled against the kernel headers, I'm not 100% sure). If you are trying to setup a relatively simple time-based ruleset, I would use cron (as Hangdog42 suggested) to just run two or more different iptables scripts. If you have a very complex time-based ruleset, the POM might be worth the effort of setting it up.

Newest patch-o-matic link:

http://www.netfilter.org/files/patch...030912.tar.bz2

unSpawn 12-10-2003 10:14 AM

I want to change the iptables rules based on the time of the day automatically.
What would you need it for?
Be specific and verbose please if you can.


All times are GMT -5. The time now is 12:05 PM.