Re: Iptables "-m time" option doesn't update when the clock changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/04/12 12:31, Sebastian Arcus wrote:
>>> Thanks for the suggestion. However, restarting the firewall (which
>>> flushes and re-writes the rules) makes absolutely no difference. I
>>
>> Did you substitute the changed time? I don't see how using different
>> times in your rules would make no difference. Indeed, if not changing
>> times, reloading the same rules would make no difference.
>
> Sorry - you are right - I didn't substitute the times in the firewall
> rules. On the other hand - a script which would restart the machine is
> easier (in this particular case) - than one which would amend the
> firewall rules and reload them. 

Not sure if this is relevant, but getting a local time in UTC in a shell
script isn't hard:

date --utc -d "$(date "+%H:%M:%S +%z" -d 09:00:00)" +%H:%M:%S

In California right now that gives 16:00:00 and in the UK 08:00:00

You could use that to reload your firewall rules on a daily basis (after
the time the clocks change) or just for the date that the clocks change
(last Sunday in March and October respectively in the UK).

jch
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux