CompTIA Linux+ (XK0-005) — Question 156
In order to copy data from another VLAN, a systems administrator wants to temporarily assign IP address 10.0.6.5/24 to the newly added network interface enpls0f1. Which of the following commands should the administrator run to achieve the goal?
Answer options
- A. ip addr add 10.0.6.5/24 dev enpls0f1
- B. echo "IPV4_ADDRESS=10.0.6.5/24" > /etc/sysconfig/network-scripts/ifcfg-enpls0f1
- C. ifconfig 10.0.6.5/24 enpsls0f1
- D. nmcli conn add ipv4.address=10.0.6.5/24 if name snpls0f1
Correct answer: A
Explanation
The correct command is A, as it directly adds the IP address to the specified network interface. Option B is incorrect because it writes the configuration to a file instead of applying it immediately. Option C has a typo in the interface name, making it invalid, and Option D is incorrect because it uses an incorrect command syntax for adding an IP address.