squid服务以及bond网卡阵列
##########squid正向代理###
拥有网络的主机:[[email protected] network-scripts]# yum install squid -y ##安装squid服务
[[email protected] network-scripts]# systemctl start squid
[[email protected] network-scripts]# netstat -antlpe |grep squid ##查看网络接口
tcp6 0 0 :::3128 :::* LISTEN 0 148895 15807/(squid-1)
[[email protected] network-scripts]# vim /etc/squid/squid.conf ##编辑配置文件
58 http_access allow all
64 cache_dir ufs /var/spool/squid 100 16 256
[[email protected] network-scripts]# systemctl restart squid
测试结果:
#########squid反向代理###
#加速:
[[email protected] html]# yum install squid -y[[email protected] html]# vim /etc/squid/squid.conf ##编辑配置文件
http_port 80 vhost vport
cache_peer 172.25.254.106 parent 80 0 no-query originserver
[[email protected] html]# systemctl restart squid
轮叫机制:
[[email protected] html]# 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 ##出现1次
cache_peer 172.25.254.133 parent 80 0 no-query originserver name=web2 round-robin weight=3 ##出现3次
cache_peer_domain www.westos.com web1 web2
[[email protected] html]# systemctl restart squid
测试结果:
######网卡阵列bond#####
[[email protected] Desktop]# nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.106/24 ##创建网卡阵列active-backup模式的bond0Connection 'bond0' (1d1f7a40-9311-428e-988c-b71e8e4206e9) successfully added .
[[email protected] Desktop]# nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0 ##将eth0网卡添加进入该阵列中
Connection 'eth0' (05a9733b-1af7-43fd-8571-4fec796c97bb) successfully added.
[[email protected] Desktop]# nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0 ##将eth1网卡添加进入该阵列中
Connection 'eth1' (f4f5b1ec-1fa8-4227-92ae-93d84c7b4ec2) successfully added.
[[email protected] Desktop]# ifconfig eth0 down ##模拟网卡损坏,进行测试
[[email protected] Desktop]# ifconfig eth0 up
[[email protected] Desktop]# ifconfig eth1 down