1、设置网络地址转换NAT
2、在终端敲击如下命令
先敲击 ip route show 找到网关。再敲击如下命令:
export http_proxy=http://10.0.2.2:33210
export https_proxy=http://10.0.2.2:33210
export HTTP_PROXY=http://10.0.2.2:33210/
export HTTPS_PROXY=http://10.0.2.2:33210/
export ftp_proxy=http://10.0.2.2:33210
export no_proxy=“localhost,10.0.2.2,::1”
3、测试网络通不通
curl -I http://www.google.com
4、还可以重启网络
sudo systemctl restart NetworkManager