Using Red Hat Linux operating system to Setting up a Local Area Network

 

Using Red Hat Linux operating system to Setting up a Local Area Network
Darrick Addison
2001
 
This article describes how to build a Local Area Network (LAN) consisting of two or more computers running the Red Hat Linux operating system. The article begins with the basics: an overview of the TCP/IP (Transmission Control Protocol/Internet protocol) suite, and an explanation of assigning IP addresses in a LAN. Then the article covers the LAN hardware and configuration using a tool called LinuxConf in the Red Hat Linux operating system environment. Lastly, the article walks you through the critical steps of testing and troubleshooting your LAN.
Linux is increasingly popular in the computer networking/telecommunications industry. Acquiring the Linux operating system is a relatively simple and inexpensive task since virtually all of the source code can be downloaded from several different FTP or HTTP sites on the Internet. In addition, the most recent version of Red Hat Linux can be purchased from computer retail stores for between $25 and $50, depending on whether you purchase the standard or full version. The retail brand is indeed a worthwhile investment (vs. the free FTP or HTTP versions) since valuable technical support is included directly from the Red Hat Linux engineers for at least a year. This can be very helpful if, for instance, you can not resolve an installation/configuration problem after consulting the Red Hat Linux manuals.
This article describes how to put together a Local Area Network (LAN) consisting of two or more computers using the Red Hat Linux 6.2 operating system. A LAN is a communications network that interconnects a variety of devices and provides a means for exchanging information among those devices. The size and scope of a LAN is usually small, covering a single building or group of buildings. In a LAN, modems and phone lines are not required, and the computers should be close enough to run a network cable between them.
For each computer that will participate in the LAN, you'll need a network interface card (NIC) to which the network cable will be attached. You will also need to assign a unique hostname and IP address to each computer in the LAN (described later in this article), but this requires a basic understanding of TCP/IP (Transmission Control Protocol/Internet Protocol).
Introduction to TCP/IP
TCP/IP is the suite of protocols used by the Internet and most LANs throughout the world. In TCP/IP, every host (computer or other communications device) that is connected to the network has a unique IP address. An IP address is composed of four octets (numbers in the range of 0 to 255) separated by decimal points. The IP address is used to uniquely identify a host or computer on the LAN. For example, a computer with the hostname Morpheus could have an IP address of 192.168.7.127. You should avoid giving two or more computers the same IP address by using the range of IP addresses that are reserved for private, local area networks; this range of IP addresses usually begins with the octets 192.168.
LAN network address The first three octets of an IP address should be the same for all computers in the LAN. For example, if a total of 128 hosts exist in a single LAN, the IP addresses could be assigned starting with 192.168.1.x, where x represents a number in the range of 1 to 128. You could create consecutive LANs within the same company in a similar manner consisting of up to another 128 computers. Of course, you are not limited to 128 computers, as there are other ranges of IP addresses that allow you to build even larger networks.
There are different classes of networks that determine the size and total possible unique IP addresses of any given LAN. For example, a class A LAN can have over 16 million unique IP addresses. A class B LAN can have over 65,000 unique IP addresses. The size of your LAN depends on which reserved address range you use and the subnet mask (explained later in the article) associated with that range (see Table 1.).
Table 1. Address ranges and LAN sizes

