---
title: 配置网络代理
description: "如果无法直接访问外网，则需要配置网络代理。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengwebs/ecosystemEnable/LVS/kunpenglvs_04_0014.html
sourcePath: /source/zh/kunpengwebs/ecosystemEnable/LVS/kunpenglvs_04_0014.html
indexId: dc1195473a5beea0ebeba5b519f95fd7281030731a9d963060ed8898f4fd611366
---
# 配置网络代理

如果无法直接访问外网，则需要配置网络代理。


1. 修改profile文件。

  a. 打开“/etc/profile”文件。
    1 vim /etc/profile

  b. 按“i”进入编辑模式，在“/etc/profile”文件中增加以下内容（根据实际情况填写）。
    1 2 3 export HTTP_PROXY="http://用户名:密码@代理IP:代理端口" export HTTPS_PROXY=$http_proxy export NO_PROXY=127.0.0.1,.huawei.com,localhost,local,.local

  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
  d. 使代理生效。
    1 source /etc/profile

2. 使用curl命令访问任意网站，若能显示网站信息则表示代理配置成功，可以访问外网。
