Several years ago I began a unit with my CS students that examined how the Internet worked. The curriculum I was using had an unplugged activity that was designed to demonstrate how routers work on the Internet. While useful in developing some background knowledge, having worked in information technology previously, I did not believe that this was the best approach to learn how the internet actually functioned. I felt I could provide a more impactful learning experience by actually having the students use a file server connected to the internet so they could explore IP (internet protocol) commands and view how computers communicate. With an operating server, they could explore some of the more popular tools available on the command line that IT managers rely on to probe network operations.
Get the hardware ready
The first step was to find suitable hardware that would function as the server. As noted in my previous blog, I had a few candidates in my pile of computers that could be put to use. Never assume that you need something brand new and particularly powerful to be a server. In fact, since a network operating system is usually not burdened by a graphical user interface, even modest hardware will provide acceptable performance. In my home I am using a 10 year old system that is running the latest 32-bit version of Ubuntu server with only 4GB of RAM.
(Note: having this server at my home also affords me the opportunity to try all of my lessons prior to assigning them to my students).
For my classroom where I expected to support approximately 30 users simultaneously, I employed a more robust system pictured below. As the empty space in the case suggests, the donated computer had been stripped of optical drives, hard drive and also its video card. Still, it had a fairly fast first generation Intel Core i7 CPU and 12 MB of RAM. All I needed to add was a hard drive (1TB was sufficient), a basic $15 video card and use the USB ports and thumb drive to install the operating system.
My classroom Linux Server:
With the hardware intact, the next step was to install and configure the software. I decided that I would guide my students in the deployment of an Ubuntu Linux Server for our classroom. I settled on Ubuntu for several reasons. First, it is the most widely used distribution and the support available from the community is quite good. Second, since it is based on Debian, there are virtually limitless libraries of software that can be added when needed.
The installation of the server software is fairly automatic. Since it is text based, all you need is a monitor and keyboard, and to answer a series of prompts. Servers can be configured for a variety of purposes (file servers, web servers, mail servers, etc.) but for my classroom I specified that the system should be configured as a standard file server. Once my server completed with the default installation of files, I had to add SSH (Secure Shell) to enable all of my students to access the server remotely with client software installed on the classroom systems. This Ubuntu documentation contains all of the commands to complete the SSH installation.
While watching the installation screen flash by may not be the most exciting lesson to view, most of my students were pretty attentive since they had never done anything like this before. Once the server is running, you have the option of rendering it “headless.” While this may sound gruesome it simply means that the system does not have a monitor and all configuration is done remotely.
Establish User Accounts
Adding a user account with Linux is very simple. At a terminal prompt, use the command adduser. There are plenty of guides to help with this process available on the internet.
$ adduser user_name
I typically have all the students setup their own accounts from a terminal shell I have on my classroom computer. It is a quick process and I want to make sure that they can successfully login at my console. I suggest setting up some generic “student accounts” when you have a few extra minutes. These can come in handy when you are testing something, or when a student forgets their password or username.
There are a number of SSH clients available on whatever operating systems you classroom uses. In my environment, the Windows computers with student accounts were not permitted to install software directly on them. However, students could configure their Chrome web browsers with add-ons.
FireSSH has proven to be a reliable tool in my classroom. Versions for Firefox and Chrome are available and the support for text based interaction with the server is straightforward. You will need to determine the IP address for your server as it will be needed for shell access.
While the above steps may sound difficult and time consuming the entire process is actually pretty quick.
The document below was used with my students. Since every student is using a shell account, all of the commands are being issued via the same Ethernet card in the server. This ensures that every student will get consistent results. I was also able to demonstrate the commands from my own computer and display the results on the classroom display projector. (Note: I made the default font size bigger in my terminal to ensure readability.) While some of the information returned by the commands can seem arcane, my students really enjoyed learning how to use the Linux command line. I made sure to share this user guide with them. One of my students was so inspired that he purchased a cloud based Linux server to host a gaming platform for multiple players.
PING: The ping command is used to test if your network interface is working and if you can “see” another computer on the Internet. The IP address 127.0.0.1 is the default “broadcast” or test address. See if the following works.
$ ping 127.0.0.1
To find out IP address of Linux/UNIX system you need to use a command called ifconfig. It displays Ethernet IP address, Mac address, subnet mask and other information.
Type /sbin/ipconfig command to display IP address:
It is usually recommended that you use the IP command under Linux based systems. The following command will show all IP address:
$ ip addr show
How do I find out my DNS server IP address assigned by my ISP under Unix or Linux operating system using command prompt? How do I find preferred DNS server under Debian / Ubuntu / Fedora Linux desktop system?
Under Unix or Linux operating systems the resolver is used that provide access to the Internet Domain Name System (DNS). The resolver configuration file is located at /etc/resolv.conf location and it contains information that is read by the resolver routines the first time they are invoked by a process. Use the cat command or grep command to find out your DNS server addresses as follows:
$ cat /etc/resolv.conf
Grep searches one or more input files for lines containing a match to a specified pattern. By default, Grep outputs the matching lines. In this example, we are searching for the NAMESERVER entry in the RESOLV.CONF (resolve configuration file in the /etc directory)
The grep command can be used as follows:
$ grep nameserver /etc/resolv.conf
What the heck is the NAMESERVER??
Every computer hooked up to the Internet has a unique IP address. It would be a major pain to type in 184.108.40.206 or other numerical IP address every time you wanted to go to a particular website. The nameserver resolves or determines that www.whatever.com is actually 220.127.116.11. By the way, when you ping a website, it will tell you the IP address!
TRACEROUTE: Once you have determined that the interface if functional, you can use this command to TRACE the ROUTE that a packet will take from your computer to the target. You can test either a domain name OR a specific IP address.
$ traceroute WWW.WHATEVER.COM
$ traceroute 18.104.22.168
Sample output from a Linux terminal screen
Probing deeper and further
Once the server and clients are running, you can utilize the platform for a tremendous variety of computer science lessons. While I initially aimed to have the server be part of a networking lesson, it quickly became the system my students used for Python programming, C programming and Bash scripting. Many of my former students and friends that are professional network managers or programmers routinely rely on Linux systems for their work.
Learning about the systems that support software development will make you a better programmer. With the installation of some additional programs, your Linux server can also become a web server. Not only can students learn how to write HTML, they will now have the ability to see the directory structure for files on an Apache system and learn how to manage it.
I would love to hear from CS teachers that are using Linux servers in their practice. Please send me your questions and share what amazing things you are doing with your students.
Neil Plotnick (firstname.lastname@example.org) works at Everett High School, an urban district located just north of Boston. In 2015, he was a recipient of the Presidential Award for Excellence for Math and Science Teaching (PAEMST). He has taught Exploring Computer Science and was a pilot site for the AP Computer Science Principles course developed by Code.org during the 2015-16 academic year.