Router Commands
Router Commands
>enable secret class (to set an encrypted password used to enter privileged EXEC mode.
# line con 0 ( to enter line configuration mode for the console line).
# password cisco (to set the console password).
# login (to require use of the password when logging in via the console port)
# exit (to return to global configuration mode).
# line vty 0 4 (to enter line configuration mode for all five virtual terminal lines).
# password cisco (to set the vty password
# login ( to require use of the password when telnetting to the router.
Press Ctrl+z to leave configuration mode.
(to save the configured changes to NVRAM.
Press Enter # copy running-config startup-config at the prompt to confirm the destination filename.
# show running-config (to see the configuration.
show running-config
show startup-config
show ip route
show interfaces
show ip interface brief
1
Enable the FastEthernet interface on R1.
From the CLI (command line interface) type the following commands:
Password:cisco
R1>enable
Password: class
R1#show ip route
Activate the interface FastEthernet:
R1#configure terminal
R1(config)#interface FastEthernet 0/0
R1(config-if)#no shutdown
R1(config-if)#end
Step 2 – Examine the routing table on R1.
From the CLI type the following commands:
R1#show ip route
_____________________________________________________
Step 3 – Enable the Serial interface on R1.
From the CLI type the following commands:
R1#configure terminal
R1(config)#interface Serial 0/0/0
R1(config-if)#no shutdown
R1(config-if)#end
In order to keep the unsolicited output separate from your input, enter line configuration mode for the
consoled port and add the logging synchronous command, as shown. You will see that messages
returned by IOS no longer interfere with your typing.
To remove a directly connected network from a router, use these two commands:
• shutdown
• no ip address.
The DTE cable has a male connector, whereas the DCE cable has a female connector.
Cisco Discovery Protocol (CDP) advertisements, to directly connected Cisco devices & monitoring
and troubleshooting & discovery tool.
Static routes
Static routes are commonly used when routing from a network to a stub network. A stub network is a
network accessed by a single route.
Before any packet is forwarded by a router, the routing table process must determine the exit interface
to use to forward the packet. This is known as route resolvability.
When the router has to perform multiple lookups in the routing table before forwarding a packet, it is
performing a process known as a recursive lookup.
Let's consider what would happen if an exit interface goes down. If the static route cannot be resolved
to an exit interface, the static route is removed from the routing table.
R(config)#int s0/0/0
4
R(config-if)# shutdown
R(config-if)# end
A static route, using a next-hop IP address for the 192.168.2.0/24 network, can be set using this
command:
As discussed in the previous section "Configuring an Ethernet interface", the IP packet must be
encapsulated into an Ethernet frame with an Ethernet destination MAC address. If the packet should
be sent to a next-hop router, the destination MAC address will be the address of the next-hop router's
Ethernet interface. In this case, the Ethernet destination MAC address will be matched to the next-hop
IP address 172.16.2.2. R1 checks its FastEthernet 0/1 ARP table for an entry with 172.16.2.2 and a
corresponding MAC address.
R1 knows that the packet needs to be encapsulated in an Ethernet frame and sent out the FastEthernet
0/1 interface. However, R1 does not know the next-hop IP address and therefore it cannot determine
the destination MAC address for the Ethernet frame.
To configure a static route over an Ethernet network so that it does not have to use the recursive
lookup of the next-hop IP address. This can be done by configuring the static route to include both
the exit interface and the next-hop IP address.
The routing table process only has to perform a single lookup to find the exit interface instead of a
second lookup to resolve a next-hop address.
For static routes with outbound point-to-point serial networks, it is best to configure static routes
with only the exit interface. For static routes with outbound Ethernet networks, it is best to
configure the static routes with both the next-hop address and the exit-interface.
The 0.0.0.0 0.0.0.0 network address and mask is called a "quad-zero" route.
R#show ip route
R#show ip protocols commands.
5
To completely remove the RIP routing process from a device
R(config-if)# no router rip
Troubleshooting Commands
R: RIP , (192.168.5.0/24): remote network address and subnet mask , AD value (120 for RIP) and the
distance to the network (2 hops) , (00:00:23) : how many seconds have passed since the last update ,
(192.168.2.2): next-hop IP address of the advertising router , (Serial 0/0/0): local exit interface that
this router will use for traffic destined for the remote network .
This command stops routing updates out the specified interface like Fastethernet interface.
Static Route
RIP v2
R# show running-config.
R1(config)#no ip classless
6
Classless routing behavior:-
R1(config)#ip classless
EIGRP Protocol
Router(config)#router eigrp autonomous-system
Router(config-router)#network network-address
EIGRP
Router(config-router)#metric weights tos k1 k2 k3 k4 k5
Router(config-if)#bandwidth kilobits
Shows all possible paths to a network including successors, feasible successors, and even those routes
that are not feasible successors.
# auto-summary
# no auto-summary
7
EIGRP requires the use of the redistribute static command to include this static default route with its
EIGRP routing updates. The redistribute static command tells EIGRP to include this static route in its
EIGRP updates to other routers. The figure shows the configuration of the static default route and the
redistribute static command on router R2.
Note: The static default route is using the exit interface of Loopback1. This is because the ISP router
in our topology does not physically exist. By using a loopback interface we can simulate a connection
to another router. Page 47
The ip bandwidth-percent eigrp command uses the amount of configured bandwidth (or the default
bandwidth) when calculating the percent that EIGRP can use.
OSPF
The router ID can be modified with the IP address from a subsequent OSPF router-id command by
:reloading the router or by using the following command
Router#clear ip ospf process
Router(config-if)#bandwidth bandwidth-kbps
# show interface ( To find BW value )
# ip ospf cost
(IP address and static default route forwarding traffic toward the ISP router)
R1(config-router)#default-information originate
If the default-information originate command is not used, the default "quad-zero" route will not be)
.(propagated to other routers in the OSPF area
? R1(config-router)#auto-cost reference-bandwidth
The reference bandwidth can be modified to accommodate these faster links by using the OSPF
command auto-cost reference-bandwidth. When this command is necessary, use it on all routers so that
.the OSPF routing metric remains consistent
The reference bandwidth in terms of Mbits per second 1-4294967
:OSPF Hello and Dead intervals can be modified manually using the following interface commands
.The wildcard-mask is the inverse of the subnet mask, and the area-id should be set to 0