Saturday, May 29, 2010

Howto Block a Port in Squid Proxy , Ubuntu Linux

Here I show a small Squid Access Control technique for blocking a port for all users and open it for a selected user.

Open /etc/squid/squid.conf file by using
# vi /etc/squid/squid.conf

Locate your Access Control List (ACL) section and add configuration directive as shown below:

acl block_ port port 5050
http_access deny block_port
http_access allow all

The above directives will help you to block port 5050

If you wish to allow the above blocked port to a particular IP (192.168.0.101) try as follows:

acl block_port port 1234
acl no_block_port_ip src 192.168.0.101
http_access deny block_port !no_block_port_ip
http_access allow all

Save and Close the file

Restart squid proxy by using
# /etc/init.d/squid restart

No comments: