linux system configuration proxy implementation public network access

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/ximenjianxue/article/details/100556032

background

Because the host is not connected to the public network environment, and research and development to build a test environment, we need to be achieved through the public network, set up an offline environment is complex; Windows and the company accessing the public network is accessed through the company proxy server; it is also considering whether to configure the proxy Linux to achieve public network access.

achieve

2.1, modify the configuration: vim /etc/yum.conf

Added at the end: proxy = http: // agency: Port (Attorney general agreement with http, as modified according to the actual https)

2.2, modify environment variables

vim / etc / profile file in append:
## It should be reserved quotes export http_proxy = "Proxy port http:: // proxy"
to perform source / etc / profile after wq save the global effect.
Authentication: Use environment variable env can check whether the entry into force

2.3, using a mirror source external network:

Ali mirror source address: wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

2.4, after the completion of the deployment environment restore the original state:

Execution: unset http_proxy ## to remove an environment variable.
Delete the above configuration items.

Guess you like

Origin blog.csdn.net/ximenjianxue/article/details/100556032