How to Use Proxy on WSL 2
- Install cntlm.
sudo apt-get install cntlm
- Configure the permission for cntlm.conf file.
sudo chmod 644 /etc/cntlm.conf
- Configure proxy settings.
sudo vi /etc/cntlm.con
f
- Make sure the following parameters are configured.
Domain Domain
Username username
Proxy 1.2.3.4:5678
NoProxy localhost, 127.0.0., 10.
Listen 3128
- Test connectivity. (Hit enter key if it asks a password)
cntlm -M http://www.google.com
- Generate hashed passwords.
cntlm -H
- Paste the generated passwords to the cntlm configuration file.
- Configure proxy.
export http_proxy=http://localhost:3128/
export https_proxy=http://localhost:3128/
- Start cntlm
sudo cntlm -v -c /etc/cntlm.conf