Sunday 8 September 2019

How to Configure a Cisco Router with Configuration Example

How to Configure a Cisco Router with Configuration Example

This article is basic and complete guide on "How to Configure a Cisco Router". If you are the beginner then this article is for you. Cisco router uses IOS software to configure router hardware components.


BASIC STEPS IN CONFIGURING A CISCO ROUTER

Following are some basic configuration on Cisco router with CLI commands:

Configure device name

Router> enable
Router # configure terminal
Enter the configuration commands, one per line. End with CNTL / Z.
Router (config) # hostname R1

Protect EXEC mode (console line)

R1 (config) # line console 0
R1 (config-line) # password cisco
R1 (config-line) # login

Protect VTY lines

R1 (config-line) # line vty 0 4
R1 (config-line) # password cisco
R1 (config-line) # login
R1 (config-line) # exit

Protect EXEC mode with privileges

R1 (config) # enable secret cisco

Protect all passwords (encrypt passwords)

R1 (config) # service password-encryption

Provide legal notice

R1 (config) # banner motd # Authorized access only! #

Save Settings on Cisco Router

R1 # copy running-config startup-config


How to configure the Cisco Router Interfaces:


In order for routers to be reached, in-band router interfaces must be configured. There are many different types of interfaces for Cisco routers. In this example, the Cisco 1941 series router has the following characteristics:



  • Two Gigabit Ethernet interfaces: GigabitEthernet 0/0 (G0 / 0) and GigabitEthernet 0/1 (G0 / 1)
  • A WAN serial interface card (WIC) consisting of two interfaces: serial 0/0/0 (S0 / 0/0) and serial 0/0/1 (S0 / 0/1)
For the example of the previous image we will configure the GigabitEthernet 0/0 interface:
Configure IPv4 address 192.168.10.1 with subnet mask 255.255.255.0.


R1 # configure terminal

Enter the configuration commands, one per line. End with CNTL / Z.
R1 (config) # interface gigabitethernet 0/0
R1 (config-if) # ip address 192.168.10.1 255.255.255.0


Describe the link as 'LAN-10'.


R1 (config-if) # description LAN-10


Turn on the Cisco interface


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

Configure the GigabitEthernet 0/1 interface:


Configure IPv4 address 192.168.11.1 with subnet mask 255.255.255.0.


R1 (config) # interface gigabitethernet 0/1
R1 (config-if) # ip address 192.168.11.1 255.255.255.0


Describe the link as 'LAN-11'


R1 (config-if) # description LAN-11


Turn on the Cisco interface


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
R1 (config-if) #


Note: While it is not necessary, it is recommended to configure a description on each interface to help record network information.

Cisco interfaces commands


There are several commands that can be used to verify the interface configuration:

To show all the interfaces, their IPv4 address and the current status.
show ip interface brief
To display the contents of the IPv4 routing table that is stored in RAM.
show ip route
To show the statistics of all the interfaces of a device.
show interfaces
To show the IPv4 statistics of all the interfaces of a router.
show ip interface

How to Configure a Default Gateway on Cisco Router


The default gateway address is the router interface address connected to the host's local network. The IP address of the host device and the router interface address must be on the same network.

The default gateway is used only when the host wishes to send a packet to a device on another network.

Remember that a layer 2 switch does not need an IP address to function properly. However, if you want to connect to the switch and manage it on multiple networks, you must configure the SVI with an IPv4 address, a subnet mask and a default gateway address.

To configure a default gateway on a switch, use the following command:

S1 # configure terminal
Enter the configuration commands, one per line. End with CNTL / Z.
S1 (config) # ip default-gateway 192.168.10.1
S1 (config) #

No comments:

Post a Comment