內網服務器通過Squid代理訪問外網
阿新 • • 發佈:2018-11-15
-c etc mach rmi port 圖片 ins machine determine
環境說明
項目整體需部署Zabbix監控並配置微信報警,而Zabbix Server並不能訪問外網,故運維小哥找了臺能訪問外網的服務器做Suqid代理,Zabbix Server服務器通過代理服務器訪問外網。
操作說明
[root@squid ~]# echo "1" >/proc/sys/net/ipv4/ip_forward
[root@squid ~]# yum -y install squid
[root@squid ~]# vim /etc/squid/squid.conf
# 配置文件中將deny修改為allow;
# 配置本地ip;
[root@squid ~]# systemctl start squid
[root@squid ~]# systemctl enable squid
[root@zabbix-server ~]# tail -2 /etc/profile
export http_proxy=http://192.168.10.15:3128 export https_proxy=http://192.168.10.15:3128
[root@zabbix-server ~]# curl http://www.baidu.com
[root@zabbix-server ~]# curl https://www.baidu.com
Could not determine this machines public hostname. Please configure one or set ‘visible_hostname‘
在配置文件/etc/squid/squid.conf中添加如下行,重啟即可;
visible_hostname squid.packet-pushers.net
內網服務器通過Squid代理訪問外網