Вы находитесь на странице: 1из 32

new

Router Modes

Router> enable

Note: This command allows you to enter into privileged exec mode/enable mode
where you can have more options for show and other commands. The next
prompt looks like this:

Router#

Router# configure terminal

Note :- This command allows you to enter into global configuration mode ,where
you can configure a range of commands. The prompt for this command looks likes
this :

Router (config)#

Router(config)#exit

Router #exit

Router >

Changing host name

To specify or modify the host name for the router, global configuration command
HOSTNAME is used. Hostname is case sensitive. The host name is used in prompts
and default configuration file names .The factory – assigned default host name is
router .

Router >enable

Router #configure terminal

Router(config)# hostname R1

R1(config)# exit
R1#

CONFIGURING DATE AND TIME

The system clock runs from the moment the system starts up and keeps track of
the current date and time based on Coordinated Universal Time (UTC),also known
as Greenwich Mean Time (GMT).

To manually set the system clock, use one of the formats of the clock set Exec
command.

R1# clock set ?

Hh:mm:ss Current Time

Note: Allows you to see the format of complete command .

R1 # clock set 12:15:25 ?

<1-31> day of the month

MONTH month of the year

R1# clock set 12:15:25 17 ?

Month month of the year

R1 # clock set 12:15:25 17 March ?

<1993-2035> year

R1# clock set 12:15:25 17 March 2010

Verification:

R1# show clock

12:16:56.UTC Wed Mar 17 2010

-------------------------------------------------------------------------------------------------------------
Displaying Running Configuration

R1> enable

R1# show running-config

Building configuration. . .

Note:By entering command, it will be displayed the whole running configuration


of router.

PASSWORD FOR PRIVILEGED MODE

To set an local password to control access to various privilege levels, use the
enable password global configuration command. An enable password is defined
as follows:

 It must contain uppercase and lowercase alphanumeric characters from 1


to 25.
 Must not have a number as the first character.
 Can have leading spaces, but they are ignored. However, intermediate and
trailing spaces are recognized.
R1# configure terminal
R1(config)# enable password R222
R1#

SECRET (ENCRYPTED) PASSWORD FOR PRIVILEGED MODE


To enable secret password is the password in encrypted form and is used to
gain access to enable mode and to the global configuration mode on the
router. The enable password is used when you do not specify an enable
secret password. The enable password should be different from the enable
secret password.
R1# configure terminal
R1(config)# enable secret R333
R1#
Verification
R1# exit
R1 con0 is now available
Pres s RETURN to get started

Welcome to R1
User Access Verification
Password: R123
R1>
R1> enable
Password: R333
R1#

Removing password from privileged EXEC MODE


R1> enable
R1# configure terminal
R1(config)# no enable secret
R1(config)# exit
R1#

Removing secret password

R1> enable

R1# configure terminal

R1(config)# no enable secret

R1(config)# exit

R1#

Enabling and interface

R1# configure terminal


R1(config)# interface serial 0/0

R1(config-if)# no shutdown

R1(config-if)# end

R1#

Administratively shutting down an interface

In some cases ,you want an interface to be down for administrative


reasons ,but you do not want to have to un-configure it or pull out the
cable to keep the interface from being up and up .To bring down an
interface for administrative reasons and as a side affect ,remove the
connected route from the routing table ,you can use the shutdown
interface sub command .An interface may be correctly configured and
physically connected ,yet be administratively down .In this state it will not
function.

R1# config terminal

R1(config)# inferface serial 0/0

R1(config-if)# shutdown

R1(config-if)# end

R1#

VERIFICATION

R1# show ip interface brief

SETTING CLOCK RATE ON ROUTER’S SERIAL INTERFACE

R1# config terminal

R1(config)# inferface serial 0/0

R1(config-if)# CLOCK RATE 64000


R1(config-if)# end

R1#

VERIFICATION

R1# show controllers serial 0/0

SAVING RUNNING-CONFIGURATION TO NVRAM

METHOD1

R1# copy running-config startup-config

METHOD2

R1# write memory

CONFIGURING ROUTER INTERFACES

Diagram:

Basic configuration of R1

Router> enable

Router# config terminal

Router(config)# hostname R1

R1(config)# interface serial 1/0

R1(config-if)# ip address 185.100.1.1 255.255.0.0

R1(config-if)# clock rate 64000

R1(config-if)# no shut

R1(config-if)# exit

R1(config)# interface f0/0

R1(config-if)# ip address 100.1.1.1 255.0.0.0


R1(config-if)# exit

Basic configuration of R2

Router> enable

Router# config terminal

Router(config)# hostname R2

R2(config)# interface serial 1/0

R2(config-if)# ip address 185.100.1.2 255.255.0.0

R2(config-if)# clock rate 64000

