免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1783 | 回复: 7
打印 上一主题 下一主题

[求助]squid一经运行成功但还是不能上网,见我配的squid.conf [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-04-15 14:27 |只看该作者 |倒序浏览
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

论坛徽章:
0
2 [报告]
发表于 2006-04-15 14:28 |只看该作者
还有,现在客户端能PING通ETH2(就是外网那个网卡),但PING不通外网那个网关

论坛徽章:
0
3 [报告]
发表于 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 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2006-04-15 16:35 |只看该作者
自动ip_forward也解决了,在/etc/sysctl.conf 改ip_forward = 1即可

论坛徽章:
0
5 [报告]
发表于 2006-04-15 19:30 |只看该作者
都没人理我???
看来要用代理上网必须得设代理地址和端口。

测试时发现新问题,flashget和nettransport不无下载,工具的代理已经设了,但提示http错误。比如在赢政下载,首先工具链结的是一个.asp的文件,再通过它指向真正的所要下载的资源的地址,而错误就出在这个时候

论坛徽章:
0
6 [报告]
发表于 2006-04-15 22:17 |只看该作者
赢政下载

论坛徽章:
0
7 [报告]
发表于 2006-04-15 23:12 |只看该作者
我只在赢政、软件万花筒试了一下,用工具不能下载,怎么?楼上的有何高见?

论坛徽章:
0
8 [报告]
发表于 2006-04-16 13:21 |只看该作者
忍不住又跑到公司调试,原来是少了一句httpd_accel_host virtual,透代成功,可以用下载工具下载了,HOHO,速度超快,哈哈哈
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP