Some Unix Stuff (assumes thunder account but works on astro or nimbus as well) (by Dr. Robert Stafford) 1. Famous unix directories and files include the following: / - called "slash", the top level directory /vmunix - the unix operating system (machine language file) /etc - directory containing system configuration files and management commmand, rhymes with Betsy /etc/hosts, /etc/services, /etc/protocols - famous network files /etc/resolv.conf, /etc/passwd, /etc/groups - more configuration files /bin - directory containing user commands /usr/bin, /usr/local/bin, /sbin, /usr/sbin - more command directories /usr/etc/bin, /usr/ucb, /usr/local/etc - more command directories /home - directory of user, class, and department subdirectories 2. The man command (e.g. "man telnet") can be used to get more information on any of the following commands. 3. If you enter a command (e.g. ping) and receive the message "Command not found", it usually means that unix is not looking in the directory that contains the command. If this happens on thinder, try "whereis ping", then "cd" to the correct directory and reenter the command. (For a permanant fix, edit the "path" statement in the file ".login"). 4. "telnet rs.internic.net" - to log in to the network information center) try "whois" and then your name to find any networking relatives. In "whois", try "temple.edu" to see the people that run Temple's network. 5. "ftp ds.internic.net" - file transfer from the Data Server at the INTERnet Network Information Center. Use account "anonymous" with your mail address as password. Try "dir", "cd rfc", "ascii" and finally "get rfc2151.txt". Use "bye" to exit ftp and "more rfc2151.txt" to read the document. Be sure to look in the fyi, rfc and internet-draft subdirectories on ds.internic.net. 6. "more /etc/hosts" to see your local "internet name and address" file 7. "more /etc/protocols" to see what protocols can be carried in IP packets. 8. "more /etc/services" to see the ports are used by will known services. 9. "more /etc/resolv.conf" to see the nameservers that thunder uses. 10. "ping ds.internic.net" - to see if computer ds.intenic.net is responding 11. "netstat -nr" to print thunder's routing tables including interface names such as tu0 (Ethernet) and lo0 (loopback). see man netstat. 12. "arp -a" to print thunder's Ethernet to IP translation table 13. "ifconfig tu0" to see the Ethernet board configuration 14. "nslookup nis.nsf.net" to find IP address of computer nis.nsf.net 15. "nslookup", then "?" to do a lot more. 16. "traceroute ds.intenic.net" for path to computer "ds.internic.net" 17. "finger stafford@thunder.ocis.temple.edu" to see when I last logged in. Unix Schavenger Hunt - First of two copies (This is your copy to keep. Two pages down you will find a second copy to hand in.) If your account is on nimbus or astro, change "thunder" to "astro" or "nimbus" as required. Note that some questions require both and answer as well as the name of the file or command that was used to find the answer. 1. Thunder's full internet name (it is located in a file) answer: __________________________ name of file: _______________________ 2. Thunder's two internet nicnames (located in the same file) answer: __________________________ name of file: _______________________ 3. The name (two letters and a digit) of Thunder's Ethernet interface (lo0 is the name of the loopback interface). answer: __________________________ command: ____________________________ 4. The IP address attached to Thunder's loopback interface (lo0). IP address: ____.____.____.____ command: ____________________________ 5. The IP netmask attached to Thunder's loopback interface (lo0). IP mask: ____.____.____.____ command: ____________________________ 6. The maximum packet size (maximum transmission unit or MTU) used with Thunder's loopback interface (lo0). answer: __________________________ command: ____________________________ 7. The IP address attached to Thunder's Ethernet interface. IP address: ____.____.____.____ command: ____________________________ 8. The IP netmask attached to Thunder's Ethernet interface. IP mask: ____.____.____.____ command: ____________________________ 9. The maximum packet size (MTU) on Thunder's Ethernet interface. answer: __________________________ command: ____________________________ 10. The IP address of Thunders default router. IP address: ____.____.____.____ command: ____________________________ 11. Name of the file on Thunder that contains lines such as "ftp 21/tcp". name of file: ____________________________ 12. Name of the file on Thunder that contains lines such as "tcp 6" (which tells you that a "6" in the IP protocol field specifies tcp). name of file: ____________________________ 13. Name of the file on Thunder that contains the names of thunder's nameservers (it also contains the line "domain temple.edu".) name of file: ____________________________ 14. IP addresses of thunder's name servers (from the file above) IP address: ____.____.____.____ IP address: ____.____.____.____ 15. Send 100 ping packets to ds.internic.net and fill in the following: packets lost ____ round-trip time min ____ ave ____ max ____ 16. Send 100 ping packets to www.nus.sg and fill in the following: packets lost ____ round-trip time min ____ ave ____ max ____ 17. How many hops are in the path from thunder to ds.internic.net. hops: _____ command: ____________________________ 18. How many hops are in the path from thunder to www.nus.sg. hops: _____ command: ____________________________ 19. What national network provider do Temple and PrepNet use? (Hint - it is where packets go after they leave PrepNet.) answer: __________________________ command: ____________________________ 20. What national network does Stanford University use? (Hint - try traceroute www.stanford.edu) answer: __________________________ command: ____________________________ 21. What are the legal values for a "class A" internet address (book or web). min IP address: ____.____.____.____ max IP address: ____.____.____.____ 22. What are the legal values for a "class B" internet address (book or web). min IP address: ____.____.____.____ max IP address: ____.____.____.____ 23. What are the legal values for a "class C" internet address (book or web). min IP address: ____.____.____.____ max IP address: ____.____.____.____ 24. What are the legal values for multicast addresses (book or web). min IP address: ____.____.____.____ max IP address: ____.____.____.____ 25. What class B internet address is assigned to Prepnet (they have some class C addresses as well). IP address: ____.____.____.____ 26. What block of class C addresses does MCI's use for their "backbone" (examine traceroute results to various destinations). min IP address: ____.____.____.____ max IP address: ____.____.____.____ 27. Give the IP addresses and Ethernet addresses of at least four computers on thunders Ethernet segment. IP address: ____.____.____.____ Ethernet address ___:___:___:___:___:___ IP address: ____.____.____.____ Ethernet address ___:___:___:___:___:___ IP address: ____.____.____.____ Ethernet address ___:___:___:___:___:___ IP address: ____.____.____.____ Ethernet address ___:___:___:___:___:___ Telnet to each of the following ports on several unix machines (e.g. "telnet yoda.cis.temple.edu 7" to talk to port 7 on yoda), enter the line or lines indicated, and tell in one sentence what the port sends back. (Some systems don't respond some standard ports, so you may have to try several machines). command message 28. telnet yoda.cis.temple.edu 7 abcd _______________________________________________________________________ 29. telnet yoda.cis.temple.edu 9 abcd _______________________________________________________________________ 30. telnet yoda.cis.temple.edu 13 _______________________________________________________________________ 31. telnet thing1.ocis.temple.edu 21 HELP _______________________________________________________________________ 32. telnet thunder.ocis.temple.edu 23 _______________________________________________________________________ 33. telnet yoda.cis.temple.edu 25 EXPN stafford _______________________________________________________________________ 34. telnet thing1.ocis.temple.edu 70 (enter a blank line - press return) _______________________________________________________ 35. telnet thunder.temple.edu 79 stafford _______________________________________________________ 36. telnet 155.247.166.60 80 GET /~stafford HTTP/1.0 (plus an extra blank line) _______________________________________________________ The following questions can be answered with "nslookup" (hint - type a question mark when you get into nslookup to get the help screen). 37. What computers serve as the authoritative name servers for the temple.edu domain (hint - set type=ns, and there are three of them) IP address: ____.____.____.____ name _______________________________ IP address: ____.____.____.____ name _______________________________ IP address: ____.____.____.____ name _______________________________ 38. What computers serve as the official name servers for the pitt.edu domain? IP address: ____.____.____.____ name _______________________________ IP address: ____.____.____.____ name _______________________________ IP address: ____.____.____.____ name _______________________________ 39. What computers serve as the official name servers for cs.pitt.edu. (Note that, unlike cis.temple.edu, cs.pitt.edu runs their own domain.) IP address: ____.____.____.____ name _______________________________ IP address: ____.____.____.____ name _______________________________ 40. Temple has been assigned two "class B" addresses. One of them is 155.247.xxx.yyy. Can you find the other one. (Hint - nslookup, then "ls -d temple.edu" or "ls -d temple.edu > junk.txt") IP address: ____.____.____.____ 41. How many different computers (really "A" records) are listed for the temple.edu domain (hint, "ls temple.edu > temple.txt" and "grep"). Number of computers _______________ 42. List the first three "top level" domain servers (Hint - set type=ns, and look up the nameserver for ""edu". name: _________________________ IP address: ____.____.____.____ name: _________________________ IP address: ____.____.____.____ name: _________________________ IP address: ____.____.____.____ 43. Find the name and address of a name server for France (If you don't know the name of the domain, telnet to rs.internic.net and use whois to find "france" or "france-dom" name: _________________________ IP address: ____.____.____.____ 44 What is the name and nicname of 206.77.62.2. (Hint, try type=ptr and then enter the IP address backwords appending ".in-addr.arpa".) name: _________________________ nicname: ________________________ 45. Telnet to the ftp server port on ftp.temple.edu and give the ftp server the help command (telnet ftp.temple.edu 21, then enter HELP). Circle the ftp commands can you get to work properly. USER PORT STOR MSAM* RNTO NLST MKD CDUP PASS PASV APPE MRSQ* ABOR SITE XMKD XCUP ACCT* TYPE MLFL* MRCP* DELE SYST RMD STOU SMNT* STRU MAIL* ALLO CWD STAT XRMD SIZE REIN* MODE MSND* REST XCWD HELP PWD MDTM QUIT RETR MSOM* RNFR LIST NOOP XPWD 46. Telnet to the http server on thunder and get my demo.html page ("telnet thunder 80", then "GET /~stafford/demo.html HTTP/1.0", and finally enter a blank line). List the first five lines that are returned. line 1. _______________________________________________________ line 2. _______________________________________________________ line 3. _______________________________________________________ line 4. _______________________________________________________ line 5. _______________________________________________________ 47. What RFC describes the protocol for these lines. ___________ 48. What other values can you find for the content type? Content type Description ____________ ______________________________________________ ____________ ______________________________________________ ____________ ______________________________________________ ____________ ______________________________________________ ____________ ______________________________________________