ip route
Usage
Routes are managed by the RTM (Route Table Manager), and are contained in the RIB (Route
Information Base). This database contains all the active static routes, and all the RIP routes.
The RTM selects up to three of the best routes to each network and installs these routes in the FIB
(Forwarding Information Base).
Example
This example shows how to display all IP route information. In this case, there are routes directly
connected to VLANs 1 and 2, two static routes connected to VLAN 1 (one indirectly, and one via
another network IP), and one RIP route. Distance/cost is displayed as [x/y]:
B3(su)->router#show ip route
Codes: C –
static route
C
C
S
S
R
ip route
Use this command to add or remove a static IP route. The no form of this command removes the
static IP route.
ip route prefix mask dest-addr [distance]
no ip route prefix mask forward-addr
Parameters
prefix
mask
dest‐addr
distance
Defaults
If distance is not specified, the default value of 1 will be applied.
Mode
Global configuration: B3(su)‐>router(Config)#
Example
This example shows how to set IP address 10.1.2.3 as the next hop gateway to destination address
10.0.0.0:
B3(su)->router(Config)#ip route 10.0.0.0 255.0.0.0 10.1.2.3
17-14 IP Configuration
connected, S –
static,
192.168.27.0/24
192.168.32.0/24
2.0.0.0/8
3.0.0.0/8
1.0.0.0/8
Specifies a destination IP address prefix.
Specifies a destination prefix mask.
Specifies a forwarding (gateway) IP address.
(Optional) Specifies an administrative distance metric for this route. Valid
values are 1 (default) to 255. Routes with lower values receive higher
preference in route selection.
R – RIP, * - candidate default, U – per user
[
0/0001] directly connected, vlan 1
[
0/0001] directly connected, vlan 2
[
65/0001] via 192.168.72.1, vlan 1
[
0/0001] directly connected vlan 1
[
70/0002] via 192.168.72.22 vlan 1