I am trying to ping google.com in my ubuntu terminal. but getting an error message.
ping
ping: unknown host I am behind the proxy of my university network. I have seen many examples on INTERNET of how to do this, but have none worked for me.
I am using UBUNTU 14.04 LTS (I am a new user of UBUNTU)
I have tried the following solutions
Option 1
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 '
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'Finally
sudo gedit /etc/apt/apt.conf.d/20proxy
Acquire::http::Proxy ""Option 2
sudo -H gedit /etc/profile.d/proxy.sh
export http_proxy=
export ftp_proxy=
export telnet_proxy=Unfortunately, neither of these worked.
13 Answers
Short answer: You can't if they did their job right.
Long answer:
You are on a network where everything has to go over a proxy (that's why you need to set those environment variables, which by the way, should be set in /etc/environment and don't forget the exclude list no_proxy).
ping uses, by default, ICMP packets. The proxies will handle exclusively TCP packets and UDP packets if you have a socks proxy.
Proxies are a pain for the end user. Historically, they were used for performance reasons, but today they are almost exclusively used to either police the connection (your employer, your university, etc...) or avoid geoblocking (avoid being blocked geographically by Hulu, Netflix and similar).
You can get around a proxy, but it requires significant work and a "free" external server. Way are, using ssh-tunneling over https, or a VPN also simulating https connections. However, this falls entirely beyond the scope of the question.
If you're using a static IP you should also add DNS servers.
Edit
/etc/network/interfaces:sudo nano /etc/network/interfacesBelow
iface eth0 inet staticadd the following line:dns-nameservers 8.8.8.8 8.8.4.4This will use Google's DNS servers.
Restart your network:
sudo /etc/init.d/networking restart
Note: as chaos says, you can also edit /etc/resolv.conf but these changes will be overwritten on reobot.
Note2: Sometimes sudo /etc/init.d/networking restart is not enough, but a full reboot helps.
Open your terminal,
gedit .bashrcthen add these lines,
export http_proxy=""
export https_proxy=""close terminal, open new terminal
sudo gedit /etc/apt/apt.confand add following lines,
Acquire::http::Proxy ""
Acquire::https::Proxy ""
Acquire::socks::Proxy "socks://myusername::8080"now try to ping google
ping it will work for sure.
1