Firewall (9)-prohibit access to our web within a certain period of time

First we have to prepare a linux virtual machine.
Then we have to install the apache service on our virtual machine: yum install httpd -y and
then we can curl the following our host to see if it can be accessed: it is
Insert picture description here
found to be accessible
Next, first empty our iptables: iptables -F
then execute Core operation (the reason why port 80 is forbidden is because port 80 is the port for Apache's external services, and 09:00 and 11:00 are UTC time, which can be viewed through the date -u command)
Insert picture description here

iptables -A OUTPUT -p tcp --dport 80 -m time --timestart 09:00 --timestop 11:00 -j DROP
Insert picture description here
found that it is no longer accessible.
When we enter again:
Insert picture description here

Insert picture description here
Can visit again at this time
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_48445640/article/details/109247228