nerdexam
LPI

117-201 · Question #302

A network client has an ethernet interface (eth0) configured with an IP address in the subnet 192.168.0.0/24. This subnet has a router, with the IP address 192.168.0.1, that connects this subnet to…

The correct answer is A. route add default gw 192.168.0.1 eth0 C. ip route add default via 192.168.0.1 dev eth0. See the full explanation below for the reasoning.

Question

A network client has an ethernet interface (eth0) configured with an IP address in the subnet 192.168.0.0/24. This subnet has a router, with the IP address 192.168.0.1, that connects this subnet to the Internet. What needs to be done on the client to enable it to use the router as its default gateway? (Choose TWO correct answers.)

Options

  • Aroute add default gw 192.168.0.1 eth0
  • Bifconfig eth0 defaultroute 192.168.0.1
  • Cip route add default via 192.168.0.1 dev eth0
  • Decho defaultroute 192.168.0.1 >> /etc/resolv.conf
  • Eroute add defaultgw=192.168.0.1 if=eth0

How the community answered

(66 responses)
  • A
    76% (50)
  • B
    5% (3)
  • D
    8% (5)
  • E
    12% (8)

Community Discussion

7
Lena V.Lena V.Nov 25, 2025

A and C are your two correct answers here. Option A uses the legacy "route" command with proper syntax, "route add default gw 192.168.0.1 eth0", which tells the kernel to send all non-local traffic to 192.168.0.1 out through eth0. Option C does the exact same thing using the modern "ip route" utility, "ip route add default via 192.168.0.1 dev eth0", which is the iproute2 syntax you will see on any current Linux system and is what the exam increasingly favors. B is fabricated syntax, ifconfig does not take a "defaultroute" argument, D writes to /etc/resolv.conf which is strictly for DNS nameservers and has nothing to do with routing, and E mashes together incorrect flags that the route command does not recognize.

14
Fatima Z.Fatima Z.Nov 27, 2025

Just glue this in your brain: A is for Ancient route and C is for Current ip route, and since the exam loves C more every year, when in doubt drill the "ip route add default via" syntax until you can type it in your sleep.

0
Thiago A.Thiago A.Nov 8, 2025

Both A and C are correct here, route add default gw 192.168.0.1 eth0 using the legacy net-tools command and ip route add default via 192.168.0.1 dev eth0 using the newer iproute2 suite, which you can verify with ip route show or route -n after running either. Quick check for you: do you know which config file you would edit to make the default gateway persist across reboots on a Debian-based system versus a RHEL-based one, and why does option D mention resolv.conf even though that file has nothing to do with routing?

4
Lena V.Lena V.Nov 11, 2025

Solid breakdown, and on the persistence side the answer splits cleanly: Debian/Ubuntu you edit /etc/network/interfaces or a Netplan YAML under /etc/netplan/, while RHEL/CentOS you set GATEWAY= in /etc/sysconfig/network-scripts/ifcfg-eth0, and resolv.conf showing up in option D is a classic distractor since it only handles DNS name resolution, not the routing table at all.

0
Yusuf A.Yusuf A.Nov 19, 2025

I honestly picked B first because ifconfig is the command I see seniors use all the time, so I figured it had a defaultroute option too, but when I actually looked it up ifconfig only handles interface config like IP and netmask, not routing. Turns out you need either the older route add default gw syntax from option A or the newer ip route add default via syntax from option C to actually set the default gateway in the kernel routing table.

4
Fatima Z.Fatima Z.Dec 1, 2025

I saw this exact question on my 117-201 and the second I spotted "gw" and "via" I just whispered "Gateway Wins, Via is Valid" and locked in A and C without blinking, because I had drilled that little rhyme so hard it basically answered itself.

3
Thiago A.Thiago A.Dec 2, 2025

That rhyme is solid for elimination, but make sure you have also read the actual route table with "ip route show" so the syntax is not just a jingle in your head but a line you have seen a hundred times.

0
Full 117-201 Practice