Baadal VMs are on the institute's private network. They reach websites, package mirrors and code
hosting outside IIT Delhi through the IIT Delhi proxy, as campus computers do. A program
that does not know about the proxy appears to have no internet at all: apt update hangs,
pip install times out. This guide sets the proxy once, for everything that needs it.
PROXY_HOST and PORT with the values given there.Linux
1. The shell and most programs
Most command-line tools, including curl, wget, pip and
conda, read the proxy from environment variables. Set them for all users in
/etc/environment:
sudo tee -a /etc/environment <<'EOF'
http_proxy=http://PROXY_HOST:PORT/
https_proxy=http://PROXY_HOST:PORT/
HTTP_PROXY=http://PROXY_HOST:PORT/
HTTPS_PROXY=http://PROXY_HOST:PORT/
no_proxy=localhost,127.0.0.1,.iitd.ac.in,.iitd.ernet.in
NO_PROXY=localhost,127.0.0.1,.iitd.ac.in,.iitd.ernet.in
EOF
Sign out and back in (or reconnect over SSH) for the change to apply. no_proxy keeps
traffic to campus addresses off the proxy.
Check that it works:
curl -sI https://pypi.org | head -1
A line such as HTTP/2 200 means you are online.
2. The package manager
sudo does not pass your environment to apt, so give it the proxy in its
own configuration (Ubuntu):
sudo tee /etc/apt/apt.conf.d/95proxy <<'EOF'
Acquire::http::Proxy "http://PROXY_HOST:PORT/";
Acquire::https::Proxy "http://PROXY_HOST:PORT/";
EOF
sudo apt update
On CentOS, add a line to /etc/dnf/dnf.conf:
echo 'proxy=http://PROXY_HOST:PORT/' | sudo tee -a /etc/dnf/dnf.conf
3. git
git config --global http.proxy http://PROXY_HOST:PORT/
Use repository addresses that start with https://. Cloning over SSH
(git@github.com:...) does not go through an HTTP proxy.
4. snap and Docker
Both run as system services and need the proxy set separately:
# snap
sudo snap set system proxy.http="http://PROXY_HOST:PORT/"
sudo snap set system proxy.https="http://PROXY_HOST:PORT/"
# Docker (image downloads)
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/proxy.conf <<'EOF'
[Service]
Environment="HTTP_PROXY=http://PROXY_HOST:PORT/"
Environment="HTTPS_PROXY=http://PROXY_HOST:PORT/"
Environment="NO_PROXY=localhost,127.0.0.1,.iitd.ac.in"
EOF
sudo systemctl daemon-reload && sudo systemctl restart docker
Windows
- Open Settings > Network & Internet > Proxy.
- Under Manual proxy setup, turn on Use a proxy server.
- Enter
PROXY_HOSTas the address andPORTas the port. - In the exceptions box, enter
*.iitd.ac.in;*.iitd.ernet.inand tick Don't use the proxy server for local addresses. Save.
Browsers and most applications now use the proxy. For Windows Update and other system services, also copy the setting to the system from an administrator PowerShell:
netsh winhttp import proxy source=ie
If it still does not work
- Sign-in to the proxy. If the proxy asks you to sign in, follow the CSC page; a command-line program cannot show a sign-in page.
- Check the address.
env | grep -i proxyshows what the current shell uses. A typo in the host or port looks the same as no internet. - DNS. If
curlsays it cannot resolve the proxy's name, check/etc/resolv.conforresolvectl status.
Still stuck? Write to baadalsupport@cc.iitd.ac.in with your VM's name and the command that fails, with its output.
See the FAQ or write to baadalsupport@cc.iitd.ac.in with your VM's name.