Computers
Logging In
The computers in the lab are configured so they can boot more than a
single operating systems.
When the computer is first powered on it boots
from the partition containing Linux. A menu is displayed listing
the different operating systems that can be chosen.
The choices are
In order to make proper use of the networking lab you must sometimes have root (i.e. superuser) privileges. Some tasks that require root privileges can be accomplished by the user "student" through use of the "sudo" command. This command allows selected users (in this case "student") to execute selected commands (e.g. ethereal, ifconfig, ifup, ifdown) as if they were logged in as root. Simply precede the desired command with "sudo". For example, to run ethereal as student with full privileges use the command:
[Linux prompt]# sudo ethereal &instead of the usual
[Linux prompt]# ethereal &
Some tasks (e.g. compiling and running programs that use raw sockets on interfaces in promiscuous mode) require that the user be logged in as root. For students who need to be able to log in as root an instructor can provide the root password. root access can be abused. Just because it is possible to use root access to make changes to the hard disk partitions doesn't mean that it is right to do so. Anyone using the lab is expected to use root access in an appropriate manner. Even when they know the root password students are encouraged to log in as "student" and use the "sudo" command. This is much safer than logging in as root. Users logged in as root can easily make inadvertant but serious changes to the contents of the disk.
The server on the private network (itlserver) has a user named "student" with no password.
Two methods are available for mounting and using a ZIP disk. The
conventional method is for the user to explicitly mount and unmount
the desired partition. For this purpose a mount point has been
created at /mnt/zip and an entry made in /etc/fstab to allow
non-privileged users to mount /dev/hdb2 at this mount point.
After inserting the ZIP disk mount it with the command
To encourage students to store personal files on the ZIP disk
the startup process on all the computers attempts to mount
/dev/hdb2 as /home in
the directory structure. If this is successful, then the following
directories will reside on the ZIP disk:
If you use the ZIP disk in this manner, insert it before Linux is
booted. Because Linux keeps some files in /home open after it boots,
in order to eject the ZIP disk properly you must shut down Linux.
To shutdown the computer, choose "Shutdown" from the "start" menu and choose "reboot".
Do not simply power the computer off.
The ZIP disk from which Linux is booted should not be ejected until after Linux has
completely shut down. As soon as the computer actually reboots you can eject
the ZIP disk by pressing the eject button on the ZIP drive.
Preparing a ZIP disk for use with networking Linux involves the
following steps:
If you wish to partition and format your ZIP disk yourself, the steps
for doing so are available here.
The first way is to maintain a list on a server that relates MAC addresses
to IP addresses. When Linux boots it asks some server to return the IP
address associated with the MAC address of its interface. The protocol
we use for this process is Dyamic Host Configuration Protocol (DHCP).
The DHCP server for ethernet port 0 (eth0) is linux.cs.sonoma.edu. This server
is accessed through the campus network. The DHCP server for ethernet port 1
(eth1) is the server on the lab's private network.
If DHCP
is used by Linux then the IP address you get will depend
only on the computer you boot from. This is appropriate for the interface
that is connected to the campus network (eth0) and also for the
interface connected to the private network (eth1).
It guarantees that as you move
from one computer to another each computer will retain its
appropriate and unique IP address. It will also retain its appropriate
hostname (which should match the SSU property tag number on the CPU).
To summarize, DHCP ensures that the IP address sticks to the computer.
For experiments you will perform using the network equipment in the lab you
want to be sure you always have the same IP address (e.g. so that you can code
that address into C programs and not have to change it as you move from one
computer to another) and that the IP address you used is not in conflict
with the addresses used by other students.
DHCP is not appropriate for this situation. Instead you
must configure the network interface in question directly.
In any class that uses the lab the instructor may
assign unique IP addresses to each student in the class. These addresses are
chosen so they lie within a range
of addresses that has been set aside for use on private networks.
If these addresses are used on the Internet the packets they employ are not
supposed to be forwarded. Nevertheless you should not use these addresses
on the campus network.
To summarize, coding IP addresses explicitly ensures that
the IP address is properly associated with the student, not with the computer.
The configuration files that control the interfaces are
Notice that ifcfg-eth0 and ifcfg-eth1 use
DHCP (BOOTPROTO=dhcp) and that they do not specify an IP address, network mask,
or broadcast address. These are all provided by the DHCP server. The addresses for
eth2 and eth3 are coded directly into the corresponding configuration files and are
NOT within the private network which uses addresses of the form 192.168.200.*.
The addresses coded into these configuration files are probably NOT the addresses
you were assigned by your instructor, and are NOT distinct from the addresses on
everyone else's computer. They may be useful for simple experiments in which no
other computer in the lab is used, but for most experiments you will have to change them.
When you want to make changes to the configuration of eth2 or eth3 you should use the "ifconfig"
command (which is discussed later in this manual). A simple mechanism which will
enable everyone in the lab to assign a unique IP address to interfaces eth2 or eth3
is the following:
At this point only eth0 and eth1 are actually
active. To see the status of your network configuration, issue the command:
This lists information for all active interfaces.
You should see information for three interfaces. One is eth0, the interface
connected to the campus network. Another is eth1, the interface connected
to the private network. The last is lo, the "loopback" interface.
This is provided so that you can test network protocols and programs without
actually being connected to a network.
To enable an interface issue the "ifup" command, as in:
If you again issue the command:
interface eth2 will be listed. You can display information for an interface even
if it is not active by explicitely specifying the interface in the ifconfig command,
as in:
or you can display information for all interfaces, whether active or not, with the command:
With this form of the command you should now see information for lo, eth0, eth1, eth2 and eth3.
Interfaces which are not active will not be shown as "up" or will not have an associated IP
address.
To disable an interface issue the "ifdown" command, as in:
Naturally if you down eth0 you will be unable to communicate with any other
node on the campus network, including the CS Department web server, so if you need to do
that either be sure that Netscape already has any page containing lab instructions
already loaded or be prepared to switch to web pages served by the private network server.
If you down eth1 you will be unable to communicate with the terminal servers
on the private network and therefore you will be unable to access the console ports
of the network equipment.
Some experiments run the risk of sending large numbers of packets to the campus network
(e.g. configuring the computer to do IP routing). When you are performing these experiments
it is important that you disable the interface to the campus network.
The report from ifconfig shows the ethernet (MAC) hardware address for each active
interface.
Names have been associated with many of the addresses in the private network. The
association between the names and the addresses is stored on each computer in the
file /etc/hosts. These names are not available from any DNS server. The names
can be used instead of the addresses when it is necessary to connect to a device
on the private network. For example, to telnet to port 7 of the terminal server in work
area 2 you can enter
Using a ZIP Disk.
Students should store their files on a ZIP disk and not directly on the
hard disk of the computers in the lab. The ZIP drive is device /dev/hdb.
Because Windows can only use the first partition on removable disks
(/dev/hdb1), the convention used in the lab under linux is to use the
second partition (/dev/hdb2) for storing personal files. The steps
that will create a usable ZIP disk are described below.
[Linux prompt]# mount /mnt/zip
The disk can be unmounted and ejected with the command
[Linux prompt]# eject zip
In order for this to succeed you must have no files open on the ZIP disk
and no window must have its current directory located on
the ZIP disk. If you use this ZIP disk in this way you are responsible for
erasing all personal files from the internal hard drive.
If the computer is used without a ZIP disk then /home resides on the
hard disk and any files stored into the directories listed above
will also reside on the hard disk. Students must remember to copy
them to personal media (i.e. to ZIP disks or to a personal account
on a server) and erase them when they are done using the computer.
An image of a 100 MByte ZIP disk for which all three steps above have been
accomplished is stored on the private network
file server (itlserver). A ZIP disk built from this image has a
30 MBbyte first partition formatted as FAT16 for use either with Windows
or Linux, and a 70 Myte second partition formatted as a Linux file system.
In order to make use of this image you
must perform the following steps.
If you copy the image of a 100 MByte ZIP disk to a 250 Mbyte ZIP disk
you can use the resulting disk but you will lose the benefit of the
larger disk.
[Linux prompt]# dd if=/tmp/zip_100_<date>.dd of=/dev/hdb
Configuring Network Interfaces
Every computer in the lab has four network interfaces - one built into
the motherboard and 3 on network interface cards.
Every network interface card in the lab has a unique ethernet hardware
(MAC - media access control) address. MAC addresses have the form
xx:yy:zz:qq:rr:ss where xx
through zz are 8 bit values expressed as a pair of hex digits. In some
documentation this is written xxyy:zzqq:rrss.
This address is manufactured into the card. Usually when you use the
network you use an internet protocol (IP) address rather than a MAC address.
An IP address must be
associated with every interface. An IP address has the form xxx.yyy.zzz.qqq
where xxx through qqq are decimal numbers in the range 0 to 255. The
association between the IP address and the interface can be done in two ways.
You should examine these files but not change them.
(Changes made to the configuration
files don't affect active interfaces. The changes take effect when the interfaces are
enabled. If an interface is active when you make the changes you must disable
it and reenable it to get the changes to take effect.)
Choose the host part of the address (the last number in 192.168.0.x on
eth2 or 192.168.1.x on eth 3) to be the decimal equivalent of the number of the computer.
The number of the computer is 1a, 1b, 1c or 1d for work area 1, 2a, 2b, 2c, 2d for work
area 2, etc. These can be interpreted as hex numbers.
Thus someone working at computer 3c (= 60 decimal) should use addresses
192.168.0.60 and 192.168.1.60.
[Linux prompt]# ifconfig
[Linux prompt]# ifup eth2
[Linux prompt]# ifconfig
[Linux prompt]# ifconfig eth3
[Linux prompt]# ifconfig -a
[Linux prompt]# ifdown eth0
IP Addressing Conventions
Certain devices on the private network have fixed addresses.
The following conventions have been used to allocate these addresses
within the private network (192.168.200.*):
Students who need to temporarily assign an address on the private network
to a piece of equipment should use an address in the range indicated for student use.
It is up to the student to ensure that the address chosen does not conflict with
an address chosen by another student.
[Linux prompt]# telnet xyplex2 2700
instead of
[Linux prompt]# telnet 192.168.200.12 2700
Refer to the file /etc/hosts for a current list of the names and addresses.