Parsing the configuration process of RHEL5Squid transparent Proxy Server

Source: Internet
Author: User
Article Title: RHEL5Squid transparent proxy server configuration process parsing. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

I. Environment and operating platform

Xp -- (eth1) AS5 (eth0) -- Internet

192.168.1.0/24 10.0.0.0/8

Linux AS5 + squid-2.6 (RPM)

Ii. Installation

Install the squid-2. 6 rpm package that comes with AS5

Iii. Configuration

Route add default gw 10.100.100.254 // 10.100.100.100.254 connect to the Internet Router address and add the default gateway.

1. squid master configuration file:/etc/squid. conf

A. http_port 3128 transparent // enable transparent mode

B. cache_dir ufs/var/spool/squid 1000 16 256

C. cache_mem 96 M

D. visible_hostname localhost

E. http_access allow all

The above is the basic configuration

2. iptales Configuration

#! /Bin/bash

# Ip. sh

Echo '1'>/proc/sys/net/ipv4/ip_forward // enable ip forward

IPT =/sbin/iptables

############################### Clear ip rules ##### ################

$ Ipt-f-t filter

$ Ipt-x-t filter

$ Ipt-z-t filter

$ Ipt-f-t nat

$ Ipt-z-t nat

$ Ipt-x-t nat

################################ Default policy ###### ###############

$ Ipt-p FORWARD DROP

$ Ipp-input DROP

$ Ipp-output DROP

############################### User rules ###### ####################

$ Ipt-t filter-a input-s 127.0.0.1-j ACCEPT

$ Ipt-filter-a input-s 10.10.10.254-p tcp -- dport 22-j ACCEPT

$ Ipt-filter-a output-d 10.10.10.254-p tcp -- sport 22-j ACCEPT

$ EPT-t filter-a input-s 192.168.1.0/24-p icmp -- icmp-type 8-j ACCEPT

$ EPT-t filter-a output-d 192.168.1.0/24-p icmp -- icmp-type 0-j ACCEPT

$ Ipt-t filter-a input-s 192.168.1.0/24-j ACCEPT

$ Ipt-t filter-a input-I eth0-j ACCEPT

$ Ipt-t filter-a output-d 192.168.1.0/24-j ACCEPT

$ Ipt-t filter-a output-o eth0-j ACCEPT

$ Ipt-t filter-a forward-s 192.168.1.0/24-I eth1-o eth0-j ACCEPT

$ Ipt-t filter-a forward-I eth0-o eth1-j ACCEPT

$ Ipt-a FORWARD-m state -- state ESTABLISHED, RELATED-j ACCEPT

$ Ipt-t nat-a postrouting-s 192.168.1.0/24-o eth0-j SNAT -- to-source 10.10.10.249

$ Ipt-t nat-a prerouting-s 192.168.1.0/24-I eth1-p tcp -- dport 80-j REDIRECT -- to-ports 3128

4. Start squid

1. # squid-k parse // check squid syntax

2. # squid-z // initialize squid and create Cache

3. #/etc/init. d/squid start

4. # ps-ef | grep squid

V. Client Configuration

Configure the gateway and DNS on XP without configuring a proxy. You can use IE to connect to the Internet. OK.

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.