Chapter 7 Flashcards

Configuring Network Connections

1
Q

Describe the command-line utilities required to configure and manipulate Ethernet network interfaces. 

A

To set the network address on a network interface you can use the nmtui, nmcli, ip, or ifconfig commands. The nmtui and nmcli commands are available on systems that utilize the Network Manager tool for managing network interfaces. The ip command is from the iproute2 package, and the ifconfig command is from the legacy net-tools package. If you use the ifconfig command you’ll also need to use the route command to set the default router (or gateway) for the network.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain how to configure basic access to a wireless network. 

A

Linux uses the iwlist command to list all wireless access points detected by the wireless network card. You can configure the settings required to connect to a specific wireless network using the iwconfig command. At a minimum, you’ll need to configure the access point SSID value and most likely specify the encryption key value to connect to the access point.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe how to manipulate the routing table on a Linux system. 

A

For legacy systems use the route command to display the existing router table used by the Linux system. You can add a new route by using the add option or remove an existing route by using the del option. You can specify the default router (gateway) used by the network by adding the default keyword to the command. For systems that utilize the iproute2 package, you use the ip route command to display and manipulate the routing table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Summarize the tools you would need to analyze the status of network devices. 

A

The nmtui, nmcli, ifconfig and ip commands display the current status of all network interfaces on the system. You can also use the netstat or ss command to display statistics for all listening network ports.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe how Linux initializes the network interfaces. 

A

Debian-based Linux systems use the /etc/network/interfaces file to configure the IP address, netmask, and default router. Red Hat–based Linux systems use files in the /etc/sysconfig/network-scripts folder. The ifcfg-emp0s3 file contains the IP address and netmask settings, while the network file contains the default router settings. These files are examined at bootup to determine the network interface configuration. Newer versions of Ubuntu use the Netplan tool, which stores the network configuration in the /etc/netplan folder.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain how to test network connectivity. 

A

The ping and ping6 commands allow you to send ICMP messages to remote hosts and display the response received. The traceroute command allows you to view the network path used to reach a specific remote host. The mtr command provides real-time connectivity and response statistics for a specific remote host.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe one graphical tool used to configure network settings in Linux. 

A

The Network Manager tool provides a graphical interface for changing settings on the network interfaces. The Network Manager appears as an icon in the desktop system tray area. If your Linux system uses a wireless network card, the icon appears as a radio signal, while for wired network connections it appears as a mini-network. When you click the icon, it shows the current network status, and for wireless interfaces, it shows a list of the access points detected. When you open the Network Manager interface, it allows you to either set static IP address information or configure the network to use a DHCP server to dynamically set the network configuration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which two commands can be used to set the IP address, subnet mask, and default router information on an interface using the command line?

netstat
ping
nmtui
ip
route
A

C, D. The nmtui command provides an interactive text menu for selecting a network interface and setting the network parameters, and the ip command provides a command-line tool for setting network parameters, so both options C and D are correct. The netstat command displays information about network connections, but it doesn’t set the network parameters, so option A is incorrect. The ping command can send ICMP packets to a remote host but doesn’t set the local network parameters, so option B is incorrect. The route command sets the routing network parameters, but not the IP address or subnet mask, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which tool does newer versions of Ubuntu use to set network address information?

netstat
Netplan
iwconfig
route
ifconfig
A

B. Starting with version 17.04, Ubuntu has switched to using the Netplan tool to set network address information, so option B is the correct answer. The netstat command doesn’t set network information, but instead displays active network connections, so option A is incorrect. The iwconfig command sets wireless network parameters, but not network address information, so option C is incorrect. The route command sets default router information, but not network address information, so option D is incorrect. The ifconfig command does set network address information, but it isn’t used by the newer versions of Ubuntu, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which command displays the duplex settings for an Ethernet card?

ethtool
netstat
iwconfig
iwlist
route
A

A. The ethtool command displays features and parameters for network cards, so option A is the correct answer. The netstat command displays network statistics and connections, so option B is incorrect. The iwconfig and iwlist commands are used to set wireless network parameters and not Ethernet card settings, so options C and D are incorrect. The route command sets or displays routing information and not Ethernet card settings, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which command displays what processes are using which ports on a Linux system?

iwconfig
ip
ping
nmtui
ss
A

E. The ss command displays a list of the open ports on a Linux system, along with the processes associated with each port, so option E is correct. The iwconfig command sets wireless network information, not open ports, so option A is incorrect. The ip command displays or sets network information on a network interface but doesn’t display open ports, so option B is incorrect. The ping command sends ICMP messages to a remote host but doesn’t display any open ports, so option C is incorrect. The nmtui command allows you to configure network parameters for a network interface but doesn’t display the open ports on the system, so option D is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

