Chapter 7 Flashcards
Configuring Network Connections
Describe the command-line utilities required to configure and manipulate Ethernet network interfaces.
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.
Explain how to configure basic access to a wireless network.
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.
Describe how to manipulate the routing table on a Linux system.
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.
Summarize the tools you would need to analyze the status of network devices.
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.
Describe how Linux initializes the network interfaces.
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.
Explain how to test network connectivity.
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.
Describe one graphical tool used to configure network settings in Linux.
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.
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
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.
Which tool does newer versions of Ubuntu use to set network address information?
netstat Netplan iwconfig route ifconfig
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.
Which command displays the duplex settings for an Ethernet card?
ethtool netstat iwconfig iwlist route
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.
Which command displays what processes are using which ports on a Linux system?
iwconfig ip ping nmtui ss
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.
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, 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.
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. 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.
What device setting defines a host that maps a host name to an IP address?
Default router Netmask Hostname IP address DNS server
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.
What is used to automatically assign an IP address to a client?
Default router DHCP ARP table Netmask ifconfig
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.