1. Check the machine
In the operation, it is found that the machine accessing the extranet cannot use Yum to install the software, so the Yum installation source needs to be configured. If you can, this step can be ignored.
[Email protected] test]# lsb_release-alsb Version:: Core-4.0-amd64:core-4.0-ia32:core-4.0-noarch: GRAPHICS-4.0-AMD64:GRAPHICS-4.0-IA32:GRAPHICS-4.0-NOARCH:PRINTING-4.0-AMD64:PRINTING-4.0-IA32: Printing-4.0-noarchdistributor ID:RedHatEnterpriseServerDescription:Red Hat Enterprise Linux Server release 5.7 (Tika NGA) release:5.7codename:tikanga[[email protected] test]# cd/etc/yum.repos.d/[[email protected] test]# wget Http://mirrors.163.com/.help/CentOS5-Base-163.repo
The files obtained by the intermediate wget need to be $releasever modified to 5
# centos-base.repo## the mirror system uses the connecting ip Address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client. you should use this for centos Updates# unless you are manually picking other mirrors.## if the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead.##[base]name= centos-5 - base - 163.combaseurl=http://mirrors.163.com/centos/5/os/$basearch/#mirrorlist = Http://mirrorlist.centos.org/?release=5&arch= $basearch &repo=osgpgcheck=1gpgkey=http:// Mirror.centos.org/centos/rpm-gpg-key-centos-5#released updates [updates]name=centos-5 - updates - 163.combaseurl=http:/ /mirrors.163.com/centos/5/updates/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release=5&arch=$ basearch&repo=updatesgpgcheck=1gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#packages used/produced in the build but not released[addons]name=centos-5 - addons - 163.combaseurl=http://mirrors.163.com/centos/5/addons/$basearch/#mirrorlist =http:// Mirrorlist.centos.org/?release=5&arch= $basearch &repo=addonsgpgcheck=1gpgkey=http://mirror.centos.org/ Centos/rpm-gpg-key-centos-5#additional packages that may be useful[extras]name= centos-5 - extras - 163.combaseurl=http://mirrors.163.com/centos/5/extras/$basearch/# Mirrorlist=http://mirrorlist.centos.org/?release=5&arch= $basearch &repo=extrasgpgcheck=1gpgkey=http:// Mirror.centos.org/centos/rpm-gpg-key-centos-5#additional packages that extend functionality of existing packages[ centosplus]name=centos-5 - plus - 163.combaseurl=http://mirrors.163.com/centos/5/ centosplus/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release=5&arch= $basearch &repo= centosplusgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#contrib - Packages by centos users[contrib]name=centos-5 - contrib - 163.combaseurl= http://mirrors.163.com/centos/5/contrib/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release=5&arch = $basearch &repo=contribgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5
Yum Clean all clears the original cache
Yum List get Yum listing
If the list data appears as follows, this indicates that the setting was successful
sqlite-devel.i386 3.3.6-7 base sqlite-devel.x86_64 3.3.6-7 base squashfs-tools.x86_64 3.0-4 base squirrelmail.noarch 1.4.8-21.el5.centos base srptools.x86_64 0.0.4-10.el5 base sssd.x86_64 1.5.1-70.el5 base sssd-client.i386 1.5.1-70.el5 base sssd-client.x86_64 1.5.1-70.el5 base sssd-tools.x86_64 1.5.1-70.el5 &Nbsp; base
2. Install Squid
The Yum command is ready to be installed directly online
Yum Install Squid
After the installation is complete, Cd/etc/squid/, modify the contents of the squid.conf file before you modify it, you can back up the file first:
CP squid.conf Squid.conf_bak
Then find http_access deny all in the file and modify it to http_access allow all to indicate that all users have access to the agent.
Also found Http_port 3128 modified to http_port 192.168.3.171:3128 here IP and port is squid proxy IP and port,
This IP is able to access the IP address of the external network machine, if it is the local, you can not modify the address, the following start Squid agent
[[email protected] squid]# squid -k parse[[email protected] squid]# [[ Email protected] squid]# [[email protected] squid]# squid -z2014/07/22 14:43:01| creating swap directories[[email protected] squid]# [[email protected] squid]# [[email protected] squid]# service squid startstarting squid: [ ok ][[email protected] squid]# [[email protected] squid]# [[email protected] Squid]# [[email protected] squid]# netstat -nltpactive internet connections (only servers) Proto recv-q send-q local address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:111 0.0.0.0:* Listen 4341/portmap tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN 22862/(squid) tcp 0 0 0.0.0.0:792 0.0.0.0:* LISTEN 4426/rpc.statd
3. Configure a machine agent that cannot access the extranet
Set up an agent machine to access the external network on other devices that need access to the extranet
Export http_proxy=http://192.168.3.171:3128
This allows machines that do not have access to the external network to access the external network through a machine that can access the extranet, to facilitate the installation of some software,
commands, and so on.