If your Linux server doesn’t have a graphical desktop installed, what two tools could you use to configure network settings on a wired network card from the command line?

nmcli
iwconfig
ip
netstat
ping
A

A, C. The nmcli and the ip commands both allow you to set and change network settings from the command line, so options A and C are both correct. The iwconfig command only sets wireless network information, so option B is incorrect. The netstat command displays open ports but doesn’t change any network settings, so option D is incorrect. The ping command sends ICMP packets to remote hosts for testing, but it also doesn’t set any network settings, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What network setting defines the network device that routes packets intended for hosts on remote networks?

Default router
Netmask
Hostname
IP address
DNS server
A

A. The default router is used to send packets from the local network to remote networks, so to communicate with a remote host you need to define the default router address, making option A correct. The netmask only defines the local network; it doesn’t define what to do with packets for remote hosts, so option B is incorrect. The hostname and IP address only define features of the local host, so options C and D are incorrect. The DNS server defines how to retrieve the IP address of a host based on its domain name, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What device setting defines a host that maps a host name to an IP address?

Default router
Netmask
Hostname
IP address
DNS server
A

E. The DNS server maps the hostname to an IP address, so you must have a DNS server defined in your network configuration to be able to use hostnames in your applications. Thus, option E is correct. The default router only defines how to send packets to remote hosts; it doesn’t map the host name to the IP address, so option A is incorrect. The netmask value defines the local network, but not how to map hostnames to IP addresses, so option B is incorrect. The hostname and IP address define features of the local host, so options C and D are incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is used to automatically assign an IP address to a client?

Default router
DHCP
ARP table
Netmask
ifconfig
A

B. The Dynamic Host Configuration Protocol (DHCP) is used to assign dynamic IP addresses to client workstations on a network, so option B is correct. The default router can’t assign addresses to devices, so option B is incorrect. The ARP table maps the hardware address of the network card to IP addresses but doesn’t assign the IP addresses, so option C is incorrect. The netmask value determines the network address but not the IP address of the host, so option D is incorrect. The ifconfig command can set the static IP address of the host but doesn’t automatically assign the IP address, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What type of address is used so local applications can use network protocols to communicate with each other?

Dynamic address
Loopback address
Static address
Hostname
MAC address
A

B. The loopback address is a special address assigned to the loopback interface that allows local applications to communicate with each other, making option B the correct answer. Dynamic and static IP addresses are assigned to network interfaces, which interact with remote systems, not local applications, so options A and C are incorrect. The hostname identifies the local host for remote connections, not for local applications, so option D is incorrect. The MAC address identifies the network card hardware address but isn’t used by local applications, so option E is incorrect.

17
Q

Which command would you use to find the mail server for a domain?

dig
netstat
ping6
host
ss
A

A. The dig command can display individual host records for a domain, which you can use to find the MX mail host for the domain, so option A is correct. The host command only displays host IP address information; it can’t determine the server type from the DNS records, so option D is incorrect. The netstat and ss commands display active network connections, but not the remote host types, so options B and E are both incorrect. The ping6 command sends IPv6 ICMP packets to test remote hosts but can’t tell if the remote host is a mail server, so option C is incorrect.

18
Q

What command would you use to find out what application was using a specific TCP port on the system?

ip
ss
host
dig
ifconfig
A

B. The ss command can display both open ports and the applications that own them, so option B is correct. The ip and ifconfig commands just display or set network settings, so options A and E are incorrect. The host and dig commands only display hostname information, so options C and D are also incorrect.

19
Q

What directory do Red Hat–based systems use to store network configuration files?

/etc/sysconfig/network-scripts
/etc/network
/etc/ifcfg-eth0
/etc/ifconfig
/etc/iwconfig
A

A. Red Hat–based systems use separate files to store the IP address and router information. Those files are stored in the /etc/sysconfig/network-scripts folder, making option A correct. Option B is where Debian-based systems store the interfaces file, which contains the network configuration settings. The ifcfg-eth0 is a file used to store the configuration, not a folder, so option C is incorrect. The ifconfig and iwconfig are commands and not folders, so options D and E are incorrect.

20
Q

Which configuration line sets a dynamic IP address for a Debian system?

iface eth0 inet static
iface eth0 inet dhcp
auto eth0
iface eth0 inet6 auto
BOOTPROTO=dynamic
A

