Each student has been assigned two hosts, one server and one client host. In this project you will learn how to configure one of your hosts (we'll call it the server host, and your other system the client host) with static IP addresses, hostnames, and other networking parameters. This setup will be used for the rest of the course.
Make sure you keep an accurate system journal of any and all changes you make to your system! You will need to turn this in, along with the answers to the questions asked below.
For your static IP address to actually work you must
set other network parameters, including a default gateway.
Other steps include setting a hostname and configuring the
libraries) with the IP address of your
nameserver and your default domain name.
Until we build a new nameserver you will need to update your
/etc/hosts file with the names and IP
addresses of all the hosts used in our classroom.
You can create this file from the information found at the
Networking class wiki site, the
“Networking Class Host Name List”.
The hostname you picked at the beginning of the term should be assigned to your server. We won't be configuring your client host in this project, so it should continue to use DHCP as before.
Since version 11, Fedora doesn't enable the
network” service by default.
Instead the “
NetworkManager” service is enabled.
This service doesn't support “static” IP configuration
through Fedora 15 (even though it says it does; see
Before beginning this project you must disable
NetworkManager and enable instead
Once you do this, you may (or may not) need to configure the
network service for DHCP before networking
will operate correctly.
You can use any GUI or other method to do this.
For Fedora 15, you use
systemctl disable NetworkManager.service”,
then enable the older service with
systemctl enable network.service”.
You may need to install
In addition, you can (and probably should) add
If you need help with this step, ask your instructor.
Answer the following questions and perform the following tasks. (For the answers to Solaris questions consult the man pages and the Solaris on-line documentation.)
Before proceeding, make a copy of your current, working network setup:
IP address and mask, routing table (especially the default route),
and the contents of
As usual, when you modify files you should first make a copy.
You can then record the output of
diff to show your changes.
ifconfigcommand, or the
ip addr add address/prefix-length dev interfacecommand. Here's an example using the new Linux
# ip addr add 10.20.30.40/24 dev eth0
(Of course you use the correct address, prefix length, and device, which
may not be
Once set, verify your NIC has the correct address.
What command do you use to verify the address
assigned to a NIC?
Make sure to keep track of all IP address assignments! This is typically a separate document from any one system's journal. This document should be kept current and include a “last revised” date. However, with only two hosts to keep track of, you can just record the IPM address assignments in your system journal. (Consider putting that information in a table near the beginning of the journal, say near the partition map.)
10.142.255.1). This step is done using the
routecommand or the new Linux
# ip route add 0/0 via address
(Of course you should use the correct gateway address.) Once set, verify your system's routing table (make sure the default route shows and is correct). What command do you use to verify the default route?
When checking the routing table, you make notice a long delay when
displaying the default route.
This may happen when the network gateway doesn't have a
DNS entry, and your system by default attempts to
lookup the name for the gateway's IP address.
What is the option for the command to display
the routing table, to cause it not to lookup DNS
(One way to fix this, is to add a name for the gateway
IP address in the DNS system, or in
I often add a name such as “
hostnamecommand. (You can use the new Linux command
hostnamectlinstead if you wish.) To set the domain name in Red Hat compatible Linuxes you must make sure your name service can lookup the fully qualified domain name or FQDN from the hostname. For the default setup this means you must add an entry to
/etc/hoststhat contains the static IP address of your host, its FQDN, and its hostname.
The domain name for our class is "
For a hostname of
siegfried and an IP
entry should be:
172.16.0.10 siegfried.gcaw.org siegfried
What was the exact command line you used to set your system's hostname?
traceroute 18.104.22.168”. This should show several hops, the first of which should be the class gateway. If you don't get the expected output verify your IP address and default route again. If necessary you can start over by restarting networking (use "
/etc/rc.d/init.d/network restart"). This will reactivate your DHCP configuration.
Once your static IP and routing configuration is working
it is time to make the changes permanent.
This requires you to modify files on your host (besides
/etc/hosts file, which you've already modified).
Perform the following steps:
/etc/hostsfile with entries for the gateway router and for the other student servers (and the instructor's host as well). (As mentioned above, I generally use a name such as “
HCC-gateway” for the router.) Don't forget to keep the entry for your own host added earlier. Remember all entries (but at least your own) should contain both the hostname and the FQDN.
/etc/hostsfile with the information from the class wiki site's “Networking Class Host Name List”.
hostsfile before trying DNS. (You system is likely already setup this way.) Examine and update if necessary
hostsentry). What changes did you need to make? What is the output of the command “
grep hosts /etc/nsswitch.conf”?
/etc/resolv.conffile to include the correct default domain name(s) and DNS (nameserver) IP address(es). This file was managed and routinely over-written by DHCP (and PPP), but now you must edit it manually. What is the current contents of the
/etc/resolv.conffile (as created by DHCP)?
gcaw.org. The nameserver IP address to use is
10.142.2.6. Optionally you can specify a second default domain name of
hccfl.edu, to allow commands such as “
ssh ua00@YborStudent” to work. It is possible you may need to set some options, for example you may find it necessary to change the default DNS timeout from 5 seconds to a larger value. See the
resolv.confman page for more information.
resolve.conf file might look like this:
search gcaw.org hccfl.edu nameserver 10.142.2.6
The DHCP version of
resolv.conf is probably
Use the DNS (
addresses you see there
when making your own version of this file.
When DHCP modifies the
/etc/resolv.conf file, it first makes a copy of this
When the interface is brought down, the old
file is restored.
So, after your next reboot any changes to this file may be lost!
This is a one-time thing; once you set your interface to static
IP, the DHCP client won't over-write
Make a copy of your correct
file, so you can easily restore it later (if needed).
pingcommand to ping hosts by name. What is the results of each of the following commands?:
ping -v wpserver ping -v wpserver.gcaw.org ping -v your-hostname ping -v your-hostname.gcaw.org ping -v www ping -v www.hccfl.edu
searchdirective in the
resolv.conffile? How did you find this out?
networkservice (and not the newer but buggy
NetworkManagerservice). What is the configuration file's absolute pathname that holds the network configuration for your NIC (e.g., “
The descriptions of the various configuration files you need to
edit are found in the file:
none. What is the exact entry you modified for this?
/etc/sysconfig/networkand add (or change) an entry for the following:
GATEWAY=address #IP address of gateway
In Red Hat compatible Linuxes since version 7.2,
the default gateway can be set in a manner similar to that used
on Solaris, by creating the file
This file should just contain the IP address of your
What file should contain your gateway
IP address on Solaris?
The whole concept of a hostname is confusing! Before DNS or even Ethernet, a computer could be given a name, sometimes called the hostname or the nodename. With DNS and NICs, a name is associated with each IP address assigned to each NIC on some computer. This too is called the hostname. So what is “the” hostname on a host with multiple IP addresses? It is not well defined but is usually configured by the administrator to be one of the DNS hostnames. Some systems will set the hostname by a reverse DNS lookup on the first NIC found with an IP address assigned (the first or last address).
For Red Hat compatible Linux systems you should edit the file
and add (or change) an entry for
This should NOT be the FQDN name.
The hostname and FQDN should still be set in the
/etc/hosts file, which Red Hat consults to find the
(Note that Red Hat installers and documentation state to use the FQDN,
but I've read the code and that is not correct through RHEL 6, or
through Fedora 19.
You can test your system to see if “
hostname -f” both report the FQDN;
What file(s) on Solaris are updated to contain the host's hostname and domain name?
At this point your system is now configured with a static IP address, and the change will persist even if you restart networking or reboot. However there are additional configuration steps you may wish to do:
/etc/issue.netcontain system identification information that is displayed before a login prompt. The default value contains information that is more useful to hackers than legitimate users. You should update these files to contain a greeting which contains your system's hostname and no other information. Another greeting file is used with the anonymous FTP server. On Red Hat compatible Linuxes since 7.2, the default file is
/var/ftp/welcome.msg. This file too should only contain the hostname, something like "Welcome to the hostname Anonymous FTP Server!".
/etc/motdis displayed to users just after a successful login and often contains an acceptable use policy (AUP) statement.
/etc/networks allows you to assign
names for IP network numbers.
This file is optional but if present will allow you to use
the names in commands such as
networks file might look like this:
gcaw-net 172.22.25.0 hcc-net 10.41.0.0 loopback 127.0.0.0
Test your static IP setup by restarting networking.
Use the command
and verify everything is correctly configured by using the
ping commands as
If things are not working, carefully check all the steps you
did by comparing the system journal with these directions.
Also make sure the classroom is plugged into the campus
If you are unable to get things to work, you can attempt to
use a GUI network setup tool.
You can also run the
to temporarily restore the DHCP configuration.
You can send as email to (preferred). If email is a problem for some reason, you may turn in a hard-copy. In this case the pages should be readable, dated, and stapled together. Your name should appear on the first page.
Don't turn in your whole journal, you will need to add to it every day in class! It is common in fact to keep the journal as a text file on the system (with a paper backup of course).
Please see your syllabus for more information about submitting projects.