squid

1.正向代理
在真机连接网络并下载软件

yum install squid -y

squid和bond0

vim /etc/squid/squid.conf   
 56 http_access allow all

 62 cache_dir ufs /var/spool/squid 100 16 256     ##缓存文件的目录和文件数目

squid和bond0

systemctl restart squid

squid和bond0


测试;
在客户端浏览器访问,然后edit>preferences>设置>Network>setting>manual..

http:172.25.254.24  port:3128    ##访问端口为3128

squid和bond0

访问www.baidu.com可以,但是ping www.baidu.com不行

squid和bond0

squid和bond0


2.反向代理(环境纯净,没有httpd)
server主机

yum install squid -y

squid和bond0

vim /etc/squid/squid.conf
59 http_port 80 vhost vport

60 cache_peer 172.25.254.124 parent 80 0 no-query

squid和bond0

systemctl restart squid

squid和bond0

测试:

squid和bond0

3.轮叫
vim /etc/squid/squid.conf
http_port 80 vhost vport
cache_peer 172.25.254.124 parent 80 0 no-query originserver name=web1 round-robin  (weight=1  ##轮叫几次)   
cache_peer 172.25.254.100 parent 80 0 no-query originserver name=web2 round-robin

cache_peer_domain  www.westos.com web1 web2

squid和bond0

测试:

第一次点击,访问的是172.25.254.124主机的

squid和bond0

第二次点击,访问的是172.25.254.99主机的

squid和bond0



bond0

1.链路聚合

nmcli connection add con-name bond0  ifname bond0 type bond mode active-backup ip4 172.25.254.124/24      ##添加主动备份模式的bond0,ip4为172.25.254.124

squid和bond0

squid和bond0

nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0

nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0

squid和bond0

监控命令:

watch -n 1 cat /proc/net/bonding/bond0

squid和bond0

然后 ifconfig eth0 down  ##断开eth0

squid和bond0

eth1会接替eth0,并且网络始终没有断开

squid和bond0



相关文章:

  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2021-12-24
  • 2021-09-13
  • 2021-09-10
  • 2021-10-06
  • 2021-05-21
  • 2022-12-23
相关资源
相似解决方案