实验环境

主机用途 IP
客户端 10.10.100.11
网关 10.10.100.12 ,192.168.65.160
网站 192.168.65.161

客户端配置

  • 配置网关

     route add default gw 10.10.100.12
    

网关配置

  • 1.开启转发
sysctl -w net.ipv4.ip_forward=1
  • 2.配置squid代理
  • nano /etc/squid/squid.conf
http_port 3128
http_port 3129 intercept
http_access allow all #为了方便起见允许了全部规则(偷个懒~~)