I installed Ubuntu server 12.04. I configured my network like this:

auto eth0
iface eth0 inet static

with these configurations, I cannot connect to internet.

Whenever I do

ping www.google.com

it just waits. When I do


or any other IP, it returns unreachable host error. Could you please help me fix this error?

Edit: I can ping the IP from my network. My modem is set to DHCP enabled dynamic IP.

Edit 2: Sorry for my late explanations, but I must firstly explain the scenario:

There is a company with 20 staff. I developed a web application with PHP/CodeIgniter for them. Where they want to use it inside their local network.

I install an Ubuntu server 12.04, and want to make it a local server for this purpose. I need to assign a static IP address for this server, where it musnt changed.

I have a TP-Link Wireless Router, where the internet connection is provided through this router. It is DHCP enabled.

Now for this, what I need? How I must configure my server?

  • Please, post the output of: ip addr, route -n and mtr -rn – Eric Carvalho Jul 31 '12 at 13:43
  • ip addr: 1: lo: I think it is not essential 2: eth0: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether d4:be:d9:96:33:14 brd ff:ff:ff:ff:ff:ff inet brd scope global eth0 inet6 fe80::d6be:d9ff:fe96:3314/64 scope link valid_lft forever preffered_lft forever – Jamshid Hashimi Jul 31 '12 at 14:55
  • It would be better if you edit your answer and place this information there rather than in a comment. What about route and mtr? – Eric Carvalho Jul 31 '12 at 15:00
  • Now I am out of office, I will update my post with your requested information. thanks – Jamshid Hashimi Jul 31 '12 at 18:18

I solved my problem like this: I reserved an IP address to my server MAC address from my Router interface and it worked perfectly. Thanks for the guys here which they helped me solve my problem.

Also, thank you all too.


For safety, it is generally a good practice to have a non routable ip address for an internal LAN and then have a second adress for connecting to the Internet.

There are a series of three non routable addresses that are available:

  • -,
  • -
  • -

Getting back to your initial question, I would check the contents of /etc/resolv.conf which is where the computer will indicate addresses of a namseserver or nameservers.

  • for this purpose, do I need two ethernet card? Now I have only one – Jamshid Hashimi Jul 31 '12 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.