On a Debian system using the traditional ifupdown scheme, which stanza in /etc/network/interfaces brings up eth0 at boot with an address obtained from a DHCP server?
LPIC-1 Exam 102-500, objective 109. Networking fundamentals medium
Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.
Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
The options
Not correct auto eth0 iface eth0 inet static
Wrong. The `static` method requires you to supply address, netmask and gateway lines yourself; it never contacts a DHCP server.
Not correct auto eth0 iface eth0 inet loopback
Wrong. The `loopback` method exists for the lo interface only and configures 127.0.0.1.
Not correct allow-hotplug eth0 iface eth0 dhcp
Wrong as written. interfaces(5) defines the stanza as `iface <name> <address_family> <method>`, so the family keyword is required: it has to read `iface eth0 inet dhcp`. (allow-hotplug itself is a valid keyword and means bring the interface up when the kernel reports the device appearing.)
Correct auto eth0 iface eth0 inet dhcp
Correct. `auto eth0` marks the interface to be started by `ifup -a` at boot, and `iface eth0 inet dhcp` selects the IPv4 family with the DHCP method, so a client obtains the address, mask, gateway and DNS servers from the server.
Why
The stanza syntax is `iface IFACE FAMILY METHOD`, where the family is inet (IPv4) or inet6 (IPv6) and common methods are static, dhcp, loopback and manual. `auto` starts the interface during boot; `allow-hotplug` starts it when the device appears. Static stanzas add indented `address`, `netmask` (or CIDR in the address) and `gateway` options. Apply changes with ifup and ifdown. Red Hat family systems instead use /etc/sysconfig/network-scripts/ifcfg-* or NetworkManager keyfiles, so this file is Debian-specific.
Where this comes from
- Cited
- LPI exam objective 109.2
- What it says
- Configure a network interface persistently on Debian-style systems.
Practise this
Reading one question is not practice. The trainer will draw a short set from objective 109 and space the ones you get wrong.
More questions on this objective
- A subnet is defined as 192.168.10.0/26. How many addresses in it can actually be assigned to hosts? machine-checked
- A host is configured with the address 172.20.35.77/20. What is the network address of its subnet? machine-checked
- In IPv6, which address is the loopback address, equivalent in role to 127.0.0.1 in IPv4? machine-checked
- Which is the correct fully compressed form of the IPv6 address 2001:0db8:0000:0000:0000:ff00:0042:8329? machine-checked
- Which pairing of a service with its default port number is correct? machine-checked
- DNS normally uses UDP port 53. In which situation does a DNS client or server fall back to TCP on port 53? machine-checked