Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

x.y.z.59

x.y.z.60

x.y.z.61

x.y.z.62

Gateway:

x.y.z.33

Netmask:

255.255.255.224

Primary Name Server:

a.b.c.245

Secondary Name Server:

a.b.c.30

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

Thanks

share|improve this question
add comment

2 Answers

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
address 127.0.0.1
netmask 255.0.0.0

auto eth0
iface eth0 inet static
    address x.y.z.61
    netmask 255.255.255.224
    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
add comment

Network configuration is documented at https://help.ubuntu.com/9.10/serverguide/C/network-configuration.html

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
add comment

Your Answer

 
discard

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.