As always, I suggest that you read through the entire lab before you get started! The first portion will require cooperation with a partner on a different machine.
Back in the networking chapter, we discussed Network Address Translation. In this portion of the lab, we will configure a machine to function as a NAT device for another machine. Before we can get started, we need two machines connected to the right networks. The NAT machine must have network addresses on both the 192.168.1.0 network for Internet access, and on the 192.168.192.0 network to serve LAN clients. The client machine only needs a 192.168.192.0 network interface -- use ifdown to shut down the other network interface.
In order to configure the machines correctly, verify that you have two network cables, and that the odd numbered one is in NIC 1 (top, embedded NIC) and the even numbered one is in NIC 2 (bottom, PCI NIC). The even numbered one is the local LAN (*.192.0) and the odd one is the Internet-connected one (*.1.0).
If you have verified that your machine is properly wired, but both of your network adapters (using ifconfig) show *.1 addresses, you need to clear out your DHCP cache. To do that, shutdown your network interfaces using ifdown, and then cd to /etc/dhcpcd and remove all files (or just remove the files corresponding to eth0, which is the local LAN on the bottom). Then bring your interfaces back up (ifup ethX). Acquiring your IP address should be quick and painless this time. Note that if you want internet access, make sure to bring eth1 up last (so that it writes the correct /etc/resolv.conf).
Now that your networking is functional, take a look at the IP Masquerading instructions at the Linux Documentation Project. In particular, we will be using section 3.4.1 -- Configuring IP Masquerade on Linux 2.4.x Kernels. Copy the sample firewall code rc.firewall-2.4 into /etc/rc.d/rc.firewall-2.4 (make sure you didn't wrap any lines!) and chmod 700 so that it is executable.
We still need to make a few changes so that it will work for us. Near the beginning you'll need to change which interface is internal and which is external. We are using eth0 as internal, and eth1 as external. You'll also need to fix the path for iptables. Now you can run /etc/rc.d/rc.firewall-2.4 and it will configure your kernel using the iptables module for IP masquerading. (If you wanted to keep this arrangement beyond this lab, you would need to make this script execute on boot, perhaps by modifying rc.local to call it.) Note the IP address for eth0 as the client will need it.
On the client side, you need to configure your machine to use the NAT machine as its gateway -- sending all packets in that direction. You should have only one interface operational at the moment -- and it is a internal LAN address 192.168.192.*. If you run route, you'll see that you do not have a default routing address. Add one using the route add command (I'll let you figure out the arguments yourself).
Once both sides are functioning, the client will be able to reach the Internet via the NAT server. To verify, on the client telnet to 128.180.120.4 (the CSE webserver) on port 80, and once connected, type GET /. If there isn't too much traffic, running ethereal on the NAT server can also be fun, where you will be able to see packets coming in with one address and going back out with another.
Take a look at /etc/printcap. Note that there is nothing there. For once, I'll give instructions on using the built-in Red Hat tools to add a printer --- run redhat-config-printer-gui, add a new printer, name it whatever you want locally, but set it to talk to pl122-4000n on alfred.eecs.lehigh.edu and to use strict RFC1179 compliance. Set it to use the plain postscript driver. Apply your changes. Now you can see the entry in /etc/printcap. You can also run lpq -Plocal-printer-name to see the queue, or since this is LPRng, lpq -Ppl122-4000n@alfred would do the same thing even if we didn't have a printer defined.
To verify that it works, print some small test file. I suggest that you NOT use the standard printtool testpages as when you pick it up, you won't be able to tell if it is yours or someone else's. Create a short text file and print that instead.
Finally, take a look in /var/spool/lpd/ for your printer's subdirectory, and you should be able to find the cached copy of the text file that was printed (filename beginning with a df).