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

Re: Limiting internet access by time



On 08/05/2016 03:02 AM, Mark Fletcher wrote:
> On a stretch box I have, I want to allow access to the Internet between the
> hours of 9am and 9pm and block it between 9pm and 9am. Ideally allow local
> network access throughout but block Internet access between 9pm and 9am,
> but I can accept total network blockage in the off times if necessary.
[snip]

iptables has some match extensions that will work with UTC time,
specifically the extensions --timestart and --timestop  Using those you
should be able to make rules that operate all the time but block traffic
during the specified hours.  The only issues there are the UTC itself
and, maybe, problems with standard time versus daylight savings time
locally.

It can also be modified to vary for certain days of the week using
--weekdays

See the manual page for iptables-extensions(8) for the details on those.

Regards,
Lars


Reply to: