Chinaunix
标题:
[求助]squid一经运行成功但还是不能上网,见我配的squid.conf
[打印本页]
作者:
shinesky
时间:
2006-04-15 14:27
标题:
[求助]squid一经运行成功但还是不能上网,见我配的squid.conf
eth2 外网 229.146.115.76 DNS:221.53.149.13 gateway:229.146.115.73
eth1 内网 192.168.0.1 /24
以下是我根据网上的教程写的配置,高手们指教一下,小弟弄了三天了都没弄通,救救我.另外客户PC需要如何设置?
/etc/squid.conf (其中其它默认的项目用#标没有改动)
http_port 3128
icp_port 3130
cache_mem 256 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 40960 KB
maximum_object_size_in_memory 4096 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
fqdncache_size 1024
cache_dir ufs /var/spool/squid 40000 16 256
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 53 #DNS
acl CONNECT method CONNECT
acl inside src 192.168.0.0/24 (内网)
http_access allow all
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports (这两句是默认的,但我没看懂)
http_reply_access allow all
icp_access allow all
cache_effective_user squid
cache_effective_group squid
httpd_accel_port 80
httpd_accel_single_host off
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
coredump_dir /var/spool/squid
iptables:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth2 -j SNAT --to 229.146.115.76
iptables -t nat -A PREROUTING -s 192.168.0.0/24 -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -A INPUT -i eth1 -p udp -m multiport --dports 53 -j ACCEPT
作者:
shinesky
时间:
2006-04-15 14:28
还有,现在客户端能PING通ETH2(就是外网那个网卡),但PING不通外网那个网关
作者:
shinesky
时间:
2006-04-15 15:23
研究了半天,设置一下网卡间的转发功能就OK了,但每次系统重启就需要再输入一次
echo 1 > /proc/sys/net/ipv4/ip_forward,我写到rc.local里还是不行,它自动运行是在什么地方设置?
现在还有一个问题,我用squid做透明代理,客户端需要在IE里面设置代理服务器地址才能正常上网,能有什么办法客户端除了IP地址其它的什么都不用设就可以上网的
[
本帖最后由 shinesky 于 2006-4-15 15:27 编辑
]
作者:
shinesky
时间:
2006-04-15 16:35
自动ip_forward也解决了,在/etc/sysctl.conf 改ip_forward = 1即可
作者:
shinesky
时间:
2006-04-15 19:30
都没人理我???
看来要用代理上网必须得设代理地址和端口。
测试时发现新问题,flashget和nettransport不无下载,工具的代理已经设了,但提示http错误。比如在赢政下载,首先工具链结的是一个.asp的文件,再通过它指向真正的所要下载的资源的地址,而错误就出在这个时候
作者:
phpman
时间:
2006-04-15 22:17
赢政下载
作者:
shinesky
时间:
2006-04-15 23:12
我只在赢政、软件万花筒试了一下,用工具不能下载,怎么?楼上的有何高见?
作者:
shinesky
时间:
2006-04-16 13:21
忍不住又跑到公司调试,原来是少了一句httpd_accel_host virtual,透代成功,可以用下载工具下载了,HOHO,速度超快,哈哈哈
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2