Squid controls Internet access behavior

Source: Internet
Author: User
Use squid to control the Internet access. Modify the squid configuration file/etc/squid. conf and add the custom ACL after the default ACL rule.
1 # forbidden file type 2 ACL denyfiles urlpath_regex-I \. MP3 $ \. avi $ \. zip $ \. RAR $ \. EXE $ \. ISO $3 # list of prohibited websites 4 ACL denysites url_regex-I "/etc/squid/denysites"
List of prohibited websites
[[email protected] squid]#cat denysitesweb2.qq.com
  
Add http_access corresponding to ACL in the/etc/squid. conf file and add it in "# insert your own rule (s) here to allow access from your clients. If no prompt is displayed, add the IP address before "allow access to the IP address.
http_access allow testhttp_access deny denyfileshttp_access deny denysiteshttp_access allow localnet
NOTE: If both test and localnet are the IP addresses of the local hosts that are allowed to be accessed, the IP addresses in localnet cannot access the websites in "denyfiles and denysites", and the IP addresses in "test" can be accessed normally.

Pay attention to the order of their http_access. Because access denied control is not implemented before test, and access denied control has been implemented before localnet, the IP addresses in test are not restricted by "denyfiles and denysites, the IP address in localnet is restricted and cannot access websites in "denyfiles and denysites.
 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.