Lab Workbook UNIX: The Textbook 2nd Edition Chapter 14 NAME: STUDENT ID: DATE: Lab 14 (Chapter 14) Lab Work 1. Log on to your UNIX system 2. What are the IP address, Ethernet address, and domain name of your host? What is the class of your address and how did you know this? Show the session that you used to obtain answers to your questions. 3. Get the IP addresses for the following hosts: cs.berkeley.edu, www.nato.int, www.abc.tv, www.nasa.gov, www.lumensoft.biz, cnn.com, and mit.edu. If a host has multiple IP address and/or domain names, list them all, along with the classes of the IP addresses. HINT: Use the “host” command for each host. 4. Browse the IETF website, locate the citation for the latest RFC, and write down the following information about it: RFC number, title, author(s) or editor(s), date submitted, and status. HINT: IETF website is http://www.ietf.org/rfc.html. Look at “RFC Index”. 5. Read through RFC 1118 and identify the RFC numbers for the original RFCs that describe the following protocols: TCP, IP, UDP, ICMP, SMTP, FTP, and Telnet. HINT: Use google to search for “RFC1118”. If you get tired of reading, look at Appendix B. 6. Use the telnet command to get the current time from the daytime server running on the Lab Server 10.1.110.20. Show your session. HINT: The dayfile service uses port 13. Look at UNIX The Textbook Page 397. 2 7. Use the telnet command to invoke the finger server at iastate.edu and display the number of users who have Davis as part of their names. Show your session. HINT: Look at UNIX The Textbook P.397. The finger server at iastate.edu uses port 79. 8. Use the telnet command to invoke the finger server at iastate.edu, and then use UNIX pipe and UNIX I/O redirection primitives to save in a file the information returned by the finger server about users Davis as part of their names. Display the saved information with the more command. After the first page, terminate the more command. Show your session. 9. What would you do if you were asked to repeat the task outlined in 8, except that you are to save information about “Davis, James A” in a file called James.A.Davis? Display contents of the file. Show your work. 10. Use the traceroute command to obtain the hop count and the time taken for one-way travel of data from your host to www.jntuh.ac.in. Show your session. What are the round trip times for the 9th and 10th IP network that was traversed? Explain the difference in round-trip times. 11. Create a text file containing several lines of student data in a file. Use the vi session shown below. $ vi smallFile <Go into insert mode by typing “i”.> <Copy and paste the text below.> <Exit insert mode with “<ESC>”>. John Doe ECE 3.54 doe@jd.home.org James Davis ECE 3.71 davis@jd.work.org Al Davis CS 2.63 davis@a.lakers.org Ahmad Rashid MBA 3.74 ahmad@mba.org Sam Chu ECE 3.68 chu@sam.ab.com Arun Roy SS 3.06 roy@ss.arts.edu Rick Marsh CS 2.34 marsh@a.b.org James Adam CS 2.77 jadam@a.b.org Art Pohm ECE 4.00 pohm@ap.a.org John Clark ECE 2.68 clark@xyz.ab.com Nabeel Ali EE 3.56 ali@ee.eng.edu 111.222.3333 111.222.1111 111.222.2222 111.222.4444 111.222.5555 111.222.8888 111.222.6666 111.222.7777 111.222.9999 111.111.5555 111.111.8888 3 Tom Nelson Pat King Jake Zulu John Lee Sunil Raj Charles Right Diane Rover Aziz Inan <Esc><Z><Z> ECE SS CS EE ECE EECS ECE EECS 3.81 2.77 3.00 2.64 3.36 3.31 3.87 3.75 nelson@tn.abc.org king@pk.xyz.org zulu@jz.sa.org jlee@j.lee.com raj@sr.cs.edu right@cr.abc.edu rover@dr.xyz.edu ainan@ai.abc.edu 111.111.6666 111.111.7777 111.111.9999 111.111.2222 111.111.3333 111.111.4444 111.111.5555 111.111.1111 The “ssh” command is the secure version of the “rlogin” and “rsh” command. Use “ssh” to execute the “sort” command on a remote host, 10.1.110.20, on your local network. The username/password on the remote host is cs206temp/cs206temp. The input file is smallFile from the local host and the sorted output is placed in file sorted_smallFile on the local host. After executing sort command on the remote host, show the sorted file using “cat” command. Show your work. HINT: When connecting to the remote host using “ssh”, use the “-l user” option where “user” is the login name on the remote host (“cs206temp”). 12. In Problem 11, execute the “sort” command on the remote host, but instead of saving the sorted file on the local host, save the sorted file on the remote host. Show your work. NOTE: Since other students in the class will be using the same login, the file saved on the remote host should have a unique name (i.e. the file name could have your initials). Login to the remote host using “ssh” and verify the remote host has the sorted file. Show your work. 13. The “scp” command is the secure version of the “rcp” command. Use “scp” to copy the file sorted_smallFile created in Problem 11 to remote host, 10.1.110.20. The username/password on the remote host is cs206temp/cs206temp. Show your work. NOTE: Since other students in the class will be using the same login, the file saved on the remote host should have a unique name (i.e. the file name could have your initials). Login to the remote host using “ssh” and verify the remote host has the copied file. Show your work. 14. Log out 4