The legacy command `ifconfig eth0 192.168.1.10 netmask 255.255.255.0` assigns an address to an interface. Which iproute2 command does the same job?

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 ip link set eth0 192.168.1.10/24

Wrong. `ip link` manages layer-2 properties of the device: up/down state, MTU, MAC address, name. It cannot assign an IP address.

Not correct ip route add 192.168.1.10/24 dev eth0

Wrong. `ip route add` inserts a routing table entry telling the kernel how to reach a destination network. It does not give the interface an address.

Not correct ip addr show eth0 192.168.1.10/24

Wrong. `ip addr show` is read-only; it displays addresses. The subcommand that modifies is `add` (or `del`).

Correct ip addr add 192.168.1.10/24 dev eth0

Correct. `ip addr add ADDRESS/PREFIX dev IFACE` attaches the address to the interface. Note that iproute2 expects CIDR prefix notation rather than a separate netmask keyword.

Why

iproute2 splits what ifconfig did into objects: `ip addr` for addresses, `ip link` for the device itself, `ip route` for routing, `ip neigh` for the ARP/neighbour cache. Unlike ifconfig, `ip addr add` adds an address rather than replacing the existing one, so an interface can hold several; remove one with `ip addr del`. Addresses set this way are not persistent across reboots.

Where this comes from

Cited
manual page ip-address(8)

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.

Practise LPIC-1 Exam 102-500

More questions on this objective

All questions on Networking fundamentals

Practise LPIC-1 Exam 102-500