Check the Interface Statuses and Display the Routing Tables
The output commandsshow ip interface brief
andshow ipv6 interface brief
can be used to quickly display the status of all the interfaces on the router.
You can check that the interfaces are enabled and operational by looking for the note “up” in the status and for the protocol. If you have a different result, go through your configurations again.
Switch# show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 192.168.110.254 YES manual up up GigabitEthernet0/1 unassigned YES unset administratively down down Serial0/1/0 unassigned YES unset administratively down down Serial0/1/1 10.0.0.2 YES manual up up Vlan1 unassigned YES unset administratively down down VPNRouter#
VPNRouter# show ipv6 interface brief GigabitEthernet0/0 [up/up] FE80::260:3EFF:FE50:9101 2001:DB8:ACAD:110::254 GigabitEthernet0/1 [administratively down/down] unassigned Serial0/1/0 [administratively down/down] unassigned Serial0/1/1 [up/up] FE80::260:3EFF:FE50:9101 2001:DB8:ACAD:1001::2 Vlan1 [administratively down/down] unassigned VPNRouter#
To display the routing tables, we’ll use theshow ip route
andshow ipv6 route
commands:
VPNRouter# show ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, 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, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is 10.0.0.1 to network 0.0.0.0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 10.0.0.0/24 is directly connected, Serial0/1/1 L 10.0.0.2/32 is directly connected, Serial0/1/1 192.168.110.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.110.0/24 is directly connected, GigabitEthernet0/0 L 192.168.110.254/32 is directly connected, GigabitEthernet0/0 S* 0.0.0.0/0 [1/0] via 10.0.0.1 VPNRouter#
If you analyze this routing table, you’ll find:
1. Directly connected networks, i.e., 10.0.0.0/24 and 192.168.110.0/24. The router has added these automatically:
C 10.0.0.0/24 is directly connected, Serial0/1/1 C 192.168.110.0/24 is directly connected, GigabitEthernet0/0
2. Two local entries corresponding to the two configured interfaces:
L 10.0.0.2/32 is directly connected, Serial0/1/1 L 192.168.110.254/32 is directly connected, GigabitEthernet0/0
3. The default route that you've configured:
S* 0.0.0.0/0 [1/0] via 10.0.0.1
It’s the same principle for the IPv6 routing table.
VPNRouter# show ipv6 route IPv6 Routing Table - 6 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route, M - MIPv6 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 D - EIGRP, EX - EIGRP external S ::/0 [1/0] via 2001:DB8:ACAD:1001::1 C 2001:DB8:ACAD:110::/64 [0/0] via GigabitEthernet0/0, directly connected L 2001:DB8:ACAD:110::254/128 [0/0] via GigabitEthernet0/0, receive C 2001:DB8:ACAD:1001::/64 [0/0] via Serial0/1/1, directly connected L 2001:DB8:ACAD:1001::2/128 [0/0] via Serial0/1/1, receive L FF00::/8 [0/0] via Null0, receive VPNRouter#
How about we test our new knowledge? Join me over here:
Filter Results With the Show Command
Commands that generate several screens of output are paused after 24 lines by default. When it pauses, the word --More--
is displayed. Press Enter to show the next line and press the Space bar to display the next sequence of lines.
Another really useful feature that improves the user experience in the CLI is the ability to filter the show output.
Filtering commands enables you to display only specific results. To enable the filtering command:
type the (|) symbol after the show command
then
type a filtering parameter and a filtering expression.
There are four filtering parameters that can be configured after the pipe symbol (the|
character).
1. section:
Shows the whole section, starting with the filtering expression.
VPNRouter# show running-config | section GigabitEthernet0/1 interface GigabitEthernet0/1 no ip address duplex auto speed auto shutdown VPNRouter#
2. include
: Includes all output lines that match the filtering expression.
VPNRouter# show ip interface brief | include up GigabitEthernet0/0 192.168.110.254 YES manual up up Serial0/1/1 10.0.0.2 YES manual up up VPNRouter#
3. exclude
: Excludes all output lines that match the filtering expression.
VPNRouter# show ip interface brief | exclude unassigned Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 192.168.110.254 YES manual up up Serial0/1/1 10.0.0.2. YES manual up up VPNRouter#
4. begin
: Displays all lines starting from a particular point as defined in the filtering expression.
VPNRouter# show ip route | begin Gateway Gateway of last resort is 10.0.0.1 to network 0.0.0.0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 10.0.0.0/24 is directly connected, Serial0/1/1 L 10.0.0.2/32 is directly connected, Serial0/1/1 192.168.110.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.110.0/24 is directly connected, GigabitEthernet0/0 L 192.168.110.254/32 is directly connected, GigabitEthernet0/0 S* 0.0.0.0/0 [1/0] via 10.0.0.1 VPNRouter#
Display Previous Commands With the History Command
The command history function is useful because it stores the list of executed commands temporarily so that they can be recalled.
To recall commands from the buffer memory, press Ctrl+P or the Up Arrow (↑) key. The output from this command starts with the most recent command and you can press the arrow key repeatedly to recall older commands.
To go back to the more recent commands in the buffer memory, press Ctrl+N or the Down Arrow key (↓), pressing this key repeatedly to show more recent commands.
By default, command history is enabled and the system records the last 10 lines of command in the buffer memory. You can use the commandshow history
to display the buffer contents:
VPNRouter# show history show history show ip interface brief show ipv6 interface brief show ip route show ipv6 route show running-config | section GigabitEthernet0/1 show ip interface brief | include up show ip interface brief | exclude unassigned show ip route | begin Gateway show history VPNRouter#
This command also enables you to increase the number of command lines recorded in the history for the current session only.
You can use the command terminal history size to increase or reduce the size of the buffer memory.
VPNRouter# terminal history size 200 VPNRouter# show history en conf t show history terminal history size terminal history size 200 conf t show history VPNRouter# exit VPNRouter con0 is now available Press RETURN to get started. VPNRouter> en VPNRouter# show history en show history VPNRouter#
Let's Recap!
In this chapter, you’ve seen:
how to check an interface status.
how to filter command results with show:
section
include
exclude
begin
The command history feature using the
show history
command, which displays the last 10 commands entered.
Now that you know how to configure a router, you’re going to tackle switch configuration. See you in the next part!
But first of all, I think you should test your new-found knowledge with a practical exercise and a quiz.