R2(config-if)# no shut

R2(config-if)# exit

R2(config)# interface f0/0

R2(config-if)# ip address 200.1.1.1 255.255.255.0

R1(config-if)# exit

VERIFICATION OF DCE/DTE AND CLOCK RATE

R1# show controller serial 1/0

R2# show controller serial 1/0

VERIFICATION OF INTERFACE STATE

R1# show interface serial 1/0

R2# show interface serial 1/0

R1# show ip interface brief

R2# show ip interface brief


STATIC ROUTE

DIAGRAM:

BASIC CONFIGURATION OF R1

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1

R1(config)#interface s0/0

R1(config-if)#ip address 12.1.1.1 255.0.0.0

R1(config-if)#clock rate 64000

R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0, changed state to down

R1(config-if)#exit

R1(config)#interface f0/0

R1(config-if)#ip address 1.0.0.1 255.0.0.0

%Duplicate IP address on FastEthernet of PC2

R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to


up

R1(config-if)#exit

R1(config)#

BASIC CONFIGURATION OF R2

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R2

R2(config)#interface s0/0

R2(config-if)#ip address 12.1.1.2 255.0.0.0

R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0, changed state to up

R2(config-if)#

R2(config-if)#exit
R2(config)#interface f0/0

R2(config-if)#ip address 2.0.0.1 255.0.0.0

%Duplicate IP address on FastEthernet of PC3

R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to


up%LINEPROTO-5-UPDOWN: Line protocol on Interface
FastEthernet0/0, changed state to up

R2(config-if)#exit

R2(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

R2#

ADDIND STATIC ROUTE ON ROUTER1

R1(config)#ip route 2.0.0.0 255.0.0.0 s0/0

R1(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

R1#

NOTE:After adding static route for network 2.0.0.0(s0/0),all traffic from


router R1 for network 2.0.0.0 will be forwarded oto its next hop
12.1.1.2(i.e.router R2)

ADDIND STATIC ROUTE ON ROUTER2

R2(config)#ip route 1.0.0.0 255.0.0.0 12.1.1.1

R2(config)#exit
%SYS-5-CONFIG_I: Configured from console by console

R2#

NOTE:Above static router is used to inform router R2 to deliver all traffic


for network 1.0.0.0 to its next hop 12.1.1.1.

STATIC ROUTE (3 ROUTERS)

DIAGRAM:

BASIC CONFIGURATION OF R1

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1

R1(config)#interface s0/0
R1(config-if)#ip address 30.1.1.2 255.0.0.0

R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0, changed state to up

R1(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up

R1(config-if)#exit

R1(config)#interface s0/1

R1(config-if)#ip address 10.1.1.1 255.0.0.0

R1(config-if)#clock rate 64000

R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/1, changed state to down

R1(config-if)#exit

R1(config)#interface f0/0

R1(config-if)#ip address 1.0.0.10 255.0.0.0

R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to


up

R1(config-if)#exit

R1(config)#exit

%SYS-5-CONFIG_I: Configured from console by console


R1#write

Destination filename [startup-config]?

Building configuration...

[OK]

R1#

BASIC CONFIGURATION OF R2

Router>enable

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R2

R2(config)#interface s0/1

R2(config-if)#ip address 10.1.1.2 255.0.0.0

R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/1, changed state to up

R2(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up

R2(config-if)#exit

R2(config)#interface s0/0

R2(config-if)#ip address 20.1.1.2 255.0.0.0

R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up


R2(config-if)#exit

R2(config)#interface f0/0

R2(config-if)#ip address 2.0.0.10 255.0.0.0

R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to


up

R2(config-if)#

R2(config-if)#exit

R2(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

R2#write

Destination filename [startup-config]?

Building configuration...

[OK]

R2#

BASIC CONFIGURATION OF R3

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R3

R3(config)#interface s0/0
R3(config-if)#ip address 30.1.1.1 255.0.0.0

R3(config-if)#clock rate 64000

R3(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0, changed state to down

R3(config-if)#exit

R3(config)#interface s0/1

R3(config-if)#ip address 20.1.1.1 255.0.0.0

R3(config-if)#clock rate 64000

R3(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/1, changed state to down

R3(config-if)#exit

R3(config)#interface f0/0

R3(config-if)#ip address 3.0.0.10 255.0.0.0

R3(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to


up

R3(config-if)#exit

R3(config)#

R3(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

R3#write
Destination filename [startup-config]?

ADDING STATIC ROUTE ON R1

R1(config)#ip route 3.0.0.0 255.0.0.0 30.1.1.1

R1(config)#ip route 2.0.0.0 255.0.0.0 10.1.1.2

ADDING STATIC ROUTE ON R2

R2(config)#ip route 1.0.0.0 255.0.0.0 10.1.1.1

R2(config)#ip route 3.0.0.0 255.0.0.0 20.1.1.1

ADDING STATIC ROUTE ON R3

R3(config)#ip route 1.0.0.0 255.0.0.0 30.1.1.2

R3(config)#ip route 2.0.0.0 255.0.0.0 20.1.1.2

R3(config)#

DYNAMIC ROUTING

USING RIP (ROUTING INFORMATION PROTOCOL)

DIAGRAM:
BASIC CONFIGURATION OF R1,R2.R3

Please apply complete configuration of routers R1,R2&R3 as defined in


previous exercise of routing.

CONFIGURING RIP ON R1

R1#conf t

R1(config)#router rip

R1(config-router)#network 30.0.0.0

R1(config-router)#network 10.0.0.0

R1(config-router)#network 1.0.0.0

R1(config-router)#exit

R1(config)#exit

R1#

Note. Remember that , when configuring the network address,RIP v1 uses


classfull addresses and RIP v2 uses classless addresses
All ip addresses have a network and host portion

CONFIGURING RIP ON R2

R2#conf t

R2(config)#router rip

R2(config-router)#network 10.0.0.0

R2(config-router)#network 2.0.0.0

R2(config-router)#network 20.0.0.0

R2(config-router)#exit

R2(config)#exit

R2#

CONFIGURING RIP ON R3

R3#conf t

R3(config)#router rip

R3(config-router)#network 3.0.0.0

R3(config-router)#network 30.0.0.0

R3(config-router)#network 20.0.0.0

R3(config-router)#exit

R3(config)#exit

R3#

DE – ADVERTISING A NETWORK

R3(config)#router rip

R3(config-router)#no network 3.0.0.0


R3(config-router)#end

R3#

HOW TO REMOVE RIP?

R1(config)#no router rip

R1(config)#exit

R1#

R2(config)#no router rip

R2(config)#exit

R2#

R3(config)#no router rip

R3(config)#exit

R3#

CONFIGURING RIPv2

DIAGRAM:
BASIC CONFIGURATION OF R1,R2,R3&R4

Same as defined in previous exercises

CONFIGURING RIPv2 ON R1

R1#configure terminal

R1(config)#router rip

R1(config-router)#version 2

R1(config-router)#network 12.0.0.0

R1(config-router)#network 1.0.0.0

R1(config-router)#end

R1#

CONFIGURING RIPv2 ON R2

R2#configure terminal

R2(config)#router rip

R2(config-router)#version 2
R2(config-router)#network 12.0.0.0

R2(config-router)#network 23.0.0.0

R2(config-router)#network 2.0.0.0

R2(config-router)#end

R2#

CONFIGURING RIPv2 ON R3

R3#configure terminal

R3(config)#router rip

R3(config-router)#version 2

R3(config-router)#network 23.0.0.0

R3(config-router)#network 34.0.0.0

R3(config-router)#network 3.0.0.0

R3(config-router)#end

R3#

CONFIGURING RIPv2 ON R4

R4#configure terminal

R4(config)#router rip

R4(config-router)#version 2

R4(config-router)#network 2.0.0.0

R4(config-router)#network 34.0.0.0

R4(config-router)#network 4.0.0.0

R4(config-router)#end
R4#

DISABLING AUTO-SUMMARY ON R1,R2,R3&R4

R1#configure terminal

R1(config)#router rip

R1(config-router)#no auto-summary

R1(config-router)#end

CONFIGURING IGRP

DIAGRAM:

BASIC CONFIGURATION OF R1&R2

Note:Same as defined in previous exercises

CONFIGURING IGRP ON R1

R1#configure terminal

R1(config)#router igrp 5

R1(config-router)#network 12.0.0.0

R1(config-router)#network 1.0.0.0
R1(config-router)#end

R1#

CONFIGURING IGRP ON R2

R2#configure terminal

R2(config)#router igrp 5

R2(config-router)#network 12.0.0.0

R2(config-router)#network 2.0.0.0

R2(config-router)#end

R2#

CONFIGURING EIGRP

DIAGRAM:

BASIC CONFIGURATION OF R1,R2&R3

Note:Same as defined in previous exercises.


CONFIGURING EIGRP ON R1

R1#configure terminal

R1(config)#router eigrp 2

R1(config-router)#network 12.0.0.0

R1(config-router)#network 13.0.0.0

R1(config-router)#network 1.0.0.0

R1(config-router)#end

R1#

CONFIGURING EIGRP ON R2

R2#configure terminal

R2(config)#router eigrp 2

R2(config-router)#network 12.0.0.0

R2(config-router)#network 23.0.0.0

R2(config-router)#network 2.0.0.0

R2(config-router)#end

R2#

CONFIGURING EIGRP ON R3

R3#configure terminal

R3(config)#router eigrp 2

R3(config-router)#network 13.0.0.0

R3(config-router)#network 23.0.0.0

R3(config-router)#network 3.0.0.0
R3(config-router)#end

R3#

SWITCHES

CHANGING HOSTNAME

To specify or modify the hostname for the switch,global configuration


command HOSTNAME is used.Hostname is case sensitive.The hostname is
used in prompts and default configuration filenames.The factory assigned
default host name Switch.
Switch>enable

Switch#configure terminal
Switch(config)#hostname SW-1
SW-1(config)#exit
SW-1#write
Note:Write is used to save the configuration.Complete command is WRITE
TERMINAL
DISPLAYING RUNNING-CONFIGURATION
SW-1>enable
SW-1#show running-config

LINE CONSOLE PASSWORD


SW-1>enable
SW-1#configure terminal
SW-1(config)#line console 0
SW-1(config-line)#password 1234
SW-1(config-line)#exit
SW-1(config)#exit
SW-1#
PASSWORD FOR PRIVILEGED MODE
SW-1#configure terminal
SW-1(config)#enable password corvit123
SW-1(config)#exit
SW-1#
VERIFICATION
SW-1#exit
SW- con0 is now available
Press RETURN to get started
User Access Verification
Password:corvit
SW-1>enable
Password:corvit123
SW-1#
SECRET (ENCRYPTED) PASSWORD FOR PRIVILEGED MODE
SW-1#configure terminal
SW-1(config)#enable secret pakistan
SW-1(config)#exit
SW-1#disable
SW-1>enable
Password:pakistan
SW-1#
REMOVING LINE CONSOLE PASSWORD
SW-1#configure terminal
SW-1(config)#line console 0
SW-1(config-line)#no password
SW-1(config-line)#no login
SW-1(config-line)#end
SW-1#
REMOVING PASSWORD FOR PRIVILEGED EXEC MODE
SW-1>enable
SW-1#configure terminal
SW-1(config)#no enable password
SW-1(config)#exit
SW-1#disable
SW-1>enable
SW-1#
REMOVING SECRET PASSWORD
SW-1>enable
SW-1#configure terminal
SW-1(config)#no enable secret
SW-1(config)#exit
SW-1#disable
SW-1>enable
SW-1#
CHECKING SYSTEM FLASH
SW-1#show flash
CONFIGURING SPEED OF AN INTERFACE
SW-1#configure terminal
SW-1(config)#interface f0/0
SW-1(config-if)#speed 100
SW-1(config-if)#exit
SW-1(config)#

CONFIGURING SPEED OF AN INTERFACE

SW-1#configure terminal

SW-1(config)#interface f0/0

SW-1(config-if)#speed 100

SW-1(config-if)exit

SW-1(config)#

COFIGURING MODE OF AN INTERFACE


SW-1(config)#interface f0/0
SW-1(config-if)#duplex full
SW-1(config-if)#exit
SW-1(config)#
Note :in communication, point to point channels are either full duplex or
half duplex .In full duplex,both ends can transmit at the same time.In half
duplex,only one end can transmit at a time.Half duplex has advantages in
saving bandwidth for mobile networks.
VLANs( Virtual LANs)
Virtual LAN (VLAN) refers to a group of logically networked device on one
or more LANs that are configuring so that they can communicate as if they
were attached to the same wire, when infact they are located on a number
of different LAN segments. Because VLANs are based on logical instead of
physical connections, it is very flexible for user/host management
,bandwidth allocation and resource optimization.
There are following types of Virtual LANs:
1.Port based VLANs:Each physical port is configured with an access list
specifying membership in a set of VLANs.
2.MAC based VLANs:A switch is configured with an access list mapping
individual MAC addresses to VLAN membership.
3.Protocol based VLANs:A switch is configured with a list of mapping layer
3 protocol types to VLANs membership-thereby filtering IP traffic from
nearby end-stations using a particular protocol such as IPx.
4.ATM VLAN:Using LAN Emulation (LANE) Protocol to map Ethernet
packets into ATM cells and deliver them to their destination by converting
an Ethernet MAC address into an ATM address.

DEFAULT VLANs OF A SWITCH

SW-1#show vlan

CREATING VLANs

SW-1#configure terminal

SW-1(config)#vlan 3

vtp VLAN configuration not allowed when device is in CLIENT mode.

SW-1(config)#vtp mode server

SW-1(config)#vlan 3

SW-1(config-vlan)#name MARKETING

SW-1(config-vlan)#end
SW-1#

VERIFICATION OF VLANS

SW-1#show vlan brief

DELETING VLANs

SW-1#config terminal

SW-1(config)#no vlans 64

SW-1(config)#no VLANs 21-22

Вам также может понравиться