1. 打开配置文件

vim ~/.bash_profile

2. 修改配置

function proxy(){
    export http_proxy=http://127.0.0.1:1087
    export https_proxy=http://127.0.0.1:1087
    echo -e "已开启代理"
}
function unproxy(){
    unset http_proxy
    unset https_proxy
    echo -e "已关闭代理"
}

3.应用

source ~/.bash_profile

4.查看IP地址

curl cip.cc