Basic Initial Cisco Router Configuration | CCNA
In this article of CCNA series you will learn the Basic Initial Cisco Router Configuration with commands example and about routing. We have already seen that the Ethernet switches work at the data link layer (layer 2) and are used to forward Ethernet frames between devices within the same network. Now, when the source and destination IP addresses are on different networks , the Ethernet frame must be sent to a router.Important considerations:
- The router uses its routing table to find the best route to resend a packet.
- When a host sends a packet to a device on a different IP network, the packet is forwarded to the default gateway .
- The default gateway is the destination that routes traffic from the local network to the devices in the remote networks.
WHY IS ROUTING NECESSARY?
Simply put, a router connects a network with another network . Communication between networks would not be possible without a router that determines the best route to the destination and forwards traffic to the next router on that route. The router is responsible for routing traffic between networks.And when we talk about the best route we realize the speed with which we access a web page when we click on a link in the browser.
In the following image we see that the routers interconnect the networks in the different sites. When a packet arrives at a router interface, it uses the routing table to determine how to reach the destination network.
ROUTERS CHOOSE THE BEST ROUTES
The main functions of a router are the following:Determine the best route to send packages.
Forward packets to your destination.
It's simple, when the router receives a packet, it analyzes the destination address of the packet and uses the routing table to find the best route to that network.
A router can receive a packet encapsulated in one type of data link frame and forward it through an interface that uses another type of data link frame. Precisely, the different data link technologies to which a router can be connected include Ethernet, PPP, Frame Relay, DSL, cable technology and wireless technology (802.11, Bluetooth, etc.).
PACKAGE FORWARDING MECHANISMS
Routers support three packet forwarding mechanisms:Process switching : (old and slow)
When a packet arrives at an interface, it is forwarded to the control plane, where the CPU matches the destination address with an entry in the routing table and then determines the interface of Check out and resend the package. The router does this with each packet, even if the destination is the same for a packet stream.Fast switching :
Use a fast switching cache to store the next hop information. When a packet arrives at an interface, it is forwarded to the control plane, where the CPU looks for a match in the fast switching cache. If it finds none, the process switching is applied to the packet, and this is forwarded to the outgoing interface. If another packet with the same destination arrives at an interface, the next hop information in the cache is reused without CPU intervention.Fast switching solves a problem by performing all mathematical calculations once and remembers the answer for subsequent identical problems.
Cisco Express Forwarding (CEF):
It is the latest and most used packet forwarding mechanism in Cisco IOS . Like fast switching, CEF assembles a forwarding information base (FIB) and an adjacency table. The FIB contains previously calculated reverse searches, next hop information for routes, including interface and layer 2 information.DEVICE CONNECTION
Generally the devices connect to a network via a wired Ethernet connection or a wireless connection. Now, to enable access to the network , devices with IP address information must be configured to identify the corresponding items, including:- IP Address : Identifies a unique host on a local network.
- Subnet Mask: Identifies which subnet on the network the host can communicate with.
- Default Gateway : Identifies the IP address of the router to which a packet should be sent when the destination is not in the same subnet of the local network.
When a host sends a packet to a device on a different IP network, the packet is forwarded to the default gateway
Basic Initial Router Configuration
Once we have reviewed the previous topics, we will go to the basic configuration of a router. Cisco routers and switches have many similarities. They support similar command structures, as well as many of the same commands. Therefore, the initial configuration steps are similar for both devices.- Assign a name to the device
- Protect administration access
- Set up a warning
We recommend you read: How to Configure a Cisco Router
R1> in R1 # conf t Enter configuration commands, one per line. End with CNTL / Z. R1 (config) # R1 (config) #enable secret MyPassEnable
R1 (config) #line console 0 R1 (config-line) #pass MyPassConsole R1 (config-line) #login R1 (config-line) #exit
R1 (config) #line vty 0 4 R1 (config-line) #pass MyPassVty R1 (config-line) #login R1 (config-line) #exit
R1 (config) #service password-encryption
R1 (config) #banner motd #SOLO AUTHORIZED ACCESS! # R1 (config) #exit R1 # % SYS-5-CONFIG_I: Configured from console by console R1 # copy running-config startup-config Destination filename [startup-config]? Building configuration ... [OKAY] R1 #
IP Configuration of Router Interface
A feature that distinguishes switches from routers is the type of interfaces each supports. While Layer 2 switches support LAN networks (they have several FastEthernet or Gigabit Ethernet ports), the routers support LAN and WAN networks, and can interconnect different types of networks (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 support other types of network interfaces, including serial, DSL and cable interfaces.
For an interface to be available, it must meet the following requirements:
- Be configured with an IP address and subnet mask: use the ip address [ ip-address] [subnet-mask] command for interface configuration.
- Activate the interface: LAN and WAN interfaces are not enabled (shutdown) by default. To enable an interface, it must be activated using the no shutdown command . (It's like turning on the interface.) The interface must also be connected to another device (a hub, a switch or another router) for the physical layer to activate.
- It is advisable to configure a description (brief of up to 240 characters) on each interface with the description command
Example : The configuration commands for Router R1 will be displayed
GigabitEthernet 0/0 interface configuration with IP address 192.168.10.1 and subnet mask 255.255.255.0. The link is described as "Link to LAN 1" and the interface is activated.
R1 (config) # interface gigabitethernet 0/0 R1 (config-if) # ip address 192.168.10.1 255.255.255.0 R1 (config-if) # description Link to LAN 1 R1 (config-if) # no shutdown % LINK-5-CHANGED: Interface GigabitEthernet0 / 0, changed state to up % LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0 / 0, changed state to up
GigabitEthernet 0/1 interface configuration with address IP 192.168.11.1 and subnet mask 255.255.255.0. The link is described as "Link to LAN 2" and the interface is activated.
R1 (config-if) # interface gigabitethernet 0/1 R1 (config-if) # ip address 192.168.11.1 255.255.255.0 R1 (config-if) # description Link to LAN 2 R1 (config-if) # no shutdown % LINK-5-CHANGED: Interface GigabitEthernet0 / 1, changed state to up % LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0 / 1, changed state to up Serial interface 0/0/0 configuration with address IP 209.165.200.224 and subnet mask 255.255.255.252. The link is described as "Link to R1" and the interface is activated.
R1 (config-if) # interface Serial 0/0/0 R1 (config-if) # ip address 209.165.200.224 255.255.255.252 R1 (config-if) # description Link to R1 R1 (config-if) # no shutdown % LINK-5-CHANGED: Interface Serial0 / 0/0, changed state to up % LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0 / 0/0, changed state to up You have correctly configured the interfaces of router R1.
How to assign IPv6 to Cisco Router interface
The configuration of an IPv6 interface is similar to the configuration of an interface for IPv4. In most cases, the only difference in the commands is the use of ipv6 instead of ip .The following must be done with the IPv6 interface:
- Configure with IPv6 address and subnet mask: use ip address [ipv6-address / prefix-length]
- Activate the interface: the interface must be activated using the no shutdown command .
- An interface can generate its own IPv6 link-local address without having a global unicast address using the ipv6 enable interface configuration command .
Example : The configuration commands for Router R1 will be displayed
GigabitEthernet 0/0 interface configuration with IPv6 address 2001: db8: acad: 1 :: 1/64. The link is described as "Link to LAN 1" and the interface is activated.
R1 (config) # interface gigabitethernet 0/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 % LINK-5-CHANGED: Interface GigabitEthernet0 / 0, changed state to up % LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0 / 0, changed state to up
GigabitEthernet 0/1 interface configuration with address IPv6 2001: db8: acad: 2 :: 1/64. The link is described as "Link to LAN 2" and the interface is activated.
R1 (config-if) # interface gigabitethernet 0/1 R1 (config-if) # ipv6 address 2001: db8: acad: 2 :: 1/64 R1 (config-if) # description Link to LAN 2 R1 (config-if) # no shutdown % LINK-5-CHANGED: Interface GigabitEthernet0 / 1, changed state to up % LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0 / 1, changed state to up
Serial interface 0/0/0 configuration with address IPv6 2001: db8: acad: 3 :: 2/64. The link is described as "Link to R1" and the interface is activated. R1 (config-if) # interface Serial 0/0/0 R1 (config-if) # ipv6 address 2001: db8: acad: 3 :: 2/64 R1 (config-if) # description Link to R1 R1 (config-if) # no shutdown % LINK-5-CHANGED: Interface Serial0 / 0/0, changed state to up % LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0 / 0/0, changed state to up You have correctly configured the IPv6 interfaces of router R1.
VERIFICATION OF THE INTERFACE CONFIGURATION
There are several show commands that can be used to verify the operation and configuration of an interface. The following three commands are particularly useful for quickly identifying the status of an interface:- show ip interface brief : shows a summary of all interfaces, including the IPv4 address of the interface and the current operating status.
- show ip route : shows the contents of the IPv4 routing table that is stored in RAM. In the Cisco IOS the active interfaces must appear with two related entries identified with the code “C” (connected) or “L” (local)
- show running-config interface interface-id : shows the commands configured on the specified interface.
No comments:
Post a Comment