34. Network Addresses Flashcards
Learning Objectives
By the end of this chapter, you should be able to:
- Differentiate between different types of IPv4 and IPv6 addresses.
- Understand the role of netmasks.
- Get, set, and change the hostname, based on the system you are using.
IP Addresses
What is the purpose of an IP address?
The IP address is the number that identifies your system on the network.
IP Addresses
What the the 2 varieties of IP addesss?
- IPv4
- IPv6
IP Addresses
What are the componenets of a IPv4 address?
IPv4 is a 32-bit address, composed of 4 octets (an octet is just 8 bits, or a byte).
Example: 148.114.252.10
IP Addresses
What are the components of a IPv6 address?
IPv6 is a 128-bit address, composed of 8 16-bit octet pairs.
Example: 2003:0db5:6123:0000:1f4f:0000:5529:fe23
IPv4 Address Types
What are the 4 IPv4 address types? And explain each one of them?
-
Unicast address
- An address associated with a specific host. It might be something like 140.211.169.4 or 64.254.248.193.
-
Network address
- An address whose host portion is set to all binary zeroes. Ex. 192.168.1.0. (the host portion can be the last 1-3 octets as discussed later; here it is just the last octet).
-
Broadcast address
- An address to which each member of a particular network will listen. It will have the host portion set to all 1 bits, such as in 172.16.255.255 or 148.114.255.255 or 192.168.1.255. (the host portion is the last two octets in the first two cases, just the last one in the third case).
-
Multicast address
- An address to which appropriately configured nodes will listen. The address 224.0.0.2 is an example of a multicast address. Only nodes specifically configured to pay attention to a specific multicast address will interpret packets for that multicast group.
Reserved Addresses
What are some of these
Examples of Reserved Addresses reserved for?
- 127.x.x.x
- 0.0.0.0
- 255.255.255.255
- 192.168.0.0 - 192.168.255.255:
- ect..
- 127.x.x.x
- Reserved for the loopback (local system) interface, where 0 <= x <= 254. Generally, 127.0.0.1.
- 0.0.0.0
- Used by systems that do not yet know their own address. Protocols like DHCP and BOOTP use this address when attempting to communicate with a server.
- 255.255.255.255
- Generic broadcast private address, reserved for internal use. These addresses are never assigned or registered to anyone. They are generally not routable.
- 192.168.0.0 - 192.168.255.255
- ect..
- https://en.wikipedia.org/wiki/Reserved_IP_addresses
IPv6 Address Types
What are the 4 IPv6 address types? And explain each one of them?
-
Unicast
- A packet is delivered to one interface.
- Link-local: Auto-configured for every interface to have one. Non-routable.
- Global: Dynamically or manually assigned. Routable.
- Reserved for documentation.
- A packet is delivered to one interface.
-
Multicast
- A packet is delivered to multiple interfaces.
-
Anycast
- A packet is delivered to the nearest of multiple interfaces (in terms of routing distance).
-
IPv4-mapped
- An IPv4 address mapped to IPv6. For example, ::FFFF:a.b.c.d/96
- In addition, IPv6 has some special types of addresses such as loopback, which is assigned to the lo interface, as ::1/128.
IPv4 Address Classes
What is the purpose of IPv4 Address classes?
IPv4 address Classes A, B, and C are used to distinguish a network portion of the address from a host portion of the address. This is used for routing purposes.
IPv4 Address Classes
Explain the different IPv4 address classes.
-
Class A
- Addresses use 8 bits for the network portion of the address and 24 bits for the host portion of the address.
- 128 networks, 16,772,214 hosts per network, 127.x.x.x reserved for loopback
- Addresses use 8 bits for the network portion of the address and 24 bits for the host portion of the address.
-
Class B
- Addresses use 16 and 16 bits respectively
- 16,384 networks, 65,534 hosts per network
- Addresses use 16 and 16 bits respectively
-
Class C
- Addresses use 24 bits for the network portion and 8 bits for the host portion.
- 2,097,152 networks, 254 hosts per network
- Addresses use 24 bits for the network portion and 8 bits for the host portion.
-
Class D
- Addresses are used for multicasting.
-
Class E
- addresses are currently not used.
Netmasks
What is a netmask used for?
netmask is used to determine how much of the address is used for the network portion and how much for the host portion as we have seen. It is also used to determine network and broadcast addresses.
Example:
- *172.16.2.17** ip address
- *&255.255.0.0** netmask
- *172.16.0.0** network address
Getting and Setting the Hostname
What is the proper modern way to set a box’s hostname and make it persistent (rebooting).
sudo hostnamectl set-hostname server-0
which is part of the systemd infrastructure.
Getting and Setting the Hostname
What is the 2 proper way to view a systems hostname. One is older one is newer and more modern.
- hostname
- hostnamectl
Getting and Setting the Hostname
What is a hostname? and what is it’s purpose in terms of DNS?
- The hostname is simply a label to distinguish a networked device from other nodes.
- For DNS purposes, hostnames are appended with a period (dot) and a domain name, so that a machine with a hostname of antje could have a fully qualified domain name (FQDN) of antje.linuxfoundation.org.
- The hostname is generally specified at installation time, and can be modified at any time later.
Getting and Setting the Hostname
Where is the hostname config file located? but in general you shouldn’t touch and instead use the proper utlity to interact with the config file instead?
- Debian system
- /etc/hostname
- RH system
- /etc/sysconfig/network
- SUSE system
- /etc/HOSTNAME