Linux+ Network Interface Configuration Flashcards
6 cards from real Linux practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Linux+ Network Interface Configuration flashcards as text
A system administrator needs to assign a temporary IP address 192.168.10.50/24 to the `eth1` interface, which is currently down. Which sequence of commands will accomplish this and make the interface active?
Answer: sudo ip addr add 192.168.10.50/24 dev eth1; sudo ip link set eth1 up
The `ip addr add` command is used to add an IP address to an interface, and `ip link set [device] up` is used to enable or activate the interface. This combination correctly assigns the temporary IP and brings the interface online. The changes made with the `ip` command are not persistent and will be lost after a reboot.
On a modern Ubuntu server, a junior administrator needs to configure a static IP address that persists after a reboot. In which directory should they create or edit a YAML configuration file to accomplish this using the default network management tool?
Answer: /etc/netplan/
Modern Ubuntu systems, starting from version 17.10, use Netplan as the default network configuration tool. Netplan uses YAML files located in the `/etc/netplan/` directory to configure network interfaces. These configurations are then applied to a backend renderer like systemd-networkd or NetworkManager.
A network administrator is working on a server managed by NetworkManager and wants to view all available network device statuses and their connections using the command-line. Which of the following commands provides the most comprehensive overview for this purpose?
Answer: nmcli device status
The `nmcli device status` command is the specific tool for interacting with NetworkManager to display a list of network devices and their current state, type, and associated connection profile. While `ip addr show` and `ifconfig -a` list interfaces, they don't show the connection status from NetworkManager's perspective.
An administrator observes that the output of `ip a` shows an interface named `enp3s0` in the `DOWN` state. Which command should be used to activate this interface?
Answer: ip link set enp3s0 up
The `ip link set [device] up` command is the standard way to change the state of a network interface to 'up' or active using the iproute2 utility. This brings the physical layer of the interface online, allowing it to send and receive traffic. The other commands either belong to different toolsets or serve different purposes.
When examining the output of the `ip addr show` command, what does the `scope global` attribute signify for an IPv4 address?
Answer: The address is routable and valid for communication beyond the local network.
In the output of the `ip addr` command, `scope global` indicates that the address is globally valid. This means it is routable across networks and can be used for communication with hosts outside of the local subnet. In contrast, `scope link` is for addresses only valid on the local link, and `scope host` is for internal communication (like 127.0.0.1).
A system administrator has just made changes to a NetworkManager connection profile file located in `/etc/NetworkManager/system-connections/`. The changes are not taking effect immediately. Which `nmcli` command should be run to apply the new configuration without restarting the entire networking service?
Answer: nmcli connection reload
`nmcli connection reload` forces NetworkManager to re-read all connection profiles from disk. After reloading, you typically need to bring the specific connection down and then up again (`nmcli con down ` followed by `nmcli con up `) for the changes to a specific active connection to apply. `nmcli general reload` is for reloading the NetworkManager daemon configuration, not connection profiles.