centos代理上网

来源:互联网 发布:ug编程刀补的设置方法 编辑:程序博客网 时间:2024/06/04 18:47
我们知道,在局域网内的Linux需要在终端连接到外部网的时候,往往需要通过代理.
假如校园网内的代理服务器为 192.168.0.1:3128,那么在终端设置代理设置
文件.bash_profile(在root目录下)文件中添加
//----------------------
http_proxy=192.168.0.1:3128
ftp_proxy=192.168.0.1:3128
export http_proxy
export ftp_proxy
//----------------------
然后执行
source .bash_profile

查看一下是否设置成功
[root@localhost ~]# echo $http_proxy
192.168.0.1:3128

[root@localhost ~]#

然后试试能不能上网