Part 1: Basic Network Terminology
Before setting up a network or accessing an existing network, it is important to know some key terms that are related to networking. This section explores the terms you should be aware of. Some of the terms are basic and you may already be familiar with them, however others are more advanced.
Host: A host is basically a computer. However, many people have a more limited idea of what a computer is (like a desktop computer or a laptop). In reality, many other devices are also computers, such as cell phones, digital music players and many modern televisions. In networking terms, a host is any device that communicates with another device.
Network: A network is a collection of two or more hosts (computers) that are able to communicate with each other. This communication can be via a wired connection or wireless.
Internet: The Internet is an example of a network. It consists of a publically accessible network that connects millions of hosts throughout the world. Many people use the Internet to surf web pages and send/receive email, but the Internet has many additional capabilities besides these activities.
Wi-Fi: The term Wi-Fi refers to wireless networks.
Server: A host that provides a service to another host or client is called a server. For example, a web server stores, processes and delivers web pages. An email server receives incoming mail and delivers outgoing mail.
Service: A feature being provided from a host is a service. An example of a service would be when a host provides web pages to another host.
Client: A client is a host that is accessing a server. When you are working on a computer surfing the Internet, you are considered to be on a client host.
Router: Also called a gateway, a router is a machine that connects hosts from one network to another network. For example, if you work in an office environment, the computers within the company can all communicate via thelocal network created by the administrators. To access the Internet, the computers would have to communicate with a router that would be used to forward network communications to the Internet. Typically when you communicate on a large network (like the Internet), there are several routers that are used before your communication reaches its final destination.
The following diagram provides a visual reference for several of the terms discussed above:
1. Networking Features Terminology
In addition to the networking terms discussed in the last section, there are some additional terms that you should be aware of. These terms focus more on the different types of networking services that are commonly used as well as some of the techniques that are used to communicate between machines.
Network packet: A network packet is used to send network communication between hosts. By breaking down communication into smaller chunks (packets), the data delivery method is much more efficient.
IP address: An Internet Protocol (IP) address is a unique number assigned to a host on a network. Hosts use these numbers to "address" network communication. More discussion on IP addresses will occur later in this chapter.
Network mask: Also called a netmask or mask, a network mask is a number system that can be used to define which IP addresses are considered to be within a single network. Because of how routers perform their functions, networks have to be clearly defined.
Hostname: Each host on a network could have its own hostname. This makes it easier for humans to address network packets to another host because names are easier for humans to remember than numbers. Hostnames are translated into IP addresses before the network packet is sent on the network.
DHCP: Hosts can be assigned hostnames, IP addresses and other network-related information by a DHCP (Dynamic Host Configuration Protocol) server. In the world of computers, a protocol is a well-defined set of rules. DHCP defines how network information is assigned to client hosts and the DHCP server is the machine that provides this information. While setting up a DHCP server is beyond the scope of this chapter, you will see how to configure a DHCP client machine later in this chapter.
DNS: As mentioned previously, hostnames are translated into IP addresses, prior to the network packet being sent on the network. This means that your host needs to know the IP address of all of the other hosts that you are communicating with. When working on a large network (like the Internet), this can pose a challenge as there are so many hosts. A DNS (Domain Name Server) server provides the service of translating domain names into IP addresses. While setting up a DNS server is beyond the scope of this chapter, you will see how to configure a DNS client machine later in this chapter.
Ethernet: In a wired network environment, Ethernet is the most common way to physically connect the hosts into a network. Ethernet cables are connected to network cards that support Ethernet connections. Ethernet cables and devices (such as routers) are specifically designed to support different speeds of communications, the lowest being 10 Mbps (10 Megabits per second) and the highest being 100 Gbps (100 gigabits per second). The most common speeds are 100 Mbps and 1 Gbps.
TCP/IP: The Transmission Control Protocol/Internet Protocol (TCP/IP) is a fancy name for a collection of protocols (remember, protocol = set of rules) that are used to define how network communication should take place between hosts. While it isn‘t the only collection of protocols used to define network communication, it is the most often utilized one. As an example, TCP/IP includes the definition of how IP addresses and network masks work.
2. IP Addresses
As previously mentioned, hosts "address" network packets by using the IP address of the destination machine. The network packet also includes a "return address", the IP address of the sending machine.
There are, in fact, two different types of IP addresses: IPv4 and IPv6. To understand why there are two different types, you need to understand a brief bit of IP addressing history.
For many years, the IP addressing technique that was used by all computers was IPv4 (IP version 4). In an IPv4 address, a total of four 8-bit (8-bit = numbers from 0 to 255) numbers are used to define the address. For example:192.168.10.120. Note, this is considered a 32-bit address (4 x 8-bit = 32).
Each host on the Internet must have a unique IP address. In an IPv4 environment, there is a technical limit of about 4.3 billion IP addresses. However, many of these IP addresses are not really useable for various reasons. Also, IP addresses have been assigned to organizations that haven‘t fully made use of all of the IP addresses they had available.
While it seems like there should be plenty of IP addresses to go around, various factors (the increasing number of hosts on the Internet, reserved private IP addresses, etc.) led to a problem: The Internet started running out of IP addresses.
This, in part, encouraged the development of IPv6. IPv6 was officially "created" in 1998. In an IPv6 network the addresses are much larger, 128-bit addresses that look like this: 2001:0db8:85a3:0042:1000:8a2e:0370:7334. Essentially this provides for a much larger address pool, so large that running out of addresses any time in the near future is very unlikely.
It is important to note the difference between IPv4 and IPv6 isn‘t just "more IP addresses". IPv6 has many other advanced features that address some of IPv4‘s limitations, including better speed, more advanced package management and more efficient data transportation.
Considering all the advantages, you would think that by now all hosts would be using IPv6. This isn‘t the case at all. The majority of network-attached devices in the world still use IPv4 (something like 98-99% of all devices). So, why hasn‘t the world embraced the superior technology of IPv6?
There are primarily two reasons:
- The invention of NAT: Invented to overcome the possibility of running out of IP addresses in an IPv4 environment, Net Address Translation (NAT) used a technique to provide more hosts access to the Internet. In a nutshell, a group of hosts are placed into a private network with no direct access to the Internet; a special router provides Internet access and only this one router needs an IP address to communicate on the Internet. In other words, a group of hosts share a single IP address, meaning a lot more computers can attach to the Internet. This feature means the need to move to IPv6 is less critical then before the invention of NAT.
- Porting issues: Porting is switching over from one technology to another. IPv6 has a lot of great new features, but all of the hosts need to be able to utilize these features. Getting everyone on the Internet (or even just some) to make these changes poses a challenge.
Most experts agree that IPv6 will eventually replace IPv4, so understanding the basics of both is important for those who work in the IT industry.
Part 2: Configure Network Devices
When you are configuring network devices, there are two initial questions that you need to ask:
- Wired or wireless? Configuring a wireless device will be slightly different than a wired device because of some of the additional features typically found on wireless devices (such as security).
- DHCP or static address? Recall that a DHCP server provides network information, such as your IP address and subnet mask. If you don‘t make use of a DHCP server, then you will need to manually provide this information to your host. This is called using a static IP address.
Generally speaking, a desktop machine will use wired network, while a laptop will use wireless. Normally a wired machine uses a static IP address, but these can also often be assigned via a DHCP server. In almost all cases, wireless machines use DHCP since they are almost always mobile and attached to different networks.
1. Configure the Network Using GUI
2. Configuring the Network Using Configuration Files
There will be times when no GUI-based tool will be available. In those cases, it is helpful to know the configuration files that are used to store and modify network data.
These files can vary depending on the distribution that you are working on. The following examples are provided for CENTOS systems.
2.1 Pimary IPv4 Configuration File
The primary configuration file for an IPv4 network interface is the/etc/sysconfig/network-scripts/ifcfg-eth0
file. The following demonstrates what this file looks like when configured for a static IP address:
If the device was configured to be a DHCP client, then the IPADDR, GATEWAYand DNS1 values would not be set. Additionally, the BOOTPROTO value would be set to "dhcp".
[[email protected] ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eno1 HWADDR=44:37:E6:C8:AF:CF TYPE=Ethernet BOOTPROTO="none" DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no NAME=eno1 UUID=98971396-983e-47a2-9ee7-a8706eec59ff ONBOOT=yes IPADDR="192.168.1.100" PREFIX="24" GATEWAY="192.168.1.1" DNS1="218.2.135.1" DNS2="210.29.144.1"