# This file was automatically generated by WSL. To stopautomatic generation of this file, add the following entry to /etc/wsl.conf:# [network]# generateResolvConf = falsenameserver 172.19.80.1 可以看到 DNS 服务器是172.19.80.1,通过环境变量ALL_PROXY配置代理: exportALL_PROXY="http://172.19.80.1...
要找到 Windows 的 IP 地址,可以利用 cat /etc/resolv.conf 命令在 Ubuntu 子系统中查看 DNS 服务器 IP。以 172.19.80.1 为例,通过设置环境变量 ALL_PROXY=:7890,即可完成 WSL2 中的代理配置。别忘了在 Windows 代理客户端上启用对本地局域网的请求权限。为了简化这一过程,可以编写一个 ba...
automatic generationofthisfile,add the following entry to/etc/wsl.conf:#[network]# generateResolvConf=falsenameserver172.19.80.1 可以看到 DNS 服务器是 172.19.80.1,通过环境变量 ALL_PROXY 配置代理: 代码语言:javascript 代码运行次数:0 复制 Cloud Studio代码运行 exportALL_PROXY="http://172.19.80.1:7890...
/bin/bashhost_ip=$(cat /etc/resolv.conf|grep"nameserver"|cut -f2-d" ")exportALL_PROXY="http://$host_ip:7890" 脚本通过cat /etc/resolv.conf来获取 DNS 服务器,也就是 Windows 的 IP,再将其中的 IP 部分截取出来,加上代理客户端的端口(我的是 7890,可以根据自己实际情况修改),使用 export 写入...
/bin/bashhost_ip=$(cat /etc/resolv.conf|grep"nameserver"|cut -f2-d" ")# 获取ip地址echo$host_ip# 输出ip地址exportALL_PROXY="http://$host_ip:7890"# 设置代理,7890为我的代理端口curl -I https://www.google.com# 尝试访问Google, 验证代理的有效性...
exporthttp_proxy=http://ip:port # ip 就是上面获取到的,端口就是 clash 配置的exporthttps_proxy=https://ip:port # 同上 # 配置全部代理exportALL_PORXY=socks5://ip:port 配置完成后通过curl -v www.google.com来检验,如果输出如下,则说明开启成功 ...
export ALL_PROXY="http://172.19.80.1:7890" 1. 7890 是 Windows 上运行的代理客户端的端口,记得要在 Windows 代理客户端上配置允许本地局域网请求。 通过curl cip.cc可以查看自己的IP地址 PS:测试还是不能走代理,防火墙新建相关规则也不行 可能的防火墙配置 ...
export https_proxy=$ALL_PROXY 1. 2. 3. 4. 5. 6. git也可以设置为使用代理 : AI检测代码解析 git config --global proxy.https socks5://$windows_host:10808 1. 如果想要这些环境变量和设置每次启动终端都生效, 可以在~/.bashrc文件最下方添加上述内容 : ...
一、安装WSL2下的Ubuntu20.04 1)打开windows WSL服务 # 以管理员身份运行 PowerShell dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /no
yaml # 获取 dashboard 的资源对象 kubectl get all -n kubernetes-dashboard 安装成功后,我们可以使用如下命令创建一个临时的代理: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 $ kubectl proxy 然后在 Windows 浏览器中我们可以通过如下地址来访问 Dashboard 服务: 代码语言:javascript 代码运行次数:0 ...