安装squid

apt install squid

squid开启路由转发

配置网关

route add default gw 192.168.40.132

开启转发功能

sysctl -w net.ipv4.ip_forward=1

Q.E.D.