Ubuntu8.04 use Squid as a proxy server

Source: Internet
Author: User
Ubuntu8.04 use Squid as a proxy server-Linux Enterprise Application-Linux server application information. The following is a detailed description. I always wanted to create an Internet proxy server and run Openwrt on WRT54G. I had little knowledge to find, and I was unable to configure it successfully. Now I started running Ubuntu on T23.

Although the configuration is very simple, it can still work, very good and powerful.

First, let's talk about the network configuration of my machine. There are two NICs, one is the Intel 10/100 m nic that comes with the local machine, the other is the smc pcmcia 10/100 M Nic, although at the same time 10/100 M Nic, however, the PCMCIA Nic is much slower than the local Nic. Even if it runs at 100 M, it is estimated that only the bandwidth of the PCI Nic is 10 M. Therefore, the PCMCIA Nic is connected to the Internet, DHCP is set, public IP is obtained, and the Intel Nic is set to static IP: 192.168.2.1, used to connect to the subnet, you can use an Ethernet switch to expand the number of connections, but it is not required for me now, because I only need to connect to my Dell D620.

Step 1: Install
Sudo apt-get install squid

Step 2: Configure squid. conf
Sudo vi/etc/squid. conf

Add a row to set visible_hostname:
Visible_hostname XXXX # XXXX is the name you want

Set the allowed CIDR blocks:
Acl lan src 192.168.2.0/24
Http_access allow lan

The preceding two statements allow subnet proxy, where lan is a temporary alias.

In this way, use the Intel Nic to set an IP address 192.168.2.7 on my D620, set the proxy to 192.168.2.1 and port to 3128 in IE/Firefox, and select "All thanks" to use this proxy, in this way, you can log on to the web page on D620.

Proxies from Intenet are allowed:
Acl wan src 203.94.XX.XX
Http_access allow wan

The preceding two statements allow proxy requests from 203.94.XX.XX.

Step 3: Start Squid
Sudo squid-z
Sudo/etc/init. d/squid reload
Sudo/etc/init. d/squid restart

After testing, proxy requests from the LAN and WAN can be successful. This configuration is still rough and not very secure.

In addition, we have not yet learned how to act as a transparent agent. We will continue to update the agent later.
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.