ip route
16-14 IP Configuration
Parameters
Defaults
Ifnoparametersarespecified,allIProuteinformationwillbedisplayed.
Mode
Anyroutermode.
Usage
RoutesaremanagedbytheRTM(RouteTableManager),andarecontainedintheRIB(Route
InformationBase).Thisdatabasecontainsalltheactivestaticroutes,alltheRIProutes,,andupto
threebestroutestoeachnetworkasdeterminedbyOSPF.
TheRTMselectsuptothreeofthe
bestroutestoeachnetworkandinstallstheseroutesintheFIB
(ForwardingInformat ion Base).
Example
ThisexampleshowshowtodisplayallIProuteinformation.Inthiscase,thereareroutesdirectly
connectedtoVLANs1and2,twostaticroutesconnectedtoVLAN1(oneindirectly,andonevia
anothernetworkIP),andoneRIProute.Distance/costisdisplayedas[x/y]:
C2(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
destination‐prefix
destination‐prefix‐
masklonger‐
prefixes
(Optional)Convertsthespecifiedaddressandmaskintoaprefixand
displaysanyroutesthatmatchtheprefix.
connected (Optional)Displaysconnectedroutes.
ospf (Optional)DisplaysroutesconfiguredfortheOSPFroutingprotocol.For
detailsonconfiguringOSPF,referto“ConfiguringOSPF”onpage 17 ‐10.
rip (Optional)DisplaysroutesconfiguredfortheRIProutingprotocol.For
detailsonconfiguringRIP,referto“ConfiguringRIP”onpage 17‐1.
static (Optional)Displaysstaticroutes.
summary (Optional)DisplaysasummaryoftheIProutingtable.