3

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 173.10.xxx.xx netmask 255.255.255.252

2) edit /etc/resolv.conf search wp.comcast.net nameserver xx.xx.xx.xxx nameserver xx.xx.xx.xxx

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 google.com and reports "unknown host google.com".

Any ideas?

  • 1
    Are you connected directly to the cable modem, or behind the router? – Zypher Apr 15 '10 at 23:13
3

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
    address 10.22.16.2
    netmask 255.255.255.0
    network 10.22.16.0
    broadcast 10.22.16.255
    gateway 10.22.16.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 10.21.1.21
    dns-search example.com
  • 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
1

You could also try using a proxy. It will http://www.change-ip-proxy.com>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.

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.