nameserver 192.0.2.1 nameserver 172.16.0.6 nameserver 192.168.255.254 Example: Configuring Proxy Environment Variables If your network is behind a proxy, configure proxy variables in Linux. If required, add these variables to your environment. The following example shows how to configure your proxy variables:
[guestshell@guestshell ~]$cat /bootflash/proxy_vars.sh export http_proxy=http://proxy.example.com:80/ export https_proxy=http://proxy.example.com:80/ export ftp_proxy=http://proxy.example.com:80/ export no_proxy=example.com export HTTP_PROXY=http://proxy.example.com:80/ export HTTPS_PROXY=http://proxy.example.com:80/ export FTP_PROXY=http://proxy.example.com:80/ guestshell ~] source /bootflash/proxy_vars.sh Example: Configuring Yum and PIP for Proxy Settings The following example shows how to use Yum for setting proxy environment variables:
cat /etc/yum.conf | grep proxy [guestshell@guestshell~]$ cat/bootflash/yum.conf | grep proxy proxy=http://proxy.example.com:80/ PIP install picks up environment variable used for proxy settings. Use sudo with -E option for PIP installation. If the environment variables are not set, define them explicitly in PIP commands as shown in following example: sudo pip --proxy http://proxy.example.com:80/install requests sudo pip install --trusted-bost pypi.example.com --index-url http://pypi.example.com/simple requests The following example shows how to use PIP install for Python:
Sudo -E pip install requests [guestshell@guestshell python Python 2.17.11 (default, Feb 3 2017, 19:43:44) [GCC 4.7.0] on linux2 Type "help", "copyright", "credits" or "license" for more information >>>import requests Guest Shell Example: Configuring Proxy Environment Variables Guest Shell 26