Address range
Subnet mask
Provides
Addresses per LAN
10.0.0.0 - 10.255.255.255.255
255.0.0.0
1 class A LAN
16,777,216
172.16.0.0 - 172.31.255.255
255.255.0.0
16 class B LANs
65,536
192.168.0.0 - 192.168.255.255
25.255.255.0
256 class C LANs
256

 
Network and broadcast addresses
Another important aspect of building a LAN is that the addresses at the two extreme ends of the address range are reserved for use as the LAN's network address and broadcast address. The network address is used by an application to represent the overall network. The broadcast address is used by an application to send the same message to all other hosts in the network simultaneously.
For example, if you use addresses in the range of 192.168.1.0 to 192.168.1.128, the first address (192.168.1.0) is reserved as the network address, and the last address (192.168.1.128) is reserved as the broadcast address. Therefore, you only assign individual computers on the LAN IP addresses in the range of 192.168.1.1 to 192.168.1.127:
Network address: 192.168.1.0
Individual hosts: 192.168.1.1 to 192.168.1.127
Broadcast address: 192.168.1.128
Subnet masks
Each host in a LAN has a subnet mask. The subnet mask is an octet that uses the number 255 to represent the network address portion of the IP address and a zero to identify the host portion of the address. For example, the subnet mask 255.255.255.0 is used by each host to determine which LAN or class it belongs to. The zero at the end of the subnet mask represents a unique host within that network.
Domain name
The domain name, or network name, is a unique name followed by a standard Internet suffixes such as .com, .org, .mil, .net, etc. You can pretty much name your LAN anything if it has a simple dial-up connection and your LAN is not a server providing some type of service to other hosts directly. In addition, our sample network is considered private since it uses IP addresses in the range of 192.168.1.x. Most importantly, the domain name of choice should not be accessible from the Internet if the above constraints are strictly enforced. Lastly, to obtain an "official" domain name you could register through InterNIC, Network Solutions or Register.com. See the Resources section later in this article for the Web sites with detailed instructions for obtaining official domain names.
Hostnames
Another important step in setting up a LAN is assigning a unique hostname to each computer in the LAN. A hostname is simply a unique name that can be made up and is used to identify a unique computer in the LAN. Also, the name should not contain any blank spaces or punctuation. For example, the following are valid hostnames that could be assigned to each computer in a LAN consisting of 5 hosts: hostname 1 - Morpheus; hostname 2 - Trinity; hostname 3 - Tank; hostname 4 - Oracle; and hostname 5 - Dozer. Each of these hostnames conforms to the requirement that no blank spaces or punctuation marks are present. Use short hostnames to eliminate excessive typing, and choose a name that is easy to remember.
Table 2 summarizes what we have covered so far in this article. Every host in the LAN will have the same network address, broadcast address, subnet mask, and domain name because those addresses identify the network in its entirety. Each computer in the LAN will have a hostname and IP address that uniquely identifies that particular host. The network address is 192.168.1.0, and the broadcast address is 192.168.1.128. Therefore, each host in the LAN must have an IP address between 192.168.1.1 to 192.168.127.
Table 2. Sample IP addresses for a LAN with 127 or fewer interconnected computers

IP address
Example
Same/unique
Network address
192.168.1.0
Same for all hosts
Domain name
www.yourcompanyname.com
Same for all hosts
Broadcast address
192.168.1.128
Same for all hosts
Subnet mask
255.255.255.0
Same for all hosts
Hostname
Any valid name
Unique to each host
Host addresses
192.168.1. x
x must be unique to each host

 
Assigning IP addresses in a LAN
There are two ways to assign IP addresses in a LAN. You can manually assign a static IP address to each computer in the LAN, or you can use a special type of server that automatically assigns a dynamic IP address to each computer as it logs into the network.
Static IP addressing
Static IP addressing means manually assigning a unique IP address to each computer in the LAN. The first three octets must be the same for each host, and the last digit must be a unique number for each host. In addition, a unique hostname will need to be assigned to each computer. Each host in the LAN will have the same network address (192.168.1.0), broadcast address (192.168.1.128), subnet mask (255.255.255.0), and domain name (yourcompanyname.com). It's a good idea to start by visiting each computer in the LAN and jotting down the hostname and IP address for future reference.
Dynamic IP addressing
Dynamic IP addressing is accomplished via a server or host called DHCP (Dynamic Host Configuration Program) that automatically assigns a unique IP address to each computer as it connects to the LAN. A similar service called BootP can also automatically assign unique IP addresses to each host in the network. The DHCP/ BootP service is a program or device that will act as a host with a unique IP address. An example of a DHCP device is a router that acts as an Ethernet hub (a communications device that allows multiple host to be connected via an Ethernet jack and a specific port) on one end and allows a connection to the Internet on the opposite end. Furthermore, the DHCP server will also assign the network and broadcast addresses. You will not be required to manually assign hostnames and domain names in a dynamic IP addressing scheme.
Configuring the LAN
How you configure the computers on the LAN will depend on whether the Red Hat OS was installed before or after the LAN hardware. If you installed the LAN hardware before installing Red Hat you will be prompted for network configuration during the Red Hat installation process. However, if you installed the Red Hat OS after the LAN hardware, a program called "Kudzu" will detect the newly installed Ethernet card and initiate the configuration process automatically. Follow these steps when configuring each Ethernet card using the "Kudzu" program:
During the bootup process look for a dialog box titled "Welcome to Kudzu." Press Enter to begin the configuration process.
Next, you should see another dialog box that displays the brand name for the installed Ethernet card. Press Enter again to continue.
After a brief delay you should see "Would You Like to Set up Networking".
Select the NO option using the Tab key and then press Enter. I will describe setting up networking using a utility called LinuxConf later in this article.
At this point, the bootup process should continue normally and you will be required to log on to the computer as the root user. You should have been given the opportunity to create a root account during the initial installation of Red Hat.
Using LinuxConf to configure your Ethernet card
You can use an application program called LinuxConf to configure or reconfigure the NIC of each computer in the LAN. You can launch the LinuxConf utility by typing linuxconf at the command prompt of any terminal window in the KDE or GNOME desktop environment. Another way to start the LinuxConf utility is to click the Main menu button, select System, then LinuxConf. When the LinuxConf application is displayed, follow the steps below to configure the Ethernet card:
From the LinuxConf tree structure, select Config, Networking, Client Tasks, Basic Host Information.
Type the fully qualified hostname that you assigned to this computer on the Host name tab.
Next, click the Adaptor 1 tab, which displays your Ethernet card settings.
Verify that the Enabled button is selected to ensure that the Ethernet card will be accessible.
Choose the Manual option if you will not be using a DHCP or BootP server on your LAN and continue to step 6. Otherwise, if you will be using a DHCP or BootP server, choose either DHCP or BootP accordingly and continue to step 12.
Enter this computer's hostname followed by a period and the domain name of the LAN for the Primary name + domain option.
Enter the computer's hostname in addition to any aliases separated by a blank space under the Aliases option.
Enter the IP address assigned to this computer next to IP Address (such as 192.168.1.1).
Type in 255.255.255.0 for the Netmask.
For net device, type eth0, which represents the first Ethernet card located inside the computer.
The driver or Kernel Module option for the Ethernet card should automatically be filled in upon exiting LinuxConf.
Click the Accept button to activate all changes.
Repeat steps 1-12 for each computer in the LAN, verifying that you've entered the correct hostname and the corresponding IP address.
 
