LPI E - netman test 1
LPI E - Linux Network Manager
Practice Test Text:
nmtui is a simple text-based menu tool that offers a user-friendly interface for configuring network options.
nmcli, on the other hand, is a text-only command-line tool that provides a command-line interface to view and change network settings.
Unlike nmtui, nmcli does not utilize any graphical capabilities. It is designed to be used in a terminal or shell environment. By default, when running the nmcli command, it displays the current network devices and their settings.
For example, the default output of the nmcli command may look like this:
$ nmcli
eth0: connected to eth0
"Realtek RTL8111/8168/8411 Gigabit Ethernet Controller"
ethernet (r8169), 08:00:27:3D:5B:A6, hw, mtu 1500
ip4 default
inet4 192.168.1.100/24
route4 0.0.0.0/0
route4 192.168.1.0/24
inet6 fe80::a00:27ff:fe3d:5ba6/64
route6 ff00::/8
route6 fe80::/64
route6 fe80::/64
To configure network settings using nmcli, you can use command-line options. For instance, the command:
In this example, the IP address is set to 10.0.0.5, the subnet mask is set to /24, and the default router is set to 10.0.0.1.
Understanding these Network Manager command-line tools is essential for managing network configurations in Linux. The nmtui tool provides an interactive menu-driven approach, while the nmcli tool offers a powerful command-line interface for advanced configuration and automation. Familiarity with both tools will enable Linux administrators to effectively manage and troubleshoot network settings in various scenarios.
Practice Test Scenario Question:
Bob wants to manually define a DNS server on his Linux system. Which file should he modify?
b) /etc/nsswitch.conf
c) /etc/resolv.conf
d) /etc/network/interfaces
--------------------------
Answer 1 Below:
--------------------------
/* --------------------- */
Explanation:Explanation of incorrect options:
b) Incorrect. The /etc/nsswitch.conf file defines the order in which the Linux system checks different sources for name resolution, but it does not directly define DNS servers.
d) Incorrect. The /etc/network/interfaces file is used to configure network interfaces but does not directly specify DNS servers.
Correct answer 1: c) /etc/resolv.conf
Maria wants to specify multiple DNS servers for her network on her Linux system. How can she achieve this?
b) Edit the /etc/nsswitch.conf file.
c) Add multiple entries in the /etc/network/interfaces file.
d) Add multiple nameserver entries in the /etc/resolv.conf file.
--------------------------
Answer 2 Below:
--------------------------
/* --------------------- */
To specify multiple DNS servers for a network on a Linux system, Maria can add multiple nameserver entries in the /etc/resolv.conf file. Each nameserver entry represents a separate DNS server.
Explanation of incorrect options:
b) Incorrect. The /etc/nsswitch.conf file defines the order of name resolution sources but does not specify DNS servers.
c) Incorrect. The /etc/network/interfaces file is used for configuring network interfaces, not for specifying DNS servers.
Correct answer 2: d) Add multiple nameserver entries in the /etc/resolv.conf file.
John wants to speed up connections to commonly used hosts on his Linux system. Where should he manually enter their host names and IP addresses?
b) /etc/resolv.conf
c) /etc/nsswitch.conf
d) /etc/network/interfaces
--------------------------
Answer 3 Below:
--------------------------
/* --------------------- */
To manually enter host names and IP addresses for speeding up connections to commonly used hosts, John should edit the /etc/hosts file on his Linux system.
b) Incorrect. The /etc/resolv.conf file is used for specifying DNS servers and related configurations, not for manually entering host names and IP addresses.
c) Incorrect. The /etc/nsswitch.conf file defines the order of name resolution sources, but it does not involve manually entering host names and IP addresses.
d) Incorrect. The /etc/network/interfaces file is used for configuring network interfaces and does not serve the purpose of manually entering host names and IP addresses.
Correct answer 3: a) /etc/hosts
Sarah wants to determine whether her Linux system checks the /etc/hosts file before or after using DNS to look up host names. Which file should she examine?
b) /etc/resolv.conf
c) /etc/nsswitch.conf
d) /etc/network/interfaces
--------------------------
Answer 4 Below:
--------------------------
/* --------------------- */
The /etc/nsswitch.conf file defines the order in which the Linux system checks different sources for name resolution. Sarah should examine this file to determine whether the system checks the /etc/hosts file before or after using DNS to look up host names.
a) Incorrect. The /etc/hosts file is used for manually entering host names and IP addresses, but it does not determine the order of name resolution sources.
b) Incorrect. The /etc/resolv.conf file specifies DNS servers and configurations but does not determine the order of name resolution sources.
d) Incorrect. The /etc/network/interfaces file is used for configuring network interfaces and does not determine the order of name resolution sources.
Correct answer 4: c) /etc/nsswitch.conf
Lisa wants to ensure that her changes to the /etc/resolv.conf file persist across system reboots. What should she be aware of?
b) The file may reset upon system reboot depending on the Linux distribution's configuration.
c) The changes made to the file will be discarded upon system reboot.
d) The file cannot be modified directly; changes must be made through a graphical tool.
--------------------------
Answer 5 Below:
--------------------------
/* --------------------- */
Lisa should be aware that the changes made to the /etc/resolv.conf file may reset upon system reboot depending on the Linux distribution's configuration. Some distributions regenerate the file during boot or use other mechanisms to manage its content.
a) Incorrect. The file does not automatically save changes upon modification; it can be affected by system reboot or other factors.
c) Incorrect. While changes are not automatically discarded upon system reboot, they may be reset depending on the Linux distribution's configuration.
d) Incorrect. The file can be modified directly using a text editor; it is not limited to changes through graphical tools.
Correct answer 5: b) The file may reset upon system reboot depending on the Linux distribution's configuration.
Tom wants to use a command-line tool to view and change network settings on his Linux system. Which command-line tool should he use?
b) nmcli
c) ifconfig
d) ipconfig
--------------------------
Answer 6 Below:
--------------------------
/* --------------------- */
To view and change network settings using a command-line tool, Tom should use the nmcli command-line tool. It provides a text-only interface for managing network settings.
a) Incorrect. The nmtui command-line tool provides a simple text-based menu tool, but it is not used for viewing and changing network settings directly on the command line.
c) Incorrect. ifconfig is a command used in some Linux distributions to display and configure network interfaces, but it is not part of the Network Manager tools.
d) Incorrect. ipconfig is a command used in Windows systems to display and configure network settings, not in Linux.
Correct answer 6: b) nmcli
b) nmcli
c) ifconfig
d) ipconfig
--------------------------
Answer 7 Below:
--------------------------
/* --------------------- */
Explanation: Jane should use the nmtui command-line tool to access a text-based menu for managing network settings on her Linux system. This tool provides a user-friendly interface for configuring network options.Explanation of incorrect options:
b) Incorrect. nmcli is a text-only command-line tool and does not offer a text-based menu for managing network settings.
c) Incorrect. ifconfig is not a tool that provides a text-based menu for managing network settings.
d) Incorrect. ipconfig is a command used in Windows systems, not in Linux.
Correct answer 7: a) nmtui
b) nmcli list
c) nmcli view
d) nmcli display
--------------------------
Answer 8 Below:
--------------------------
/* --------------------- */
Mark should use the command "nmcli show" to display the current network devices and their settings using the nmcli command-line tool.
b) Incorrect. There is no "nmcli list" command. The correct command to display network device settings is "nmcli show."
c) Incorrect. There is no "nmcli view" command. The correct command to view network device settings is "nmcli show."
d) Incorrect. There is no "nmcli display" command. The correct command to display network device settings is "nmcli show."
Correct answer 8: a) nmcli show
b) nmcli con modify eth1 ip4 192.168.1.15/24 gw4 192.168.1.254
c) nmcli set eth1 ip4 192.168.1.15/24 gw4 192.168.1.254
d) nmcli config add eth1 ip4 192.168.1.15/24 gw4 192.168.1.254
--------------------------
Answer 9 Below:
--------------------------
/* --------------------- */
Lisa should use the command "nmcli con add type ethernet con-name eth1 ifname enp0s3 ip4 192.168.1.15/24 gw4 192.168.1.254" to set the IP address to 192.168.1.15, the subnet mask to /24, and the default router to 192.168.1.254 using the nmcli command-line tool.
b) Incorrect. The "nmcli con modify" command is used to modify an existing connection, not to add a new connection with specified settings.
c) Incorrect. The "nmcli set" command is not used for adding or modifying network connections with specific IP address, subnet mask, and default router settings.
d) Incorrect. There is no "nmcli config add" command. The correct command to add a new connection with specified settings is "nmcli con add."
Comments