在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

Squid+stunnel如何实现代理内网访问

134次阅读
没有评论

共计 3548 个字符,预计需要花费 9 分钟才能阅读完成。

本篇文章为大家展示了 Squid+stunnel 如何实现代理内网访问,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

云计算的最终目标是将计算、服务和应用作为一种公共设施提供给公众,使人们能够像使用水、电、煤气和电话那样使用计算机资源。云计算模式即为电厂集中供电模式。在云计算模式下,用户的计算机会变的十分简单,或许不大的内存、不需要硬盘和各种应用软件,就可以满足我们的需求。下面讲给大家分享一些云计算的开发技术,今天分享 Squid + stunnel 实现代理内网访问 http https。

环境:

机器 A:10.25.241.188 外网 ip 就不提供了  (可以连接外网和阿里云服务器内网)

机器 B:10.81.48.156(只有内网)

实现:在机器 B 上面可以访问 http 和 https

1)安装 squid

yum 命令直接在线安装 squid

[root@openstack ~]# yum install -y gcc openssl openssl-devel #依赖软件要先提前安装

[root@openstack ~]# yum install squid

安装完成后,修改 squid.conf 文件中的内容,修改之前可以先备份该文件

[root@openstack ~]# cd /etc/squid/

[root@openstack squid]# cp squid.conf squid.conf_bak

[root@openstack squid]# vim squid.conf

http_access allow all # 修改 deny 为 allow

http_port 3128

cache_dir ufs /var/spool/squid 100 16 256 打开这个注释 保证这个目录存在

2)启动 squid,启动前进行测试和初始化

[root@openstack squid]# squid -k

[root@openstack squid]# squid -z # 初始化  

[root@openstack squid]# systemctl start squid

安全组打开 3128 端口

3)安装 stunnel 服务端

[root@dev-new-test1 ~]# cd /usr/local/src/

[root@dev-new-test1 src]# pwd

/usr/local/src

官网下载:http://www.stunnel.org/downloads.html

[root@dev-new-test1 ~]#yum install -y openssl openssl-devel gcc

[root@dev-new-test1 src]# ls

stunnel-5.45.tar.gz

[root@dev-new-test1 src]# tar -zvxf stunnel-5.45.tar.gz

[root@dev-new-test1 src]# ls

stunnel-5.45 stunnel-5.45.tar.gz

[root@dev-new-test1 src]# cd stunnel-5.45

[root@dev-new-test1 stunnel-5.45]# ./configure

[root@dev-new-test1 stunnel-5.45]# make make install

安装完成后,配置 stunnel.conf

[root@dev-new-test1 stunnel-5.45]# cd /usr/local/etc/stunnel/

[root@dev-new-test1 stunnel]# ls

stunnel.conf-sample

[root@dev-new-test1 stunnel]# cp stunnel.conf-sample stunnel.conf

[root@dev-new-test1 stunnel]# ls

stunnel.conf stunnel.conf-sample

[root@dev-new-test1 stunnel]#vim stunnel.conf # 把原来内容清空,写入:

cert = /usr/local/etc/stunnel/1.pem

client = no

[squid]

accept = 8088

connect = 127.0.0.1:3128 # 运行本机 stunnel 端口 8088 连接 squid 服务端 192.168.1.5 的 3128 端口,然后在 /etc/profile 里配置本机 8088 端口代理(如下)

cert = /usr/local/etc/stunnel/1.pem 

生成证书:

openssl req -new -x509 -days 365 -nodes -out stunnel.pem -keyout 1.pem

openssl gendh 512 1.pem

cat stunnel.pem   1.pem

4)启动 stunnel 服务

[root@dev-new-test1 stunnel]# /usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf

[root@dev-new-test1 stunnel]# ps -ef|grep stunnel

root 20281 1 0 02:23 ? 00:00:00 /usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf

root 20283 13002 0 02:23 pts/0 00:00:00 grep –color stunnel

[root@dev-new-test1 stunnel]# lsof -i:8088

客户端内网服务器配置:

1)安装 stunnel 客户端

[root@dev-new-test1 ~]# cd /usr/local/src/

[root@dev-new-test1 src]# pwd

/usr/local/src

官网下载:http://www.stunnel.org/downloads.html

[root@dev-new-test1 ~]#yum install -y openssl openssl-devel gcc

[root@dev-new-test1 src]# ls

stunnel-5.45.tar.gz

[root@dev-new-test1 src]# tar -zvxf stunnel-5.45.tar.gz

[root@dev-new-test1 src]# ls

stunnel-5.45 stunnel-5.45.tar.gz

[root@dev-new-test1 src]# cd stunnel-5.45

[root@dev-new-test1 stunnel-5.45]# ./configure

[root@dev-new-test1 stunnel-5.45]# make make install

安装完成后,配置 stunnel.conf

[root@dev-new-test1 stunnel-5.45]# cd /usr/local/etc/stunnel/

[root@dev-new-test1 stunnel]# ls

stunnel.conf-sample

[root@dev-new-test1 stunnel]# cp stunnel.conf-sample stunnel.conf

[root@dev-new-test1 stunnel]# ls

stunnel.conf stunnel.conf-sample

[root@dev-new-test1 stunnel]#vim stunnel.conf # 把原来内容清空,写入:

client = yes

[https]

accept = 127.0.0.1:8099

connect = 10.25.241.188:8088 # 本地服务的 8099 端口连接服务端的 8088 端口

2)配置 /etc/profile 系统环境变量

底部添加下面两行

[root@dev-new-test1 stunnel]# vim /etc/profile

……………

export http_proxy=http://10.25.241.188:3128

export https_proxy=http://127.0.0.1:8099

[root@dev-new-test1 stunnel]# source /etc/profile

测试:

[root@dev-new-test1 stunnel]# curl http://www.baidu.com

[root@dev-new-test1 stunnel]# curl https://www.baidu.com 

上述内容就是 Squid+stunnel 如何实现代理内网访问,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注丸趣 TV 行业资讯频道。

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-25发表,共计3548字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 亚洲中文字幕无码中字 | 宅男在线精品观看 | 黄色大片影院视频免费 | 精品久久久久久成人av | 日本精品视频 | 久久精品五福影院1421 | 十四以下岁毛片带血a级 | 亚欧精品一区二区三区 | 欧洲-级毛片内射 | 亚洲三级成人 | 久热精品在线观看 | 欧美乱妇狂野欧美在线视频 | 在线视频一区二区三区在线播放 | 国产一级片 | 18禁免费无码无遮挡不卡网站 | 特级毛片s级全部免费 | 成人亚洲视频在线观看 | 欧美一级毛片免费看高清 | 亚洲va国产va欧美va综合 | 欧美xxxx做受欧美人妖 | 综合图片亚洲网友自拍 | 亚洲永久精品ww47 | www.一区二区三区.com | 久久久久久夜精品精品免费 | 野外做受又硬又粗又大视频√ | 欧美一级特黄aa大片视频 | 永久免费在线观看 | 大地资源网第二页免费观看 | 97香蕉碰碰人妻国产欧美 | 免费成人电影在线观看 | 亚洲精品欧美精品国产精品 | 日本一级全黄大片 | 国产精品久久久久a影院 | 99久久精品毛片免费播放 | 国产在线一区二区三区av | 美女内射毛片在线看免费人动物 | 国产一区二区免费播放 | h在线观看免费 | 国产福利视频奶水在线 | 99热久热这里只精品 | 欧美成人免费观看的 |