Specifications

ip route
15-20 IP Configuration
Usage
RoutesaremanagedbytheRTM(RouteTableManager),andarecontainedintheRIB(Route
InformationBase).Thisdatabasecontainsalltheactivestaticroutes,alltheRIProutes,andupto
threebestroutestoeachnetworkasdeterminedbyOSPF.
TheRTMselectsuptothreeofthe
bestroutestoeachnetworkandinstallstheseroutesintheFIB
(ForwardingInformationBase).
Example
ThisexampleshowshowtodisplayallIProuteinformation.Inthiscase,thereareroutesdirectly
connectedtoVLANs1and2,twostaticroutesconnectedtoVLAN1(oneindirectly,andonevia
anothernetworkIP),andoneRIProute.Distance/costisdisplayedas[x/y]:
C3(su)->router#show ip route
Codes: C – connected, S – static, R – RIP, O – OSPF, IA – OSPF inter area, N1
– OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E1 – OSPF external
type 1, E2 – OSPF external type 2, * - candidate default, U – per user static route
C 192.168.27.0/24 [ 0/0001] directly connected, vlan 1
C 192.168.32.0/24 [ 0/0001] directly connected, vlan 2
S 2.0.0.0/8 [ 65/0001] via 192.168.72.1, vlan 1
S 3.0.0.0/8 [ 0/0001] directly connected vlan 1
R 1.0.0.0/8 [ 70/0002] via 192.168.72.22 vlan 1
ip route
UsethiscommandtoaddorremoveastaticIProute.Thenoformofthiscommandremovesthe
staticIProute.
ip route prefix mask dest-addr [distance]
no ip route prefix mask forward-addr
Parameters
Defaults
Ifdistanceisnotspecified,thedefaultvalueof1 willbeapplied.
Mode
Globalconfiguration:C3(su)>router(Config)#
Example
ThisexampleshowshowtosetIPaddress10.1.2.3asthenexthopgatewaytodestinationaddress
10.0.0.0:
C3(su)->router(Config)#ip route 10.0.0.0 255.0.0.0 10.1.2.3
prefix SpecifiesadestinationIPaddressprefix.
mask Specifiesadestinationprefixmask.
destaddr Specifiesaforwarding(gateway)IPaddress.
distance (Optional)Specifiesanadministrativedistancemetricforthisroute.Valid
valuesare1(default)to255.Routeswithlowervaluesreceivehigher
preferenceinrouteselection.