1

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

Phobis
  • 145
  • 1
  • 2
  • 7

2 Answers2

3

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
Hamish Downer
  • 9,142
  • 6
  • 36
  • 49
2

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

Dominik
  • 2,198
  • 13
  • 9
  • 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