美文网首页程序员
Squid透明代理-多公网IP指定出口IP

Squid透明代理-多公网IP指定出口IP

作者: seventeencm | 来源:发表于2017-12-04 23:13 被阅读0次

什么是Squid?

"Squid是一个高性能的代理缓存服务器,Squid支持FTP、gopher、HTTPS和HTTP协议。和一般的代理缓存软件不同,Squid用一个单独的、非模块化的、I/O驱动的进程来处理所有的客户端请求。"摘自百度百科。

安装Squid

yum -y install squid

配置Squid

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed 允许访问IP(只允许这个ip做代理请求)
acl allowip src 14.29.10.100

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

# set out - ip 配置出口IP
acl ip118 myip 14.29.10.118
acl ip119 myip 14.29.10.119
acl ip120 myip 14.29.10.120

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow allowip

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
# 设置代理端口
http_port 3228

#set out-ip 多公网IP关键配置;下面的配置是指
#若使用代理IP14.29.10.118则走ip118的ip(14.29.10.118);
#若使用代理IP14.29.10.119则走ip119的ip(14.29.10.119);
#若使用代理IP14.29.10.120则走ip120的ip(14.29.10.120)
tcp_outgoing_address 14.29.10.118 ip118
tcp_outgoing_address 14.29.10.119 ip119
tcp_outgoing_address 14.29.10.120 ip120

# Squid set log path etc.
dns_nameservers 8.8.8.8
visible_hostname aliserver

#透明代理关键配置
request_header_access Via deny all
request_header_access X-Forwarded-For deny all


cache_mem 100 MB
cache_swap_low 90
cache_swap_high 95

cache_dir ufs /home/squid/cache_dir 100 16 256
cache_access_log /home/squid/logs/access.log
cache_log /home/squid/logs/cache.log
cache_store_log /home/squid/logs/store.log

coredump_dir /home/squid/coredump_dir

pid_filename /home/squid/squid.pid

# Add any of your own refresh_pattern entries above these.
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

初始化Squid

cd /usr/sbin/
./squid -z

启动Squid

cd /usr/sbin
./squid -s

相关文章

  • Squid透明代理-多公网IP指定出口IP

    什么是Squid? "Squid是一个高性能的代理缓存服务器,Squid支持FTP、gopher、HTTPS和HT...

  • 搭建Squid3 密码账号IP代理

    上文中,说明了 Squid3 IP Proxy 隐藏原IP,这里就搭建Squid 3密码账号IP代理进行整理,涉及...

  • 获取公网出口IP地址

    前言 当你的公网服务器服务,需要给别人远程连接,为了安全,需要设置指定IP访问。 获取服务器的公网出口IP地址 可...

  • squid代理配置

    安装Squid 2.允许不同用户使用不同的出口IP 3.设置代理高匿 禁用缓存

  • 匿名程度不同的代理ip

    透明代理ip、匿名代理ip、高匿名代理ip这三者有什么不同? 透明代理(TransparentProxies):服...

  • 快速查询自己的网络是否为公网IP

    一、什么是公网IP? 公网IP是全球唯一的IP地址。公网IP又分为静态公网IP和动态公网IP,可进入路由器查看连接...

  • 获取公网出口ip

    curl https://api.myip.com[https://api.myip.com]

  • 内网服务器翻墙

    标签: socat squid 介绍 内网服务器是指只有内网ip而没有公网ip的服务器。 一般情况下内网服务器无法...

  • 代理iP账密请求https时报错Proxy returns "H

    从公司的私有云机房迁到公有云机房后,对外是五个公网IP随机呈现,购买的代理IP供应商只能绑定一个授权公网IP,因此...

  • 黑群晖外网访问

    黑群晖外网访问有两种情况,分有公网IP/无公网IP。 公网IP:公网IP是唯一的,拥有公网IP的互联网主机中可以通...

网友评论

    本文标题:Squid透明代理-多公网IP指定出口IP

    本文链接:https://www.haomeiwen.com/subject/sowfixtx.html