Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a business class internet connection and need to setup a static ip address for a machine. I did a search online and only find how to setup static local ip addresses (like 192.168..). I tried the same technique, and only setup the ip address and netmask, but after restart networking the computer could not connect to the outside world.

This is what I did:

1) edit /etc/network/interfaces iface eth0 inet static address netmask

2) edit /etc/resolv.conf search nameserver nameserver

3) restart network sudo /etc/init.d/networking restart

Now the last step didn't report error, ifconfig shows the ip address was set, but this server cannot connect to outside world, ping and reports "unknown host".

Any ideas?

share|improve this question
Are you connected directly to the cable modem, or behind the router? – Zypher Apr 15 '10 at 23:13
up vote 2 down vote accepted

You are missing a default route.

In ubuntu, you'll need:

 gateway <IP of default route>

Here is /etc/network/interfaces on my system (with a private IP, but there is no difference):

auto eth0
iface eth0 inet static
    # dns-* options are implemented by the resolvconf package, if installed
share|improve this answer
Oha, it works now! It turns out I need to specify the gateway with the public IP address of the router. It didn't work earlier because I am setting an public ip for the server, but using a local LAN ip for the gateway. – ycseattle Apr 15 '10 at 23:35

You could also try using a proxy. It will change your IP address to a US IP address or where ever you want it. This will prevent anyone from tracking down your true location, and it will allow you to surf the web anonymously. A proxy will encrypt the information on your computer, so that no one can steal your personal information or hack into your computer.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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