Skip to main content

LFCS Certification Course

Chapter #33: Configure IPv4 and IPv6 Networking

In this chapter, learn what an IP address is, explore IPv4 vs IPv6, configure Linux IP addresses, and set up hostname resolution for network connectivity.

As a systems administrator, you will occasionally be tasked with configuring or setting up the IP addresses of your servers to keep up with changing network requirements.

As such, having fundamental skills in assigning IP addresses and configuring hostname resolution is crucial in ensuring that servers conform to the network topology.

In this chapter, we'll:

  • Understand what an IP address is and explore the differences between IPv4 and IPv6.
  • Demonstrate how to configure IPv4 and IPv6 addresses on Linux systems.
  • Learn how to set up hostname resolution.

What is an IP Address?

An IP address, which stands for Internet Protocol, is a unique numerical identifier or address that identifies a device in a TCP/IP network, which could be a local area network (LAN) or the Internet.

The IP address allows communication between devices in a network, such as servers, routers, switches, and any other network device connected to the network.

Understand IP Address Infographic for Beginners

IPv4 vs IPv6

An IP address can be broadly categorized into two: IPv4 and IPv6.

Undestanding IPv4 vs IPv6 Address

IPv4

An IPv4 (IP version 4) address is a 32-bit number that is split into four octets, with each octet separated by a period or a decimal point, which is usually referred to as dotted-decimal format.

Each octet is made up of 8 bits, which collectively represent a byte. An IPv4 address can further be divided into two sections. The first part represents the network section, while the remaining part defines the host section.

Network Section

The network section of an IP address identifies the class the IP address belongs. There are 3 distinct classes of IP addresses used in computer networks: Class A, Class B, and Class C.

Class A:

  • In Class A type of network, the first 8 bits (octet) define the network, while the remaining 24 bits are reserved for the hosts in the network.
  • The Public IP addresses range from 1.0.0.0 to 127.0.0.0.
  • Private IP addresses range from 10.0.0.0 to 10.255.255.255.
  • Addresses 127.0.0.0 to 127.255.255.255 are reserved for loopback and other diagnostic purposes, and hence are not allocated to hosts in a network.
  • The default subnet mask of class A is 255.0.0.0, with the first 8 bits used to identify the network. The remaining 24 bits are designated for hosts.
  • This class is used in networks that command a large number of hosts. It yields a maximum of 16,777,214 hosts and 126 networks.

Class B:

  • In Class B, the first two octets or 16 bits are used to define the network ID.
  • The Public IP addresses range from 128.0.0.0 to 191.255.0.0.
  • The private IP range is from 172.16.0.0 to 172.31.255.255.
  • The default subnet mask is 255.255.0.0, where the first 16 bits define the network ID.
  • This class of IP is typically used for medium to large-sized networks and yields 65,534 hosts per network with a total of 16,382 networks.

Class C:

  • This class of IP is mostly used for small networks, such as a home network or a small office or business.
  • In a class C network, the first two network bits are set to 1 while the third is set to 0, i.e., 1 1 0. The remaining 21 bits of the first three octets define the network ID, and the last octet defines the number of hosts.
  • As such, Class C IP address produces the highest number of networks, amounting to 2,097,150, and the least number of hosts per network, which is 254 hosts.
  • The public IP addresses range from 192.0.0.0 to 223.255.255.0.
  • The private IP range is from 192.168.0.0 to 192.168.255.255.
  • The subnet mask is 255.255.255.0.

Host Portion

The remaining section of the IP address is the host portion, which is the section that determines the number of hosts in a network.

This part uniquely identifies a host in a network. All hosts in the same network share the same network portion.

For example, the following host IP addresses belong to the same network.

  • 192.168.50.15
  • 192.168.50.100
  • 192.168.50.90

IPv6