CNSP practice question 10 of 15

Which is the correct command to change the MAC address for an Ethernet adapter in a Unix-based system?

Full set: 60 questions

Domain Network Security Fundamentals

Answer options
A: ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF Correct answer
B: ifconfig eth0 hdw ether AA:BB:CC:DD:EE:FF
C: ifconfig eth0 hdwr ether AA:BB:CC:DD:EE:FF
D: ifconfig eth0 hwr ether AA:BB:CC:DD:EE:FF
Correct Answer:
A. ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF
Explanation

The ifconfig utility’s “hw” sub-command changes a hardware (MAC) address. The correct syntax is:
ifconfig hw ether
Thus, “ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF” is the only option that uses the valid sub-command (hw) and the correct keyword (ether) for an Ethernet interface on Unix/Linux systems.

Why Incorrect

B. Uses “hdw” – no such sub-command exists in ifconfig; command fails with “error: unknown command”.
C. Uses “hdwr” – invalid sub-command; ifconfig will reject it.
D. Uses “hwr” – not recognized by ifconfig; command is syntactically incorrect.

References

1. ifconfig(8) – net-tools 1.60

Section “hw class address”: “ifconfig eth0 hw ether 08:00:27:12:34:56”. (man7.org/linux/man-pages/man8/ifconfig.8.html)

2. MIT OpenCourseWare 6.858

Lab 2 handout

p.3: “sudo ifconfig eth0 hw ether 00:11:22:33:44:55” demonstrates MAC change. (https://ocw.mit.edu/courses/6-858-computer-systems-security-fall-2014/resources/lab2/)

3. University of Wisconsin–Madison CS640 Lab “Network configuration”

Section 2.2: shows same syntax for MAC spoofing. (https://pages.cs.wisc.edu/~cs640-1/handouts/lab-networking.pdf)

Scroll to Top