.Which of the following is the correct command to define a default route using a gateway address of 172.16.0.254?
A. ip default-route 172.16.0.254 255.255.0.0
B. ip route 0.0.0.0 0.0.0.0 172.16.0.254
C. default-gateway 172.16.0.254
D. ip route default 172.16.0.254
Correct Answer: B
The ip route command is used to manually define a static route to a destination network. The syntax of the command is as follows:
ip route [destination_network] [mask] [next-hop_address or exit interface] [administrative_distance] [permanent]
The attributes of the command are as follows:
destination_network: Defines the network that needs to be added in the routing table.
mask: Defines the subnet mask used on the network.
next-hop_address: Defines the default gateway or next-hop router that receives and forwards the packets to the remote network.
administrative_distance (AD): States the administrative distance. Static routes have an AD of 1, which can be changed to change the priority of the route.
Creating a default route is accomplished by substituting 0.0.0.0 for both the [destination_network] and [mask] fields, yielding the following command to create a default route through
router(config)# ip route 0.0.0.0 0.0.0.0 172.16.0.254
Any route configured manually is considered a static route. Another example of a command that creates a non-default route is shown below:
router(config)# ip route 192.168.12.0 255.255.255.0 184.108.40.206
This command would instruct the router on which the command was executed to send any traffic for the 192.168.12.0/24 network to the router located at 220.127.116.11.
You can also affect the route by changing the administrative distance of the route. By default, all static routes have an AD of 1, making them preferable to routes learned from routing
protocols. However, you can add the AD parameter at the end of the command as shown below, making the static route less desirable than one learned from a routing protocol such
router(config)# ip route 192.168.12.0 255.255.255.0 18.104.22.168 150
One reason to configure the routes this way could be to make the static route a backup route to the route learned by RIP, such as when the static route is a less desirable route
through a distant office.
Once the ip route command has been used to add either a static route or a static default route to a router, the routes should appear in the routing table. They will be indicated with an
S next to a static route and an S* for a default static route. The first two examples from the explanation above would appear in the routing table as follows:
S*0.0.0.0/0 [1/0] via 172.16.0.254
S 192.168.12.0/24 [1/0] via 22.214.171.124
The ip default-route, default-gateway, and ip route default commands are incorrect because they are not valid Cisco IOS commands.
Configure, verify, and troubleshoot IPv4 and IPv6 static routing
Cisco > Cisco ASDM User Guide, 6.1 > Configuring Dynamic And Static Routing > Field Information for Static Routes
Cisco > Support > IP > IP Routing > Design > Design TechNotes > Specifying a Next Hop IP Address for Static Routes > Document ID: 27082