Troubleshooting the LAN
If you are unable to ping another computer in the LAN, here's how to get to the source of the problem. First of all, it's a good idea to shut down every computer in the LAN using the halt command. At the command prompt on each computer, type halt. The main reason for shutting down all computers is to monitor feedback from the boot process when each computer is started up again.
Check all cable connections between every computer, making sure that all RJ45 jacks are connected properly. After verifying that all the cables are secured properly, start each computer one at a time and look for the following response during the boot process:
Setting hostname: hostname.networkname [OK]
You can turn on the interactive mode by typing I at the LILO boot prompt during the initial bootup process of Red Hat to get a closer view of the feedback. Ensure that the hostname and network name that was assigned to this computer is spelled correctly. If this is not the case, you will need to return to the Basic Host Information section of LinuxConf. In interactive mode you will be prompted to start several services. Respond to each question with Yes and pay close attention to results of various tests. If the Kudzu program detects an Ethernet card, then this an indication that the card was not properly configured the first time around. Proceed to let Kudzu configure the card. When you are prompted to configure the network, choose "Yes" and type the correct IP address and other related information for this particular computer.
Another important response to examine carefully is the following:
Bringing up interface eth0          [OK]
This line indicates whether the Ethernet card is working properly. If this test fails you should check all network settings using LinuxConf to ensure that the card was configured properly. If the network settings are correct, there is probably a defect in the Ethernet card itself. In order to verify this, consult the manufacturer of the Ethernet card or a computer technician to determine whether or not the card is defective. Repeat the preceding troubleshooting procedures on each new Ethernet card installed.
Summary
The process of setting up a LAN using Red Hat Linux is a relatively straightforward task -- even for users with little or no LAN background -- when the preceding steps are carefully understood and performed. Moreover, there are vast resources available on the Web that describe in more detail the topics covered in this article. A good start would be to feed keywords (like LANs, configuring LANs, Linux network configuration, and TCP/IP) into your favorite Web search engine. You will be amazed at the wealth of information that is available on configuring LANs, building networks, Red Hat Linux network installation/configuration, the TCP/IP protocol suite, and on and on. Good luck!
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值