LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-10-2009, 12:28 AM   #1
LinuxLover
Member
 
Registered: Feb 2004
Distribution: Centos 7 x86_64 , Rocky Linux 8 (aarch64)
Posts: 196

Rep: Reputation: 32
time base restriction for internet ?


Hi I am using squid in RHEL4 for net traffic and able to restrict traffic of port 80 by time base ACL.

But so for I am unable to time base restrict the traffic for other ports like port 443 , 5190 , 1863 etc

I am not using masquerade , instead forwarding every ip (for better control ) like

Code:
-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 trafic from 9 to 5 pm only, and should be restricted for rest of the hours.


How to accomplish this task?
 
Old 06-10-2009, 01:25 AM   #2
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Put your firewall rules into cron as scripts, that way you can switch then on and off as you need.
 
Old 06-10-2009, 01:33 AM   #3
LinuxLover
Member
 
Registered: Feb 2004
Distribution: Centos 7 x86_64 , Rocky Linux 8 (aarch64)
Posts: 196

Original Poster
Rep: Reputation: 32
Thanks for your reply,

I have this idea in mind and can enable rule by a script through cron.

But not sure how to disable them because there are 200+ lines in iptables and line numbers also changes when new rule inserted/added. so that disturb the sequence of line.
 
Old 06-10-2009, 01:36 AM   #4
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466
Blog Entries: 6

Rep: Reputation: 51
LinuxLover if you dont mind..can you explain me more regarding this:
Code:
forwarding every ip (for better control ) like
What is the full command? Explanation too is welcome.
please sugest.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Measure Time in Linux with Time Base LXer Syndicated Linux News 0 04-11-2007 06:46 AM
download restriction over internet access using squid (proxy server) pankajkarde Linux - Server 4 03-21-2007 01:04 AM
firewall internet restriction hariiyer Linux - Security 4 11-16-2006 01:41 PM
Text Base Internet teddy_t3 Linux - Software 4 06-05-2004 11:10 PM
time base iptables rule karunesh Linux - Security 4 12-10-2003 10:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration