Chinaunix

标题: 请问单网卡如何做web cache? [打印本页]

作者: ns_peanut    时间: 2009-09-04 18:38
标题: 请问单网卡如何做web cache?
用FB+PF+squid做个透明代理。vlan10为192.168.2.0/24和vlan20为192.168.3.0/24分别接入交换机,web cache server(192.168.1.2)在vlan30中。在squid FAQ里都是cisco的WCCP+FB上建个GRE接口来实现的,但我是H3C的设备没用WCCP功能只能通过webcache redirect-vlan来实现web cache重定向功能,将vlan10和vlan20的http报文劫持到vlan30的192.168.1.2,请问有高手知道这样应该如何在FB上进行配置吗?

我的网络结构图和部分配置如下:

         internet
               |
               |
vlan10--switch--vlan20
      (H3C S3600)
               |
               |
           vlan30
(web cache server 192.168.1.2)

1.配置pf.conf
rdr inet proto tcp from any to any port = www -> 127.0.0.1 port 3128
pass out proto tcp from 192.168.1.2 to any
pass out proto tcp from any port = 80 to any
pass in proto tcp from any port  = 80 to 192.168.1.2
pass in proto eth from 192.168.1.1 to 192.168.1.2

2.配置/etc/sysctl.conf
net.inet.ip.forwarding=1

3.配置squid.conf
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_uses_host_header on
httpd_accel_with_proxy on
httpd_accel_single_host off

[ 本帖最后由 ns_peanut 于 2009-9-6 16:09 编辑 ]




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2