squid和bond0

来源:互联网 发布:淘宝店保证金多少 编辑:程序博客网 时间:2024/06/01 09:03
squid

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

yum install squid -y


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

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


systemctl restart squid



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

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


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



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

yum install squid -y


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

60 cache_peer 172.25.254.124 parent 80 0 no-query


systemctl restart squid

测试:


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

测试:

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

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




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


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


监控命令:

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


然后 ifconfig eth0 down  ##断开eth0


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




原创粉丝点击