我正试图在我的ubuntu终端上点击google.com。但收到了错误信息。
ping www.google.com
ping: unknown host www.google.com
我是我大学网络的代理人。我在互联网上看到了很多如何做到这一点的例子,但没有一个对我有用。
我正在使用Ubuntu14.04LTS(我是UBUNTU的新用户)
我尝试了以下解决方案
gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy.http enabled true
gsettings set org.gnome.system.proxy.http host 'http://192.168.3.10'
gsettings set org.gnome.system.proxy.http port 3128
gsettings set org.gnome.system.proxy.http use-authentication true
gsettings set org.gnome.system.proxy.http authentication-user 'myusername'
gsettings set org.gnome.system.proxy.http authentication-password 'mypassword'
最后
sudo gedit /etc/apt/apt.conf.d/20proxy
Acquire::http::Proxy "http://myusername:mypassword@192.168.3.10:8080"
sudo -H gedit /etc/profile.d/proxy.sh
export http_proxy=http://username:password@proxyhost:port/
export ftp_proxy=http://username:password@proxyhost:port/
export telnet_proxy=http://username:password@proxyhost:port/
不幸的是,这两种方法都没有用。
发布于 2016-09-02 15:01:31
打开你的终端,
gedit .bashrc
再加上这些行,
export http_proxy="http://myusername:mypassword@mycompanyproxy.com:8080"
export https_proxy="https://myusername:mypassword@mycompanyproxy.com:8080"
关闭终端,打开新终端
sudo gedit /etc/apt/apt.conf
再加上以下几行,
Acquire::http::Proxy "http://myusername:mypassword@mycompanyproxy.com:8080"
Acquire::https::Proxy "https://myusername:mypassword@mycompanyproxy.com:8080"
Acquire::socks::Proxy "socks://myusername:mypassword@mycompanyproxy.com:8080"
现在试着点击google
ping www.google.com
它肯定会成功的。
发布于 2016-09-02 16:17:31
简短的回答:如果他们做得对,你就做不到。
很长的答案:您所处的网络必须通过代理(这就是为什么您需要设置这些环境变量,顺便说一句,这些变量应该在/etc/environment
中设置,并且不要忘记排除列表no_proxy
)。
默认情况下,ping
使用ICMP数据包。如果您有socks代理,代理将专门处理TCP数据包和UDP数据包。
代理对最终用户来说是一种痛苦。从历史上看,它们是出于表现原因而使用的,但今天,它们几乎完全被用来管理这种关系(你的雇主、你的大学等等)。或者避免地理阻塞(避免在地理上被Hulu、Netflix和类似的网站阻塞)。
您可以绕过代理,但它需要大量的工作和“免费”的外部服务器。方法是在https上使用ssh隧道,或者使用VPN也可以模拟https连接。然而,这完全超出了问题的范围。
发布于 2016-09-02 13:02:52
如果您使用的是静态IP,您还应该添加DNS服务器。
/etc/network/interfaces
:sudo /etc/网络/接口iface eth0 inet static
下面添加一行: DNS名称服务器8.8.8.8 8.8.4.4,这将使用Google的DNS服务器。注意:正如混沌所言,您也可以编辑/etc/resolv.conf
,但是这些更改将被重写在reobot上。
Note2:有时sudo /etc/init.d/networking restart
是不够的,但是完全重新启动会有所帮助。
https://askubuntu.com/questions/820036
复制相似问题