[go: up one dir, main page]

0% found this document useful (0 votes)
17 views13 pages

Configure Basic Router-1

This document provides a comprehensive guide on basic router configuration, including naming devices, setting passwords, and configuring interfaces for both IPv4 and IPv6. It emphasizes the importance of verifying configurations and connectivity using various show commands and discusses the utility of loopback interfaces for testing. Additionally, it covers filtering show command output for better user experience in the CLI.

Uploaded by

cshekar774
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views13 pages

Configure Basic Router-1

This document provides a comprehensive guide on basic router configuration, including naming devices, setting passwords, and configuring interfaces for both IPv4 and IPv6. It emphasizes the importance of verifying configurations and connectivity using various show commands and discusses the utility of loopback interfaces for testing. Additionally, it covers filtering show command output for better user experience in the CLI.

Uploaded by

cshekar774
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Configure Basic Router

Company Name: IT SERVI-Q BD Email: info@itserviqbd.com Website: itserviqbd.com


Office Address: 432/8/1, West Shawrapara, Mirpur, Dhaka-1216
Up to now, this module has only covered switches. If you want devices to be able to send and receive data
outside of your network, you will have to configure routers. This topic teaches you basic router configuration
and provides two Syntax Checkers and a Packet Tracer activity so you can practice these skills.
Cisco routers and Cisco switches have many similarities. They support a similar modal operating system,
similar command structures, and many of the same commands. In addition, both devices have similar initial
configuration steps. For example, the following configuration tasks should always be performed. Name the
device to distinguish it from other routers and configure passwords, as shown in the example.
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# hostname R1
R1(config)# enable secret class
R1(config)# line console 0
R1(config-line)# password cisco
R1(config-line)# login
R1(config-line)# exit
R1(config)# line vty 0 4
R1(config-line)# password cisco
R1(config-line)# login
R1(config-line)# exit
R1(config)# service password-encryption
R1(config)#

Configure a banner to provide legal notification of unauthorized access, as shown in the example.
R1(config)# banner motd #Authorized Access Only!#
R1(config)#

Save the changes on a router, as shown in the example.


R1# copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Dual Stack Topology
One distinguishing feature between switches and routers is the type of interfaces supported by
each. For example, Layer 2 switches support LANs; therefore, they have multiple FastEthernet
or Gigabit Ethernet ports. The dual stack topology in the figure is used to demonstrate the
configuration of router IPv4 and IPv6 interfaces.

Configure Router Interfaces


Routers support LANs and WANs and can interconnect different types of networks; therefore, they support
many types of interfaces. For example, G2 ISRs have one or two integrated Gigabit Ethernet interfaces and
High-Speed WAN Interface Card (HWIC) slots to accommodate other types of network interfaces, including
serial, DSL, and cable interfaces.
To be available, an interface must be:
 Configured with at least one IP address - Use the ip address ip-address subnet-mask and the ipv6 address
ipv6-address/prefix interface configuration commands.
 Activated - By default, LAN and WAN interfaces are not activated (shutdown). To enable an interface,
it must be activated using the no shutdown command. (This is similar to powering on the interface.) The
interface must also be connected to another device (a hub, a switch, or another router) for the physical
layer to be active.
 Description - Optionally, the interface could also be configured with a short description of up to 240
characters. It is good practice to configure a description on each interface. On production networks, the
benefits of interface descriptions are quickly realized as they are helpful in troubleshooting and in
identifying a third-party connection and contact information.
The following example shows the configuration for the interfaces on R1
R1(config)# interface gigabitethernet 0/0/0
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# ipv6 address 2001:db8:acad:1::1/64
R1(config-if)# description Link to LAN 1
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface gigabitethernet 0/0/1
R1(config-if)# ip address 192.168.11.1 255.255.255.0
R1(config-if)# ipv6 address 2001:db8:acad:2::1/64
R1(config-if)# description Link to LAN 2
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface serial 0/0/0
R1(config-if)# ip address 209.165.200.225 255.255.255.252
R1(config-if)# ipv6 address 2001:db8:acad:3::225/64
R1(config-if)# description Link to R2
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)#

IPv4 Loopback Interfaces:


Another common configuration of Cisco IOS routers is enabling a loopback interface.
The loopback interface is a logical interface that is internal to the router. It is not assigned to a physical port and
can never be connected to any other device. It is considered a software interface that is automatically placed in
an “up” state, as long as the router is functioning.
The loopback interface is useful in testing and managing a Cisco IOS device because it ensures that at least one
interface will always be available. For example, it can be used for testing purposes, such as testing internal
routing processes, by emulating networks behind the router.
Loopback interfaces are also commonly used in lab environments to create additional interfaces. For example,
you can create multiple loopback interfaces on a router to simulate more networks for configuration practice
and testing purposes. In this curriculum, we often use a loopback interface to simulate a link to the internet.
Enabling and assigning a loopback address is simple:

Router(config)# interface loopback number

Router(config-if)# ip address ip-address subnet-mask

Multiple loopback interfaces can be enabled on a router. The IPv4 address for each loopback interface must be
unique and unused by any other interface, as shown in the example configuration of loopback interface 0 on R1.
R1(config)# interface loopback 0
R1(config-if)# ip address 10.0.0.1 255.255.255.0
R1(config-if)# exit
R1(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state
to up
Interface Verification Commands
There is no point in configuring your router unless you verify the configuration and connectivity. This topic
covers the commands to use to verify directly connected networks. It includes two Syntax Checkers and a
Packet Tracer.
There are several show commands that can be used to verify the operation and configuration of an interface.
The topology in the figure is used to demonstrate the verification of router interface settings.

The following commands are especially useful to quickly identify the status of an interface:
 show ip interface brief and show ipv6 interface brief - These display a summary for all interfaces
including the IPv4 or IPv6 address of the interface and current operational status.
 show running-config interface interface-id - This displays the commands applied to the specified
interface.
 show ip route and show ipv6 route - These display the contents of the IPv4 or IPv6 routing table stored
in RAM. In Cisco IOS 15, active interfaces should appear in the routing table with two related entries
identified by the code ‘C’ (Connected) or ‘L’ (Local). In previous IOS versions, only a single entry with
the code ‘C’ will appear.

Verify Interface Status


The output of the show ip interface brief and show ipv6 interface brief commands can be used to quickly reveal
the status of all interfaces on the router. You can verify that the interfaces are active and operational as indicated
by the Status of “up” and Protocol of “up”, as shown in the example. A different output would indicate a
problem with either the configuration or the cabling.
R1# show ip interface brief
Interface IP-Address OK? Method
Status Protocol
GigabitEthernet0/0/0 192.168.10.1 YES manual up up
GigabitEthernet0/0/1 192.168.11.1 YES manual up up
Serial0/1/0 209.165.200.225 YES manual up up
Serial0/1/1 unassigned YES unset administratively down
down
R1# show ipv6 interface brief
GigabitEthernet0/0/0 [up/up]
FE80::7279:B3FF:FE92:3130
2001:DB8:ACAD:1::1
GigabitEthernet0/0/1 [up/up]
FE80::7279:B3FF:FE92:3131
2001:DB8:ACAD:2::1
Serial0/1/0 [up/up]
FE80::7279:B3FF:FE92:3130
2001:DB8:ACAD:3::1
Serial0/1/1 [down/down] Unassigned

Verify IPv6 Link Local and Multicast Addresses


The output of the show ipv6 interface brief command displays two configured IPv6 addresses per interface. One
address is the IPv6 global unicast address that was manually entered. The other address, which begins with
FE80, is the link-local unicast address for the interface. A link-local address is automatically added to an
interface whenever a global unicast address is assigned. An IPv6 network interface is required to have a link-
local address, but not necessarily a global unicast address.
The show ipv6 interface gigabitethernet 0/0/0 command displays the interface status and all of the IPv6
addresses belonging to the interface. Along with the link local address and global unicast address, the output
includes the multicast addresses assigned to the interface, beginning with prefix FF02, as shown in the example.
R1# show ipv6 interface gigabitethernet 0/0/0
GigabitEthernet0/0/0 is up, line protocol is up
IPv6 is enabled, link-local address is FE80::7279:B3FF:FE92:3130
No Virtual link-local address(es):
Global unicast address(es):
2001:DB8:ACAD:1::1, subnet is 2001:DB8:ACAD:1::/64
Joined group address(es):
FF02::1
FF02::1:FF00:1
FF02::1:FF92:3130
MTU is 1500 bytes
ICMP error messages limited to one every 100 milliseconds
ICMP redirects are enabled
ICMP unreachables are sent
ND DAD is enabled, number of DAD attempts: 1
ND reachable time is 30000 milliseconds (using 30000)
ND advertised reachable time is 0 (unspecified)
ND advertised retransmit interval is 0 (unspecified)
ND router advertisements are sent every 200 seconds
ND router advertisements live for 1800 seconds
ND advertised default router preference is Medium
Verify Interface Configuration
The output of the show running-config interface command displays the current commands applied to the
specified interface as shown.
R1 show running-config interface gigabitethernet 0/0/0
Building configuration...
Current configuration : 158 bytes
!
interface GigabitEthernet0/0/0
description Link to LAN 1
ip address 192.168.10.1 255.255.255.0
negotiation auto
ipv6 address 2001:DB8:ACAD:1::1/64
end
R1#

The following two commands are used to gather more detailed interface information:

 show interfaces - Displays interface information and packet flow count for all interfaces on the device.
 show ip interface and show ipv6 interface - Displays the IPv4 and IPv6 related information for all
interfaces on a router.

Verify Routes
The output of the show ip route and show ipv6 route commands reveal the three directly connected network
entries and the three local host route interface entries, as shown in the example. The local host route has an
administrative distance of 0. It also has a /32 mask for IPv4, and a /128 mask for IPv6. The local host route is
for routes on the router that owns the IP address. It is used to allow the router to process packets destined to that
IP.
R1# show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

Gateway of last resort is not set


192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 2 masks
C 209.165.200.224/30 is directly connected, Serial0/1/0
L 209.165.200.225/32 is directly connected, Serial0/1/0
R1# show ipv6 route
IPv6 Routing Table - default - 7 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route

C 2001:DB8:ACAD:1::/64 [0/0]
via GigabitEthernet0/0/0, directly connected
L 2001:DB8:ACAD:1::1/128 [0/0]
via GigabitEthernet0/0/0, receive
C 2001:DB8:ACAD:2::/64 [0/0]
via GigabitEthernet0/0/1, directly connected
L 2001:DB8:ACAD:2::1/128 [0/0]
via GigabitEthernet0/0/1, receive
C 2001:DB8:ACAD:3::/64 [0/0]
via Serial0/1/0, directly connected
L 2001:DB8:ACAD:3::1/128 [0/0]
via Serial0/1/0, receive
L FF00::/8 [0/0]
via Null0, receive
R1#

A ‘C’ next to a route within the routing table indicates that this is a directly connected network. When the router
interface is configured with a global unicast address and is in the “up/up” state, the IPv6 prefix and prefix length
are added to the IPv6 routing table as a connected route.
The IPv6 global unicast address applied to the interface is also installed in the routing table as a local route. The
local route has a /128 prefix. Local routes are used by the routing table to efficiently process packets with the
interface address of the router as the destination.
The ping command for IPv6 is identical to the command used with IPv4 except that an IPv6 address is used. As
shown in the example, the ping command is used to verify Layer 3 connectivity between R1 and PC1.

R1# ping 2001:db8:acad:1::10


Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:DB8:ACAD:1::10, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

Filter Show Command Output


Commands that generate multiple screens of output are, by default, paused after 24 lines. At the end of the
paused output, the --More-- text displays. Pressing Enter displays the next line and pressing the spacebar
displays the next set of lines. Use the terminal length command to specify the number of lines to be displayed.
A value of 0 (zero) prevents the router from pausing between screens of output.
Another very useful feature that improves the user experience in the CLI is the filtering of show output.
Filtering commands can be used to display specific sections of output. To enable the filtering command, enter a
pipe (|) character after the show command and then enter a filtering parameter and a filtering expression.
There are four filtering parameters that can be configured after the pipe.
section
Shows the entire section that starts with the filtering expression, as shown in the example.
R1# show running-config | section line vty
line vty 0 4
password 7 110A1016141D
login
transport input all

Include
Includes all output lines that match the filtering expression, as shown in the example.

R1# show ip interface brief


Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0/0 192.168.10.1 YES manual up up
GigabitEthernet0/0/1 192.168.11.1 YES manual up up
Serial0/1/0 209.165.200.225 YES manual up up
Serial0/1/1 unassigned NO unset down down
R1#
R1# show ip interface brief | include up
GigabitEthernet0/0/0 192.168.10.1 YES manual up up
GigabitEthernet0/0/1 192.168.11.1 YES manual up up
Serial0/1/0 209.165.200.225 YES manual up up

Begin
Shows all the output lines from a certain point, starting with the line that matches the filtering expression, as
shown in the example.

R1# show ip route | begin Gateway


Gateway of last resort is not set
192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 2 masks
C 209.165.200.224/30 is directly connected, Serial0/1/0
L 209.165.200.225/32 is directly connected, Serial0/1/0

Note: Output filters can be used in combination with any show command.
Command History Feature
The command history feature is useful because it temporarily stores the list of executed commands to be
recalled.
To recall commands in the history buffer, press Ctrl+P or the Up Arrow key. The command output begins with
the most recent command. Repeat the key sequence to recall successively older commands. To return to more
recent commands in the history buffer, press Ctrl+N or the Down Arrow key. Repeat the key sequence to
recall successively more recent commands.
By default, command history is enabled and the system captures the last 10 command lines in its history buffer.
Use the show history privileged EXEC command to display the contents of the buffer.
It is also practical to increase the number of command lines that the history buffer records during the current
terminal session only. Use the terminal history size user EXEC command to increase or decrease the size of
the buffer.
An example of the terminal history size and show history commands is shown in the figure.
R1# terminal history size 200
R1# show history
show ip int brief
show interface g0/0/0
show ip route
show running-config
show history
terminal history size 200

Switching in Networking
The concept of switching and forwarding frames is universal in networking and telecommunications. Various
types of switches are used in LANs, WANs, and in the public switched telephone network (PSTN).
The decision on how a switch forwards traffic is made based on the flow of that traffic. There are two terms
associated with frames entering and leaving an interface:
 Ingress - This is used to describe the port where a frame enters the device.
 Egress - This is used to describe the port that frames will use when leaving the device.
A LAN switch maintains a table that is referenced when forwarding traffic through the switch. The only
intelligence of a LAN switch is its ability to use its table to forward traffic. A LAN switch forwards traffic based
on the ingress port and the destination MAC address of an Ethernet frame. With a LAN switch, there is only one
master switching table that describes a strict association between MAC addresses and ports; therefore, an Ethernet
frame with a given destination address always exits the same egress port, regardless of the ingress port it enters.
The Switch MAC Address Table
A switch is made up of integrated circuits and the accompanying software that controls the data paths through the
switch. Switches use destination MAC addresses to direct network communications through the switch, out the
appropriate port, toward the destination.
For a switch to know which port to use to transmit a frame, it must first learn which devices exist on each port.
As the switch learns the relationship of ports to devices, it builds a table called a MAC address table. This table
is stored in content addressable memory (CAM) which is a special type of memory used in high-speed searching
applications. For this reason, the MAC address table is sometimes also called the CAM table.
LAN switches determine how to handle incoming data frames by maintaining the MAC address table. A switch
populates its MAC address table by recording the source MAC address of each device connected to each of its
ports. The switch references the information in the MAC address table to send frames destined for a specific
device out of the port which has been assigned to that device.

The Switch Learn and Forward Method


The following two-step process is performed on every Ethernet frame that enters a switch.
Step 1. Learn - Examining the Source MAC Address
Every frame that enters a switch is checked for new information to learn. It does this by examining the source
MAC address of the frame and port number where the frame entered the switch:
 If the source MAC address does not exist in the MAC address table, the MAC address and incoming port
number are added to the table.
 If the source MAC address does exist, the switch updates the refresh timer for that entry. By default, most
Ethernet switches keep an entry in the table for five minutes. If the source MAC address does exist in the
table but on a different port, the switch treats this as a new entry. The entry is replaced using the same
MAC address, but with the more current port number.
Step 2. Forward - Examining the Destination MAC Address
If the destination MAC address is a unicast address, the switch will look for a match between the destination
MAC address of the frame and an entry in its MAC address table:
 If the destination MAC address is in the table, it will forward the frame out of the specified port.
 If the destination MAC address is not in the table, the switch will forward the frame out all ports except
the incoming port. This is called an unknown unicast. If the destination MAC address is a broadcast or a
multicast, the frame is also flooded out all ports except the incoming port.

MAC Address Tables on Connected Switches Click For Video


Switching Forwarding Methods
Switches make Layer 2 forwarding decisions very quickly. This is because of software on application-specific-
integrated circuits (ASICs). ASICs reduce the frame-handling time within the device and allow the device to
manage an increased number of frames without degrading performance.
Layer 2 switches use one of two methods to switch frames:
 Store-and-forward switching - This method makes a forwarding decision on a frame after it has received
the entire frame and checked the frame for errors using a mathematical error-checking mechanism known
as a cyclic redundancy check (CRC). Store-and-forward switching is Cisco’s primary LAN switching
method.
 Cut-through switching - This method begins the forwarding process after the destination MAC address of
an incoming frame and the egress port have been determined.

Store-and-Forward Switching
Store-and-forward switching, as distinguished from cut-through switching, has the following two primary
characteristics:
 Error checking - After receiving the entire frame on the ingress port, the switch compares the frame
check sequence (FCS) value in the last field of the datagram against its own FCS calculations. The FCS
is an error checking process that helps to ensure that the frame is free of physical and data-link errors. If
the frame is error-free, the switch forwards the frame. Otherwise, the frame is dropped.
 Automatic buffering - The ingress port buffering process used by store-and-forward switches provides
the flexibility to support any mix of Ethernet speeds. For example, handling an incoming frame traveling
into a 100 Mbps Ethernet port that must be sent out a 1 Gbps interface would require using the store-and-
forward method. With any mismatch in speeds between the ingress and egress ports, the switch stores the
entire frame in a buffer, computes the FCS check, forwards it to the egress port buffer and then sends it.
The figure illustrates how store-and-forward makes a decision based on the Ethernet frame.
Cut-Through Switching
The store-and-forward switching method drops frames that do not pass the FCS check. Therefore, it does not
forward invalid frames.
By contrast, the cut-through switching method may forward invalid frames because no FCS check is performed.
However, cut-through switching has the ability to perform rapid frame switching. This means the switch can make
a forwarding decision as soon as it has looked up the destination MAC address of the frame in its MAC address
table, as shown in the figure.

The switch does not have to wait for the rest of the frame to enter the ingress port before making its forwarding
decision.
Fragment free switching is a modified form of cut-through switching in which the switch only starts forwarding
the frame. Fragment free switching provides better error checking than cut-through, with practically no increase
in latency.
The lower latency speed of cut-through switching makes it more appropriate for extremely demanding, high-
performance computing (HPC) applications that require process-to-process latencies of 10 microseconds or less.
The cut-through switching method can forward frames with errors. If there is a high error rate (invalid frames) in
the network, cut-through switching can have a negative impact on bandwidth, thereby clogging up bandwidth
with damaged and invalid frames.

You might also like