Unformatted text preview:

CMPE 150 Winter 2009 Lab 1 In this lab you will familiarize yourself with the Linux Boxes the Cisco Equipment and some of the networking tools NOTE Remember to reboot the machines before using them by either using the GNOME reboot option or typing reboot in the terminal as root SAVE ALL FILES IN root labdata user where your user is your cat s email ID All files you create should be saved to the storage you choose in Part C SUGGESTION unless a specific name is requested use the following name format for the files you save Exercise Part Question PC command For example 5 A 4 PC1 tcpdump This will help ensure you can find the data needed for the lab report Network Setup FOR LAB 1 Connect the PCs like the diagram below to a single switch Note do not use port 24 on the switches as it has been configured to behave differently from the other ports you will find out about this in later labs 1 1 Topology for Lab 1 In the table below is the IP address for each of the Linux PCs these should be preconfigured PC PC1 PC2 PC3 PC4 IP address of eth0 10 0 1 11 24 10 0 1 12 24 10 0 1 13 24 10 0 1 14 24 LAB ONE Introduction to Linux and Equipment 2 Exercise 1 PART A Setting up The Network Refer to the diagram above to see what the network looks like A 1 Connect each PCs eth0 port to an associated port on the switch any port will do for this exercise A 2 Make sure eth0 is up on each PC by typing in the terminal ifconfig eth0 This will bring up the configuration information about eth0 only PART B Testing Connectivity After being connected all the hosts Linux PCs should be able to communicate with each other B 1 We will use ping to test the connections to each PC B 2 Switch to PC1 and issue a ping to PC2 PC3 and PC4 by typing PC1 ping c 5 10 0 1 12 Ping to PC2 PC1 ping c 5 10 0 1 13 Ping to PC3 PC1 ping c 5 10 0 1 14 Ping to PC4 B 3 Use the KVM switch to work on PC3 and in a terminal window ping PC1 PC2 and PC4 using their respective IP addresses Exercise 2 Learning Linux Before starting this lab keep these commands in mind chmod mv man p kill cp pwd ping rm ls cd mkdir more rmdir tcpdump PART A Familiarizing with Commands In this section the goal is to acquaint you with using the Linux command line to do everyday tasks Some of the tasks may need multiple commands to complete A 1 Change to the home directory of root A 2 Make a directory called test in the directory you just entered A 3 Copy the file etc hosts to the test directory just created A 4 Change the current directory to test A 5 Change the name of the file hosts to oldhosts A 6 List the content of the directory test A 7 List the content of oldhosts A 8 Remove all files in directory test A 9 Remove the directory test 2 LAB ONE Introduction to Linux and Equipment 3 PART B Saving Data In the Terminal This will show you how to save text output into a text file so you can review it at a later date B 1 There are several operators that help save files The most common are and the pipe We will be using the pipe since it is the most convenient way to view and save output at the same time You can use the pipe to send data to another program on the command line for example to save a text file from a list command PC ls tee filename This lists a directory and uses the tee program that opens a file writing operator taking input from the standard out of ls and outputting it to the filename from the standard out of each program Use this to save any data from commands on the command line that you need B 2 Data can also be saved from the terminal through Cut and Paste Highlighting information and hit Shift Ctrl C then paste into a text editor with Ctrl V Gedit is the GNOME Text Editor and can be run from the GUI main menu or by typing gedit in a terminal window SAVE DATA B 3 Save the output of the command ls l usr to a file named usrfile x where x is the method for saving 1 for piping and tee 2 for cut and paste into a text editor Remember save in the root labdata user directory PART C Saving Copying Files to Floppy USB Drive This section will show you how to mount a floppy in Linux and how to save your files to it NOTE Only read the section for the storage method you choose Floppy C 1 Mounting Check to see if the floppy drive is empty if not go down to step C 4 to unmount it To mount the floppy type PC1 mount mnt floppy You should see a picture of a disk on the desktop and can access the floppy in a GUI fashion from there if you wish C 2 Copy Files To copy files from the command line to a floppy all that needs to be done is PC1 cp filename more files and be places after this mnt floppy C 3 Formatting The floppy may not be formatted so you may received an unable to read error If this occurs you can format the floppy like so BEFORE mounting it PC1 mkfs t msdos dev fd0 C 4 Unmounting Before the floppy can be removed safely it needs to be unmounted in Linux This is done by using the command PC1 umount mnt floppy Once the floppy is unmounted you can ejected it from the bay using the button NOTE The command is umount not unmount Sometimes the floppy will not eject If this event occurs try using these commands 3 LAB ONE Introduction to Linux and Equipment PC1 umount f mnt floppy PC1 umount l mnt floppy 4 OR These will force the floppy to unmount USB Drive The process to mount a USB drive is similar to a floppy but requires a little more work at the beginning After setup it is just a matter of mounting the drive C 5 First you need to make a directory to mount the USB drive to assuming it doesn t already exist PC1 mkdir mnt usbdrive PC1 chmod 700 mnt usbdrive C 6 Mounting Now we can mount the drive PC1 mount dev sda1 mnt usbdrive That s it The USB drive should be accessible with all file manipulation commands Exercise 3 Locating configuration files in Linux In this section a few configuration files will be used to explore the ability to change environment variables in Linux PART A Using the more Command SAVE DATA A 1 …


View Full Document

UCSC CMPE 150 - CMPE 150 –Lab 1

Documents in this Course
Load more
Loading Unlocking...
Login

Join to view CMPE 150 –Lab 1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CMPE 150 –Lab 1 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?