CS70 Routing Table Assignment

Bring a formatted diskette to the lab. Have a lab technician enable you to boot one of the Linux-configured machines at SMC. The machine has a network card connected to an ethernet cable. That cable is used by a group of Santa Monica College network machines that are assigned to subnet 217.151.115.0. Available to them as a gateway to the internet is machine 217.151.115.1.

Give the address 192.168.3.1 to the ethernet interface (NIC) in your machine:

    ifconfig eth0 192.168.3.1

Print the resulting configuration information (ifconfig eth0) and routing table (route -n) to a file.

(You can do that in Linux as follows:

    ifconfig eth0 > /routetable
    route -n >> /routetable

The first command creates a new file /routetable and writes into it the output it would normally send to the screen. The second command does the same, except it appends its output to the pre-existing /routetable instead of creating it afresh.)

Now insert the necessary lines in the routing table to enable your machine to get packets 1) to machines on the 217.151.115.0 subnet, and 2) to machines beyond that subnet (on the internet for example) via its particular machine 217.151.115.1 as your default gateway. This requires 2 invocations of the route command, one for each of those tasks. (See "manual route command examples" below.)

When you are done, examine the routing table (route -n) and satisfy yourself it accomplishes both objectives. Then, make a copy of the table for me in your file:

    route -n >> /routetable

(Be sure to use >>, not >, to avoid overwriting the existing /routetable you have already created.)

Note you will not effectively be able to test your table by observing any replies (to ping, for example). Even if it successfully enables your machine to get packets to the specified destinations, that is not to say they are reciprocally set up to know how to route replies back to you. So don't expect to get any.

If you wish to examine /routetable and ascertain that it contains the right stuff, you can run:

    cat /routetable

When satisfied, in order to capture your file for submittal, insert a PC-formatted disk in the drive. Then execute this command:

    mcopy /routetable a:

and finally, to clean up please,

    rm /routetable

To shut down the computer, either of these equivalent commands is used:

    shutdown -h now

or

    halt

Now please submit your file in the usual place: the "assignments" subdirectory under your home directory on sputnik.smc.edu. But how to get it there? By using ftp. With the diskette in hand log in at an SMC machine running Windows. There, you can run ftp in character mode from within a DOS box. First, make the floppy be your default drive by issuing the command "A:" Then issue the command:

    ftp sputnik.smc.edu

Proceed to log in using the same username and password as you do when telnetting to sputnik.smc.edu. Within ftp, a limited set of familiar Unix commands is available, including pwd, ls, and cd. Navigate to your "assignments" directory, then transfer the file (place ftp in ascii tranfer mode with the command "ascii," then tranfer with the command  "put routetable.") SMC computers may also have a graphical mode ftp program installed, such as WS-FTP. Look for it on the program menu or ask a technician. If available, it is more convenient. You can also transfer the file with ftp from a non-SMC computer, provided you are connected to the internet via an ISP or by dialing in to SMC. Please see general information about using ftp.


Manual Route Command Examples:

lAdd route to a machine
route add –host 192.168.4.2 eth0
lAdd route to a group of machines (local)
route add –net 192.168.4.0 netmask 255.255.255.0 eth0
lAdd route to a group of machines (thru gateway)
route add –net 192.168.5.0 netmask 255.255.255.0 gw 192.168.4.1
lAdd route to “any and all” (default route)
route add default gw 192.168.4.1