B. The Debian system uses the iface setting to set features for an interface, and you must specify the dhcp option to dynamically obtain an IP address, making option B correct. Options C and E are incorrect since they don’t use the iface setting. Option A sets a static IP address for the interface and not a dynamic address, so it’s incorrect. Option D sets a link local IPv6 address and not a dynamic IP address, so it’s incorrect.

21
Q

Which file contains a list of DNS servers the Linux system can use to resolve hostnames?

/etc/dhcpd.conf
/etc/resolv.conf
/etc/nsswitch.conf
/etc/network/interfaces
/etc/sysctl.conf
A

B. The DNS servers are listed in the /etc/resolv.conf configuration file using the nameserver setting, so option B is correct. The /etc/dhcpd.conf file defines configuration settings for a DHCP server, so option A is incorrect. The /etc/nsswitch.conf file defines the order in which the system searches for a hostname, not the list of DNS servers used, so option C is incorrect. The /etc/network/interfaces file defines the network interfaces for a Debian-based system, not the list of DNS servers, so option D is also incorrect. The /etc/sysctl.conf file defines kernel network parameters and not a list of DNS servers, so option E is incorrect.

22
Q

Which ifconfig format correctly assigns an IP address and netmask to the eth0 interface?

ifconfig eth0 up 192.168.1.50 netmask 255.255.255.0
ifconfig eth0 255.255.255.0 192.168.1.50
ifconfig up 192.168.1.50 netmask 255.255.255.0
ifconfig up
ifconfig down
A

A. The ifconfig command must specify the network interface, the IP address, then the netmask option before the netmask address. You can use the up or down option to place the network card in an active or inactive state by default, but it’s not required. Option A is the only option that uses the correct values in the correct order. Option C is close but fails to specify the network interface. Option B is not in the correct format, and options D and E fail to list the necessary configuration settings.

23
Q

What command displays all of the available wireless networks in your area?

iwlist
iwconfig
ifconfig
ip
arp
A

A. The iwlist command displays the available wireless network access points detected by the wireless network card, so option A is correct. The iwconfig command configures the network card to connect to a specific access point but doesn’t list all of the detected access points, making option B incorrect. Option C specifies the ifconfig command, which is used to assign an IP address to a wireless network card but doesn’t list the access points. The ip command specified in option D likewise can be used to set the IP address of the card but doesn’t list the access points. Option E, the arp command, maps hardware addresses to IP addresses so that you can find duplicate IP addresses on your network, but it doesn’t list the wireless access points.

24
Q

What option sets the wireless access point name in the iwconfig command?

key
netmask
address
essid
channel
A

D. The SSID value defines the access point name, and it is set using the essid option in the iwconfig command, making option D the correct answer. The key option specifies the encryption key required to connect to the access point but not the access point name, making option A incorrect. The netmask and address values aren’t set by the iwconfig command, so options B and C are incorrect. The channel option defines the radio frequency the access point uses, not the access point name, so option E is also incorrect.

25
Q

What command can you use to both display and set the IP address, netmask, and default router values?

ifconfig
iwconfig
router
ifup
ip
A

E. The ip command allows you to both display and set the IP address, netmask, and default router values for a network interface, so option E is correct. The ifconfig command can set the IP address and netmask values, but not the default router. The iwconfig command is used to set the wireless access point settings, and the router command is used to set the default router but not the IP address or netmask values. The ifup command only activates the network interface; it can’t set the address values.

26
Q

What tool allows you to send ICMP messages to a remote host to test network connectivity?

netstat
ifconfig
ping
iwconfig
ss
A

C. The ping command sends ICMP packets to a specified remote host and waits for a response, making option C the correct answer. The netstat command displays statistics about the network interface, so it’s incorrect. The ifconfig command displays or sets network information but doesn’t send ICMP packets, making option B incorrect. The iwconfig command displays or sets wireless network information, but it doesn’t handle ICMP packets, making option D incorrect. The ss command displays information about open connections and ports on the system, so option E is also incorrect.

27
Q

You have a network application that fails to connect to a remote server. What command-line tool should you use to watch the network packets that leave your system to ensure that they use the correct network port?

nc
tcpdump
ping
traceroute
mtr
A

B. The tcpdump command displays network packets that traverse the system network interface, so you can use that for monitoring application packets on the network, making option B the correct answer. The nc command allows you to manually send packets on the network, but it doesn’t allow you to monitor application packets, so option A is incorrect. The ping and traceroute commands only send ICMP packets to remote servers; they don’t monitor packets, so options C and D are incorrect. The mtr command can display the connectivity status to a remote server, but it doesn’t allow you to view application packets going to the server, so option E is incorrect.