免费注册 查看新帖 |

Chinaunix

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

[FreeBSD] freebsd8.3 pf squid transparent没成功 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-04-12 22:27 |只看该作者 |倒序浏览
pf +squid transparen 没有成功,请同志们给予帮助
同志们,求助下,普通代理成功,但透明代理就是不行。。。

######rc.conf#######
hostname="freebsd.org"
ifconfig_em0="DHCP"
ifconfig_em1="inet 10.0.0.5 netmask 255.0.0.0"
defaulrouter="192.168.1.253"
ppp_nat="YES"
keymap="us.iso"
moused_enable="YES"
moused_port="/dev/psm0"
moused_type="auto"
sshd_enable="YES"
squid_enable="YES"

pf_enable="YES"
pf_rules="/etc/pf.conf"
#inetd_enable="YES"
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
gateway_enable="YES"

##########pf.conf#########

ext_if="em0"
int_if="em1"
loop="lo0"
rdr on $int_if inet proto tcp from any to any port www -> 10.0.0.5 port 8080
pass in on $int_if inet proto tcp from any to 10.0.0.5 port 8080 keep state
pass out on $ext_if inet proto tcp from any to any port www keep stat
pass in quick all
pass out quick all

######squid.conf########

acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet  src 192.168.1.0/24
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
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 CONNECT method CONNECT
http_access allow manager localhost
http_access allow  manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access deny all
icp_access allow localnet
icp_access deny all
http_port 10.0.0.5:3128 transparent
hierarchy_stoplist cgi-bin ?
cache_mem 42 MB
cache_dir ufs /var/squid/cache 100 16 256
minimum_object_size 0 KB
maximum_object_size 200 MB
cache_swap_low 70
cache_swap_high 85
access_log /var/squid/logs/access.log squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
connect_timeout 1 minute
cache_mgr freebsd@sina.com
visible_hostname squidserver
coredump_dir /var/squid/cache

论坛徽章:
1
金牛座
日期:2014-05-29 15:55:47
2 [报告]
发表于 2013-04-13 19:48 |只看该作者
本帖最后由 iceblood 于 2013-04-13 19:53 编辑

http_port 8080 transparent

论坛徽章:
0
3 [报告]
发表于 2013-04-14 10:26 |只看该作者
我估计是没有做好重定向,

论坛徽章:
0
4 [报告]
发表于 2013-04-14 10:45 |只看该作者

论坛徽章:
54
2017金鸡报晓
日期:2017-02-08 10:39:42操作系统版块每日发帖之星
日期:2016-03-08 06:20:00操作系统版块每日发帖之星
日期:2016-03-07 06:20:00操作系统版块每日发帖之星
日期:2016-02-22 06:20:00操作系统版块每日发帖之星
日期:2016-01-29 06:20:00操作系统版块每日发帖之星
日期:2016-01-27 06:20:00操作系统版块每日发帖之星
日期:2016-01-20 06:20:00操作系统版块每日发帖之星
日期:2016-01-06 06:20:0015-16赛季CBA联赛之江苏
日期:2015-12-21 20:00:24操作系统版块每日发帖之星
日期:2015-12-21 06:20:00IT运维版块每日发帖之星
日期:2015-11-17 06:20:002015亚冠之广州恒大
日期:2015-11-12 10:58:02
5 [报告]
发表于 2013-04-14 11:31 |只看该作者
squid向个版本的规则不一样,有的需要transparent,有的不需要。

论坛徽章:
0
6 [报告]
发表于 2013-05-07 14:45 |只看该作者
为什么你PF里重定向转到8080端口。
rdr on $int_if inet proto tcp from any to any port www -> 10.0.0.5 port 8080
而你squid却是监听的3128端口?
http_port 10.0.0.5:3128 transparent
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP