[Description]
Adds a static route for IPv4.
If this command is executed with the "no" syntax, the specified route is deleted.
[Example]
Set the default gateway to 192.168.1.1.
SWR2311P(config)#ip route 0.0.0.0/0 192.168.1.1
For the destination 172.16.0.0/16, set the gateway to 192.168.2.1.
SWR2311P(config)#ip route 172.16.0.0 255.255.0.0 192.168.2.1
7.2.2 Show IPv4 Forwarding Information Base
[Syntax]
show
ip
route
[
ip_address
[/
mask
]]
[Parameter]
ip_address
:
A.B.C.D
IPv4 address
mask
:
<0-32>
Number of mask bits (if omitted: 32)
[Input mode]
unprivileged EXEC mode, priviledged EXEC mode
[Description]
Shows the IPv4 Forwarding Information Base (FIB).
If the IPv4 address is omitted, the entire content of the FIB is shown.
If the IPv4 address or network address is specified, detailed information for the routing entry that matches the destination is
shown.
[Example]
Show the entire IPv4 forwarding information base.
SWR2311P>show ip route
Codes: C - connected, S - static
* - candidate default
Gateway of last resort is 192.168.100.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 192.168.100.1, vlan1
S 172.16.0.0/16 [1/0] via 192.168.200.240, vlan100
S 192.168.1.1/32 [1/0] is directly connected, vlan100
C 192.168.100.0/24 is directly connected, vlan1
C 192.168.200.0/24 is directly connected, vlan100
Show the route used for sending packets that are addressed to 192.168.100.10.
SWR2311P>show ip route 192.168.100.10
Routing entry for 192.168.100.0/24
Known via "connected", distance 0, metric 0, best
* is directly connected, vlan1
7.2.3 Show IPv4 Routing Information Base
[Syntax]
show
ip
route
database
[Input mode]
unprivileged EXEC mode, priviledged EXEC mode
[Description]
Shows the IPv4 Routing Information Base (RIB).
[Example]
Show the IPv4 routing information base.
Command Reference | Layer 3 functions |
195