โ† All Linux Flashcard Decks

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
  1. A system administrator needs to add a secondary IP address, 10.0.1.150/24, to an existing network interface named `ens192` which is managed by NetworkManager. The change must be applied without deactivating the interface. Which of the following commands correctly accomplishes this?

    Answer: nmcli con modify ens192 +ipv4.addresses 10.0.1.150/24

    The `nmcli con modify` command is used to alter an existing NetworkManager connection profile. The key is using the `+` prefix before `ipv4.addresses` to append a new address to the list of existing addresses. Without the `+`, the command would replace all existing IP addresses with the new one.

  2. An administrator is configuring a new Ubuntu server that uses Netplan for network configuration. To assign a static IP address, which file would they MOST likely create or edit?

    Answer: /etc/netplan/01-netcfg.yaml

    Modern Ubuntu systems use Netplan for network configuration, with YAML files located in `/etc/netplan/`. A file like `/etc/netplan/01-netcfg.yaml` is the standard location for defining network interfaces, including static IP addresses.

  3. A network interface `enp0s8` on a Linux server is currently in a 'DOWN' state. Which of the following commands is the modern and direct way to bring the interface to an 'UP' state?

    Answer: ip link set enp0s8 up

    The `ip link set up` command is the standard and modern utility from the iproute2 suite used to change the state of a network device, specifically to bring it online. While other commands might work in certain contexts, this is the most direct and fundamental command for the task.

  4. A server is unable to resolve any external domain names (e.g., www.google.com), but it can ping IP addresses on the internet (e.g., 8.8.8.8). Which file should the administrator check FIRST to troubleshoot this name resolution issue?

    Answer: /etc/resolv.conf

    The `/etc/resolv.conf` file contains the IP addresses of the DNS nameservers the system uses to resolve domain names. If this file is empty, misconfigured, or points to non-functional nameservers, the system will be unable to resolve domain names, matching the symptoms described.

  5. A Linux server needs a persistent static route added. All traffic destined for the `172.16.50.0/24` network must be sent through the gateway at `10.1.1.254`. On a RHEL/CentOS system using traditional network scripts, what is the proper way to add this route permanently?

    Answer: Create a file `/etc/sysconfig/network-scripts/route-eth0` with the content `172.16.50.0/24 via 10.1.1.254`

    On RHEL-family systems using traditional network scripts, persistent static routes are defined in a `route-` file located in `/etc/sysconfig/network-scripts/`. The format `ADDRESS/PREFIX via GATEWAY` within this file ensures the route is applied when the interface is brought up.

  6. A system administrator is examining a legacy Linux system and needs to quickly display the IP address, MAC address, and traffic statistics for all network interfaces, including those that are down. Which command, though now deprecated, is traditionally used for this purpose?

    Answer: ifconfig -a

    The `ifconfig` command was the standard tool for network interface configuration on older Linux systems. Using the `-a` flag ensures that it displays information for all interfaces, including those that are currently inactive or 'down'. While `ip addr show` is the modern replacement, `ifconfig` is the correct answer for a legacy context.