The first lab is fairly elementary, designed to get you thinking in terms of networks and networking. The last two labs both work with the /etc/inittab configuration file. Before working with that file, make sure to back it up first.
Lab 1
1. | You have 18 computers on a LAN behind a firewall. Diagram your computers on a sheet of paper. Connect them together in a "star" configuration. Assign a private IP address to each computer. Take one computer and draw a second connection to the Internet. While this is a fairly simple exercise, Linux is built for networking. To understand what you can do with Red Hat Enterprise Linux, you need to think in terms of the role of your computer on a network. | |
Answers
1. | There are many ways to configure the IP addresses on a LAN. But it is generally best to do it by setting up a network from one of the private IP address ranges. When you configure networking on your LAN, pay particular attention to the computer that also has a connection to the Internet. The IP address of its connection to your network will be the gateway address for every other computer on your LAN. It's also the logical location for any firewall that you may wish to configure. |
Lab 2
2. | In this lab, you'll start your experiments with the /etc/inittab file. So before you begin, back it up to a file such as /etc/inittab.bak or back up a copy to your home directory. -
Use the vi editor to open the /etc/inittab file in your computer. -
Take a look at your id variable. If it's set to 3, change it to 5; if it's 5 set it to 3. -
Reboot your computer and see what happens. -
Restore your original /etc/inittab file. | |
Answers
2. | When you troubleshoot a Red Hat Enterprise Linux computer, one of the things you'll be checking are critical configuration files. One key file in the boot process is /etc/inittab. One thing that I can do in this book is to illustrate the behavior of potential problems. The more problems you're familiar with, the easier it will be to troubleshoot or debug a problem during the RHCT and RHCE exams. However, there is often more than one way to solve a problem. I present one method, but you may be able to find others. To go through this lab, I'd take the following steps: -
Log in as the root user. You can do this from either the GUI or the text login interface. -
Run the cp /etc/inittab /root/inittab command. This backs up the subject configuration file in the root user's home directory. -
Open the subject file with the vi /etc/inittab command. -
Scroll down to until you see the following line: id:3:initdefault -
The number after the id command identifies your starting runlevel. If it's 3, Linux starts in text mode; if it's 5, Linux starts in the GUI. -
Change this number from 3 to 5 (or from 5 to 3). -
Save your changes and exit from the vi editor with the :wq command. -
Reboot your computer with the reboot command. -
Linux should now start in your new runlevel (3 or 5). -
Restore your original settings in /etc/inittab. You can do this by opening /etc/inittab with the vi editor. Alternatively, you can copy your backup from the /root directory with the cp /root/inittab /etc/inittab command. |
Lab 3
3. | In this lab, you'll experiment a bit more with the /etc/inittab configuration file. -
If you haven't already done so, create a backup for /etc/inittab. -
Press CTRL-ALT-F2. You should see a virtual console text login screen. -
Return to the original text console by pressing CTRL-ALT-F1 or the GUI console by pressing CTRL-ALT-F7. -
In the /etc/inittab file, identify the lines related to the virtual login consoles. -
Try experimenting with these lines with the mingetty commands. Add a comment character (#) in front of the second line with the mingetty command. -
Run the init q command to make Linux reread this file. -
Try pressing CTRL-ALT-F2 again. What happens? -
Restore your original /etc/inittab configuration file. | |
Answers
3. | In this lab, experiment with deactivating a specific virtual console. By default, six virtual text login consoles are configured in the /etc/inittab configuration file. You'll deactivate the second of the six consoles. -
Log in as the root user. You can do this from either the GUI or the text login interface. If you're in the GUI, open a text console. Right-click the desktop and choose New Terminal in the pop-up menu. -
Run the cp /etc/inittab /root/inittab command. This backs up the subject configuration file in the root user's home directory. -
Open the subject file with the vi /etc/inittab command. -
Scroll down until you see the following line: 2:2345:respawn:/sbin/mingetty tty2 -
Press CTRL-ALT-F2. This should start a text login interface. You should be able to log in at the prompt with your username and password. (If you've started at a text console, you don't need to use the CTRL button.) -
If you logged into the GUI, press CTRL-ALT-F7 to return to the GUI. If you logged into the text interface, press CTRL-ALT-F1 to return to your original screen. -
Turn the subject command in /etc/inittab into a comment. Add a comment character in front of the line as shown: #2:2345:respawn:/sbin/mingetty tty2 -
Close and save this change to /etc/inittab using the :wq command. -
Make Linux reread /etc/inittab with the init q command. -
Press CTRL-ALT-F2. This should start a text login interface. Try logging in again. You'll see that it's not possible. Now you can see how adding a comment character to the right line in /etc/inittab deactivates the second virtual console. -
If you logged into the GUI, press CTRL-ALT-F7 to return to the GUI. If you logged into the text interface, press CTRL-ALT-F1 to return to your original screen. -
Restore your original settings in the /etc/inittab file. |
-
The key Linux file associated with the CPU is /proc/cpuinfo. However, other files can tell you about how Linux detected the CPU, including /var/log/dmesg. The more you know about such files, the more problems you can diagnose with your hardware.