代理出问题了(急啊)

由 mch 在 04-08-2004 19:33 发表:

代理出问题了(急啊)

我用REDHAT9.0代理,SQUID+IPTABLES现在重新做了,却出现了问题,现在客户端上不了网的

以前一样的做法都可以的,是怎么回事呢

vi /etc/squid/squid.conf

http_port 3128

cache_mem 16 MB

cache_swap_low 75

cache_swap_high 85

maximum_object_size 4096 KB

maximum_object_size_in_memory 8 KB

ipcache_size 1024

ipcache_low 90

ipcache_high 95

fqdncache_size 1024

cache_dir ufs /var/spool/squid 1000 16 256

cache_access_log /var/log/squid/access.log

cache_log /var/log/squid/cache.log

pid_filename /var/run/squid.pid

client_netmask 255.255.255.0

auth_param basic children 5

auth_param basic realm Squid proxy-caching web server

auth_param basic credentialsttl 2 hoursacl our_networks src 192.168.1.0/24

http_access allow our_networks

http_access allow localhost

http_access deny all

cache_mgr your_email

cache_effective_user squid

cache_effective_group squid

visible_hostname proxy

httpd_accel_host yourhost.yourdomain

httpd_accel_port 80

httpd_accel_with_proxy on

httpd_accel_uses_host_header on-------这几行是实现透明代理的关键

保存后,启动squid:/etc/iniit.d/squid start

2.设定iptables规则

echo 1 >/proc/sys/net/ipv4/ip_forward

/sbin/iptables -t nat -A PREROUTING -i eth1 -p tcp -s 192.168.1.0/24 --dport 80 -j REDIRECT --to-ports 3128

/sbin/iptables -t

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus