If IP routing is enabled, which two commands set the gateway of last resort to the default gateway? (Choose two.)
Click on the arrows to vote for the correct answer
A. B. C. D. E.CE
To set the default gateway or the gateway of last resort, we use the IP route command in Cisco IOS. The gateway of last resort is the router that packets are sent to when there is no specific route available in the routing table for the destination network.
The correct commands to set the gateway of last resort are E. ip route 0.0.0.0 0.0.0.0 172.16.2.1 and B. ip route 172.16.2.1 0.0.0.0 0.0.0.0.
Explanation of each command:
A. ip default-gateway 0.0.0.0 - This command sets the default gateway to 0.0.0.0, which is an invalid IP address and will not work.
B. ip route 172.16.2.1 0.0.0.0 0.0.0.0 - This command creates a static route to the network 172.16.2.1 with a next-hop IP address of 0.0.0.0 and a subnet mask of 0.0.0.0. This sets the gateway of last resort to 172.16.2.1.
C. ip default-network 0.0.0.0 - This command is used in classful routing protocols and sets the default network to 0.0.0.0. It does not set the gateway of last resort.
D. ip default-route 0.0.0.0 0.0.0.0 172.16.2.1 - This command is not a valid IOS command.
E. ip route 0.0.0.0 0.0.0.0 172.16.2.1 - This command creates a static route to the network 0.0.0.0 with a next-hop IP address of 172.16.2.1 and a subnet mask of 0.0.0.0. This also sets the gateway of last resort to 172.16.2.1.
Therefore, options B and E are correct commands to set the gateway of last resort to the default gateway.