WSL2 设置代理
- 打开 Clash 的
Allow LAN - 在
~/.bashrc最下方添加host_ip=$(cat /etc/resolv.conf |grep "nameserver" |cut -f 2 -d " ") alias setproxy="export all_proxy=http://$host_ip:7890;export http_proxy=http://$host_ip:7890;export https_proxy=http://$host_ip:7890;" alias unsetproxy="unset all_proxy;unset http_proxy;unset https_proxy;" - 使用
setproxy启动代理,unsetproxy关闭代理
参考文章 : 为 WSL2 一键设置代理

浙公网安备 33010602011771号