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 an Ubuntu 9.10 server and I need to setup a static public IP.

Our office already had a network setup by Cisco, so the router is configured to forward the requests to the server.

Here is the information from the ISP:

Static IP’s:








Primary Name Server:


Secondary Name Server:


I just need to know the commands to run in Ubuntu (non graphical) to setup this server with the static IP of: x.y.z.61


share|improve this question
up vote 3 down vote accepted

I would edit /etc/network/interfaces to have the following contents:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address x.y.z.61
    gateway x.y.z.33

Though you may need to use something other than eth0 depending on your system. Running ifconfig will give you a list of network interfaces. Then you would edit /etc/resolv.conf for you DNS entries:

nameserver a.b.c.245
nameserver a.b.c.30

And finally issue the command

sudo /etc/init.d/networking restart
share|improve this answer

Network configuration is documented at

share|improve this answer
I guess I am looking for mar specific help, regarding the specific IPs/gateway/netmask. It would be nice to actually see the commands for a public IP configuration, with the proper netmask. Do I use the Netmask in my question? Or do I use something different? – Phobis Feb 17 '10 at 17:07

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.