CompTIA Server+ (SK0-005)Server AdministrationHard
A server administrator is configuring network settings on a new Linux server. The server needs to act as a gateway for a private subnet, connect to the internet, and have its network configuration persist after reboots. Which file is typically modified to set a static IP address, subnet mask, gateway, and DNS servers on a Debian-based Linux distribution?
- A/etc/sysconfig/network-scripts/ifcfg-eth0
- B/etc/hosts
- C/etc/network/interfaces
- D/etc/resolv.conf
Show answer & explanationAnswer & explanation
Correct answer: C. /etc/network/interfaces
On Debian-based Linux distributions (like Ubuntu), the '/etc/network/interfaces' file is the primary configuration file for persistent network settings, including static IP addresses, subnet masks, gateways, and DNS servers. This file is parsed by the 'ifup' and 'ifdown' utilities at boot.
Why the other options are wrong
- A. This file path is characteristic of RHEL-based distributions (e.g., CentOS, Fedora) for network configuration, not Debian-based ones.
- B. /etc/hosts maps hostnames to IP addresses locally and is not used for configuring the server's own network interface parameters.
- D. /etc/resolv.conf is specifically for DNS resolver configuration, but it often gets overwritten by network managers unless explicitly managed or configured via the interfaces file.
Debian Network Configuration
On Debian-based Linux systems, persistent network interface settings (IP address, subnet, gateway, DNS) are primarily configured in the '/etc/network/interfaces' file.
- File: /etc/network/interfaces.
- Manages static and dynamic IP settings.
- Processed at boot by ifup/ifdown.
Memory trick: Interfaces for IP Identity