Ubuntu Server 7.04 Fiesty: Installation Problems and Changing Network Settings from DHCP to Static IP

Tonight I deployed another installation of Ubuntu Server 7.04 Fiesty. The biggest problem I ran into was setting up the network card. Apparently, the Ubuntu setup wizard tries to contact the network in at least two points during the installation wizard. In one of the points of the installation, failure to contact a server on the internet results in the installation hanging. I got around this by running the installation while connected to my residential DHCP network and then redeploying the server to the DMZ, which requires defining a static IP.

This created another problem – How do you change the network settings from DHCP to static IP address? In order to solve this problem, you need to update your interfaces file to use an assigned static IP address and configure the server to use your network’s DNS servers.

To change your network settings from DHCP to static IP, type:

sudo vi /etc/network/interfaces

The file displayed should have a line that says ‘ iface eth0 inet dhcp’ or something similar. Change the file to look like the following:

....
....
....
auto eth0
iface eth0 inet static
address 71.164.212.40
netmask 255.255.255.0
network 71.164.212.0
broadcast 71.164.0.255
gateway 71.164.212.1

Afterwards, restart your network interface by typing:

sudo /etc/init.d/networking restart

Next, you need to configure your DNS servers. You need at least two entries. To edit your DNS entries type:

sudo vi /etc/resolv.conf

My file looked like this:

nameserver 4.2.2.1
nameserver 4.2.2.2

After saving the file, you should be able to connect to the network.

If you would like to edit your hosts file, type the following in your shell.

sudo vi /etc/hosts

You can add more references to your localhost in here. Mine looks like this:

127.0.0.1       localhost
127.0.0.1 alex-server
127.0.0.1 sandbox-server

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

If you would like to change the hostname of your server, type the following:

sudo vi /etc/hostname

After typing in your new hostname, you need to run a script to implement the change. Type:

sudo /etc/init.d/hostname.sh start

References

Leave a Reply