Linux运维工程师技术文档十一(代理服务器)

squid 192.168.10.253

cd /etc/squid/

vim squid.conf

透明代理的核心思路就是配置防火墙

iptables -t nat -A PREROUTING -s 192.168.10.0/24 -i ens33 -p tcp – m tcp –dport 80 -j REDIRECT 

–to-ports 3129

iptables -L -t nat

systemctl restart squid

systemctl status squid

openssl genrsa -out  s.key   创建私钥

openssl req -new -key s.key  -out s.csr 

openssl x509 -req -in s.csr -signkey s.key -out s.crt

vim squid.conf

 

/usr/lib64/s

/usr/lib64/squid/ssl_crtd -c -s /var/lib/ssl_db      让它生效

chown squid:squid /var/lib/ssl_db

cd /var/lib/ssl_db/

ls

cd/

 iptables -L -t nat

systemctl restart squid

systemctl status squid

题目:配置squid访问控制列表,限制访问电商网站(以拼多多和淘宝为例)

vim squid.conf

资源下载: