[go: up one dir, main page]

0% found this document useful (0 votes)
122 views21 pages

Basic Configuration of Router and Switch

The document provides instructions for basic router and switch configuration including: - Changing the hostname and assigning IP addresses - Configuring enable passwords and telnet access - Copying IOS images to and from a TFTP server - Configuring routing protocols like RIP, OSPF, and EIGRP to populate routing tables - Configuring VLANs on a switch

Uploaded by

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

Basic Configuration of Router and Switch

The document provides instructions for basic router and switch configuration including: - Changing the hostname and assigning IP addresses - Configuring enable passwords and telnet access - Copying IOS images to and from a TFTP server - Configuring routing protocols like RIP, OSPF, and EIGRP to populate routing tables - Configuring VLANs on a switch

Uploaded by

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

Basic Configuration of Router

and Switch

Qno.1: How to Change Host name ?


Ans:
Router> enable
Router# config t
Router(config)# Hostname Karachi

Qno.2: How to apply enable password ?


Ans:
Enable Plain Text Password:
Karachi> enable
Karachi# config t
Karachi(config)# enable password cisco
Enable Secret Password:
Karachi> en
Karachi# config t
Enter configuration commands, one per line. End with CNTL/Z.
Karachi(config)#enable secret huawei

Qno.3: How to assign IP address ?


Ans:
Karachi> en
Karachi# config t
Karachi(config)# int gig 0/0
Karachi(config-if)# ip add 192.168.1.1 255.255.255.0
Qno.4: How to telnet to another router ?
Ans:

Faisalabad Router:
Faisalabad>en
Faisalabad #config t
Faisalabad (config)#int se 0/3/0
Faisalabad (config-if)#ip add 192.168.1.1 255.255.255.0
Faisalabad (config-if)#no sh

Karachi Router:

Karachi>en
Karachi #config t
Karachi (config)#int se 0/3/0
Karachi (config-if)#ip add 192.168.1.2 255.255.255.0
Karachi (config-if)#no sh

How to enable Telnet on Karachi router so that Faisalabad router


can telnet to Karachi router ?

Karachi Router:
Karachi (config)#line vty 0 4
Karachi (config-line)#password cisco
Karachi (config-line)#login
Karachi (config-line)#exit
Karachi (config)#enable password huawei
Now from Faisalabad Router we can telnet Karachi Router …..

Faisalabad:
Faisalabad# telnet 192.168.1.2
Trying 192.168.1.2 ...Open

User Access Verification

Password:
Karachi>en
Password:
Karachi# config t
Karachi(config)#

If you want that you can also telnet to Faisalabad Router then enable telnet to
Faisalabad router …..

Qno.5: How to copy IOS from flash to TFTP server ?


Ans:
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa 0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#no sh
Router(config-if)#exit
Router(config)#exit
Router # sh flash
Copy the image name …. !!!!!!!! e.g pt1000-i-mz.122-28.bin
Router# copy flash tftp
Source filename []? pt1000-i-mz.122-28.bin
Address or name of remote host []? 192.168.1.2
Destination filename [pt1000-i-mz.122-28.bin]? umar.bin
Writing pt1000-i-mz.122-
28.bin....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!
[OK - 5571584 bytes]

Qno.6: How to copy IOS from TFTP to Flash server ?


Ans:
Same topology for this lab as previous and IP addresses……
Router>en
Router# copy tftp flash
Address or name of remote host []? 192.168.1.2
Source filename []? umar.bin
Destination filename [umar.bin]?

Accessing tftp://192.168.1.2/umar.bin...
Loading umar.bin from
192.168.1.2: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 5571584 bytes]
Now if you see flash than you will see two images….

Router# sh flash

System flash directory:


File Length Name/status
3 5571584 pt1000-i-mz.122-28.bin
2 28282 sigdef-category.xml
1 227537 sigdef-default.xml
4 5571584 umar.bin
[11398987 bytes used, 52617397 available, 64016384 total]
63488K bytes of processor board System flash (Read/Write)

Qno.7: How to boot Router with umar.bin ?


Ans:
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#boot system flash umar.bin

Qno.8: Change the Cisco Default Encapsulation to PPP


Encapsulation ?
Ans:
Faisalabad:
Faisalabad# config t
Faisalabad(config)#int se 0/3/0
Faisalabad(config-if)#encapsulation ppp

Karachi:

karachi# config t
karachi(config)#int se 0/3/0
karachi(config-if)#encapsulation ppp
How to check encapsulation :

karachi#sh int se 0/3/0

Qno.8: How to complete routing table using RIP(Routing


Information Protocol) ?
Ans:
R1:
Assign IP address to se 0/2/0 of R1:
R1>ena
R1#config t
R1(config)#int se 0/2/0
R1(config-if)#ip add 1.1.1.1 255.0.0.0
R1(config-if)#no sh

Assign IP address to gig 0/0 of R1:


R1(config-if)#int gig 0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh

R2:
Assign IP address to se 0/2/0 of R2:
R2>ena
R2#config t
R2(config)#int se 0/2/0
R2(config-if)#ip add 1.1.1.2 255.0.0.0
R2(config-if)#no sh

Assign IP address to gig 0/0 of R2:


R2(config-if)#int gig 0/0
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#no sh

How to advertise network in RIP:


Advertise all directly connected network in Rip.
Means advertise all the entries that comes with “C” i.e.
C - 1.0.0.0/8 is directly connected, Serial0/2/0

To show directly connected network , issue a command “Show ip route connected”

R1:

R1>en
R1#show ip route connected
C - 1.0.0.0/8 is directly connected, Serial0/2/0
C - 192.168.1.0/24 is directly connected, GigabitEthernet0/0

R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router rip
R1(config-router)#network 1.0.0.0
R1(config-router)#net 192.168.1.0

So in this case , I have two directly network 1.0.0.0 and 192.168.1.0


So I advertise these two network in RIP.

R2:
R2>ena
R2#show ip route connected

C 1.0.0.0/8 is directly connected, Serial0/2/0


C 192.168.2.0/24 is directly connected, GigabitEthernet0/0

R2#config t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router rip
R2(config-router)#network 1.0.0.0
R2(config-router)#network 192.168.2.0
So in this case , I have two directly network 1.0.0.0 and 192.168.2.0
So I advertise these two network in RIP.
Now if you apply an command Show ip route
There is a new route that entry comes with “R”

Verify by issuing a ping from pc1 to pc4.

Qno.9: How to complete routing table using OSPF(Open


shortest path first) ?

R1:
Assign IP address to se 0/2/0 of R1:
R1>ena
R1#config t
R1(config)#int se 0/2/0
R1(config-if)#ip add 1.1.1.1 255.0.0.0
R1(config-if)#no sh

Assign IP address to gig 0/0 of R1:


R1(config-if)#int gig 0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh

R2:
Assign IP address to se 0/2/0 of R2:
R2>ena
R2#config t
R2(config)#int se 0/2/0
R2(config-if)#ip add 1.1.1.2 255.0.0.0
R2(config-if)#no sh

Assign IP address to gig 0/0 of R2:


R2(config-if)#int gig 0/0
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#no sh

R1:
How to advertise network in ospf (Single Area)
R1#show ip route connected
C 1.0.0.0/8 is directly connected, Serial0/2/0
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0

R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router ospf 10
R1(config-router)#network 1.0.0.0 0.255.255.255 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0

Wildcard mask is reciprocal of Subnet mask.


For example:
Subnet mask of class A is : 255.0.0.0
So ,
Replace all 0’s with 1
And all 1’s with 0
In short , replace 255 with 0 and 0 with 255.

R2:
R2#show ip route connected
C 1.0.0.0/8 is directly connected, Serial0/2/0
C 192.168.2.0/24 is directly connected, GigabitEthernet0/0

R2#config t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 10
R2(config-router)#network 1.0.0.0 0.255.255.255 area 0
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0

Verify your ping from PC-1 to PC-4

In multi-Area , it is necessary to configure at least one Area 0.


Suppose if you have three routers then configured Area 0 on Router 2.

If you have 8 Routers and Area 0 is Configured on Router 2 then you have to
creates Virtual links.
Now if you apply an command Show ip route
There is a new route that entry comes with “O”
Qno.10: How to complete routing table using
EIGRP(Enhanced interior gateway routing protocol) ?

Assign IP address to se 0/2/0 of R1:


R1>ena
R1#config t
R1(config)#int se 0/2/0
R1(config-if)#ip add 1.1.1.1 255.0.0.0
R1(config-if)#no sh

Assign IP address to gig 0/0 of R1:


R1(config-if)#int gig 0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh

R2:
Assign IP address to se 0/2/0 of R2:
R2>ena
R2#config t
R2(config)#int se 0/2/0
R2(config-if)#ip add 1.1.1.2 255.0.0.0
R2(config-if)#no sh

Assign IP address to gig 0/0 of R2:


R2(config-if)#int gig 0/0
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#no sh

R1:
How to advertise network in EIGRP.
R1>ena
R1#show ip route connected
C 1.0.0.0/8 is directly connected, Serial0/2/0
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0

R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router eigrp 20
R1(config-router)#net 1.0.0.0 0.255.255.255
R1(config-router)#net 192.168.1.0 0.0.0.255

R2:
R2>ena
R2#show ip route connected
C 1.0.0.0/8 is directly connected, Serial0/2/0
C 192.168.2.0/24 is directly connected, GigabitEthernet0/0

R2#config t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router eigrp 20
R2(config-router)#net 1.0.0.0 0.255.255.255
R2(config-router)#net 192.168.2.0 0.0.0255

Verify you work by issuing a ping from PC-1 to PC-4

Now if you apply an command Show ip route


There is a new route that entry comes with “D”
Qno11: Configure VLANs in Network.

Ans:
By default , there are 5 vlans in switch
Vlan # 1 , 1002 , 1003 , 1004 and 1005
How to show vlan
SW-A>ena
SW-A#show vlan brief

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
How to create vlan:
SW-A#config t
Enter configuration commands, one per line. End with CNTL/Z.
SW-A(config)#vlan 10
SW-A(config-vlan)#name IT
SW-A(config-vlan)#vlan 11
SW-A(config-vlan)#name HR
Now , if you apply a command Show vlan brief
There are 7 vlans i.e. Vlan # 1 , 10 , 11 , 1002 , 1003 , 1004 , 1005
SW-A# Show vlan brief

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
10 IT
11 HR
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

How to assign port to vlan :


SW-A#config t
Enter configuration commands, one per line. End with CNTL/Z.
SW-A(config)#int fa 0/2
SW-A(config-if)#switchport mode access
SW-A(config-if)#switchport access vlan 10

Now apply command “Show vlan brief”


VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
10 IT Fa0/2
11 HR
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

SW-B:

SW-B>ena
SW-B#config t
Enter configuration commands, one per line. End with CNTL/Z.
SW-B(config)#vlan 10
SW-B(config-vlan)#Name IT
SW-B(config-vlan)#vlan 11
SW-B(config-vlan)#Name HR
SW-B(config-vlan)#exi
SW-B(config)#int fa 0/3
SW-B(config-if)#switchport mode access
SW-B(config-if)#switchport access vlan 11
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
10 IT Fa0/2
11 HR Fa0/3
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
SW-C:
SW-C>ena
SW-C#config t
Enter configuration commands, one per line. End with CNTL/Z.
SW-C(config)#vlan 10
SW-C(config-vlan)#name IT
SW-C(config-vlan)#vlan 11
SW-C(config-vlan)#name HR
SW-C(config-vlan)#int fa 0/4
SW-C(config-if)#switchport mode access
SW-C(config-if)#switchport access vlan 10

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
1 default active Fa0/1
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
10 IT Fa0/2,Fa0/4
11 HR Fa0/3
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

Result:
1. PC-1 can ping PC-3
2. PC-1 can’t ping PC-2
3. PC-2 can’t ping PC-1 and PC-2
4. PC-3 can ping PC-1
5. PC-3 can’t ping PC-2

You might also like