0% found this document useful (0 votes)
2 views54 pages

CCNA Khaled Marzouk

The document provides a comprehensive guide on various router and switch commands, including how to display configurations, set IP addresses, manage passwords, and configure routing protocols such as RIP and OSPF. It also covers Access Control Lists (ACLs), software recovery procedures, VLAN management, and Network Address Translation (NAT). Additionally, it includes command syntax and examples for effective network management and troubleshooting.

Uploaded by

mno.gaxon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
2 views54 pages

CCNA Khaled Marzouk

The document provides a comprehensive guide on various router and switch commands, including how to display configurations, set IP addresses, manage passwords, and configure routing protocols such as RIP and OSPF. It also covers Access Control Lists (ACLs), software recovery procedures, VLAN management, and Network Address Translation (NAT). Additionally, it includes command syntax and examples for effective network management and troubleshooting.

Uploaded by

mno.gaxon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 54

Show command

Router # show running-config (to show running configuration file)


Router # show startup-config (to show startup configuration file [NVRAM])
Router # show flash (to show the content of the flash memory)
Router # show history (to show the last 10 commands wrote on the router)
Router # show version
show version
- To display the version of the IOS.
- To display the name of IOS file name Ex :( System image file is "flash:c2600-bin-mz.122-13.T1.bin")
- Tell us about the router (How many serial, Ethernet, RAM, Flash, NVRAM, ……..)
- Show configuration register (OX 2102) [default case]
(OX 2142) [By pass the contents of NVRAM]
Password‫وهذا يستخدم في كسر ال‬,‫ ويرجعه إلى حالته اﻷولية‬router‫ده يلغي كل التعديﻼت على ال‬
---------------------------------------------------------------------------------------------------------------
Setting IP on specific interface
Router (config) # interface (fastethernet 0/0)or(serial 0/0)
Router (config-if) # IP address …………IP Subnet mask
…………………
Router (config-if) # no shutdown.
Router (config-if) # no IP address. (To cancel the IP)
Router (config-if) # clock rate 64000 ( to configure the clock rate on the DCE )
Router # show controller S 0 (to know if it’s DTE or DCE )
---------------------------------------------------------------------------------------------------------------
Setting Password
1) Set password to privilege mode.
Router (config) # enable password <password>
Router (config) # enable secret <password>
To make the password encrypted.
Override the password command.
2) Set a password to Line.
2-1)consol port.
Router (config) # line con 0
Router (config – line) # password <password>
Router (config – line) # login (to active the command)
2-2)telneting of the router.
Router (config) # line vty 0 4
Router (config – line) # password <password>
Router (config – line) # login (to active the command)
2-3)auxiliary port.
Router (config) # line aux. 0
Router(config-line) # password <password>
Router(config-line) # login (to active the command)
Router(config)# service password-encryption.(To encrypt the password of consol,aux.and vty,..)
Router # Copy Running-configuration startup-configuration (to save from RAM to NVRAM)
-1-
Routing
Router # show IP route ( to show the routing table )
Router # show IP protocols ( to show protocols )
1) Static routing Protocol:
1.1) Direct connected (automatic without configuration)
1.2) Manual routing (manually configuration)
1.2.1) Normal routing:
Router(config)#ip route Dest. Network add. Subnet mask [next-hop-IP | outgoing interface]
☺Router(config)#ip route 192.168.10.0 255.255.255.0 172.16.4.1 or serial0/0
1.2.2) Default routing:
Router(config)#ip route 0.0.0.0 0.0.0.0 [next-hop-IP | outgoing interface]
☺Router(config)#ip route 0.0.0.0 0.0.0.0 172.16.4.1 or serial0/0
******************************
2)Dynamic routing Protocol:
2-1)Distance Vector ) RIP
R1 (config) # router RIP
R1 (config-router) # network Direct connected network address
☺R1 (config) # router RIP
☺R1 (config-router) # network 192.168.10.0
☺R1 (config-router) # network 192.168.11.0
Router(config- router) # version 2 [to use (RIP)v2 in this condition we can write the sub netting]
Router # debug IP RIP ( to show what happens ).
Router # terminal monitor ( to show what happens on the telnet ).
Router # U all ( to stop the debugging ).
Router # debug IP EIGRP transactions (this command if we are on consol port for
monitoring)
Router # terminal monitor (this command plus the later command write if we are on telnet)

2-2)Link state routing protocol:-


2-2-1)OSPF (Open shortest path first)
R1 ( config )#Router OSPF (Press ID : Local significant ( 1 : 65535 ))
R1 (config–router)#network network IP Wild card mask(inverted of subnet mask) Area AreaID
☺Router ( config ) # Router OSPF 5
☺Router ( config – router ) # network 192.168.1.0 0.0.0.255 Area 0
☺Router ( config – router ) # network 192.168.10.0 0.0.0.255 Area 0
Router (config) # interface fastEthernet 0/0
Router (config-if) # IP OSPF priority 0 : 255( to change the priority ).
Router#show ip route ospf [Displays all OSPF routes learned by the router]
Router#show ip ospf interface [Displays the OSPF router ID, area ID and display state DR or BDR)]
-2-
Router# show ip ospf [Displays the OSPF router ID, timers, and statistics]
Router#show ip ospf neighbor [detail] [Displays information about the OSPF neighbors, including
Designated Router (DR) and Backup Designated Router (BDR) information on broadcast networks]

2-3)Advanced Distance Vector


2-3-1) EIGRP (Enhanced Interior gateway routing protocol)
Router (config) # router EIGRP (As number 1 to 65535 )
Router ( config-router ) # network Direct connected network IP
☺ R1 (config) # router EGRP 50
☺ R1 (config-router) # network 192.168.10.0
☺R1 (config-router) # network 192.168.11.0
Router # show IP eigrp neighbors ( to display neighbors )
Router # show IP eigrp topology ( to display S & FS of topology table )
Router ( config-router ) # no auto-summary ( to make it classless )
---------------------------------------------------------------------------------------------------------------
Access Control List (ACL)
Router # show IP interface ( to display the placement and direction of Access list )
Router # show IP Access list ( to show statement of Access-list ).
[host = 0.0.0.0] & [ANY = 0.0.0.0 255.255.255.255]
[ 0's : Exact match ] [1's : don't care]
1) Numbered ALC:
1-1) Standard numbered ACL :
For creation
Router ( config ) # Access-list { 1 : 99 } { permit / deny } Src. IP Wild card mask
For applay
Router (config) # interface serial 0
Router (config-if) # IP access-group { 1 : 99 } {in / out } .
☺Router (config)#Access-list 5 permit 192.168.33.1 0.0.0.0
☺Router (config) # interface serial 0
☺Router (config-if) # IP access-group 5 in

1-2) Extended numbered ACL :


For creation TCP UDP IP
Router(config)#Access-list { 100 : 199 } {permit/deny} TCP/IP
…………..protocol ……..
Src IP Src…………...
wild card mask

….…
Dest IP ………….……
dest wild card mask [operator+ src protocol information ] eq = equal
Lt = less than
For applay gt = greater than
-3-
Router (config) # interface serial 0
Router (config-if) # IP access-group { 1 : 99 } {in / out } .
☺Router(config)#Access-list 165 deny TCP host 192.168.5.1 host 192.168.1.1 eq 23
Router(config)#Access-list 165 permit IP any any [any any = 0.0.0.0 255.255.255.255 0.0.0.0 255.255.255.255]
☺Router (config) # interface FastEthernet 0/0
☺Router (config-if) # IP access-group 165 in
2) Named ACL:
Router(config)# IP Access-list { standard / extended } ACL name
2-1)standard:
For creation
Router(config-std-nacl)# { permit / deny} src IP Wild card mask
S
For applay
Router (config) # interface serial 0
Router (config-if) # IP access-group { ACL name} {in / out } .
☺Router(config)# IP Access-list standard Bassem
☺Router(config-std-nacl)# permit TCP host 192.168.1.0
☺Router(config-std-nacl)# permit IP any
☺Router(config) # interface Serial 0/0
☺Router (config-if) # IP access-group Bassem out
2-2)extended:
For creation rc IP
Router(config-ext-nacl)# { permit / deny} TCP / IP protocol Src IP Src wild card mask
Dest IP Dest wild card mask [operator+Dest protocol information]

eq = equal
Lt = less than
gt = greater than
For applay
Router (config) # interface serial 0
Router (config-if) # IP access-group { ACL name} {in / out } .
☺Router(config)# IP Access-list extended Bassem
Telnet or
☺Router(config-ext-nacl)# deny TCP 192.168.1.0 0.0.0.255 host 192.168.13.1 eq 23
☺Router(config-ext-nacl)# permit IP any any
☺Router(config) # interface Fastethernet 0/0
☺Router (config-if) # IP access-group Bassem in

To Software Recovery
1) Backup Software
Router # Copy flash TFTP [To Backup IOS]
Router # Copy startup-configuration TFTP [To Backup configuration]
2) Restore Software
Router # Copy TFTP startup-configuration [To Upgrade]
-4-
Router # Copy TFTP flash
Romman > TFTP dnld [to get IOS from TFTP server ,To recover IOS]
---------------------------------------------------------------------------------------------------------------
Other
(*): help features for IOS.
(?): help for all commands available of this mode.
Command? : Text help describing all the 1st parameter obtains of the command.
Router # show users number
Router (config) #clear line ……….. (After sh Users to know the number front of IP of the PC)
Router (config) # line con 0
Router (config-line) # logging synchronous (to write the command in one line after ctrl+z)
☺Router (config) # banner motd *…………..* message (to make message of the day)
A message-of-the-day (MOTD) banner can be displayed on all connected terminals.
Router # show IP int br ( to display the status of the interfaces ).
Up arrow ( ): recall the previous command = (ctrl + p).
Right arrow ( ): move the cursor forward in the current display command without deleting = (ctrl + F).
Left arrow ( ): move the cursor back in the current display command without deleting = (ctrl + b).
(Ctrl +a): to stop in the beginning of the line.
Router (config) # no IP domain-look up (to stop the domain search )
How do you assign Logical interface for specific interface
 Router (config) # interface loopback 0
 Router (config-if) # IP address IP Subnet mask

Switching
Switch # show MAC-address-table ( to display the MAC address table )
STP
Switch # show spanning-tree (to display root ID & bridge ID and status of ports RP, DP)

-5-
VLAN
Switch # show VLAN brief ( to display VLANs )
A) On switch:
1)To Add VLANs in VLAN Database Mode
Switch#vlan database
Switch(vlan)#vlan 3 name Vlan3
1')To Delete VLANs in VLAN Database Mode
Switch#vlan database
Switch(vlan)#no vlan 3
1)To modify VLANs in Global Mode
Switch#configure terminal
Switch(config)#vlan 3
Switch(config-vlan)#name Vlan3
1')To Delete VLANs in Global Mode
Switch#configure terminal
Switch(config)#no vlan 3
2)To assigning the Ports type in VLAN
Switch (config) # interface fastethernet 0/1
Switch (config-if) # switchport mode (access or trunk) ( to make access or trunk port )
Switch (config-if) # switchport (access or trunk) vlan 3
3)To make the trunking
Switch (config-if)# switchport encapsulation (ISL or dot1Q)
4)To configure VTP
Switch#show VTP status (to show status of VTP server /client /transparent)
name
Switch (config) # VTP domain ………………… ( to change the name of the domain )
server / client / transparent
Switch (config) # VTP mode …………..……………… ( state a mode )
*To put IP for VLAN
Switch (config) # interfacc VLAN 1
IP Subnet mask
Switch (config-if) # IP address …………… …………………
Switch (config-if) no shutdown
*To can telnet on switch remotely
IP of the interface which is connected to
-6-
Switch(config)#IP default-gateway …………………………………….. (to set default gateway to switch)

Note :- you need a router to connect different VLANs.


B) On router :
Router (config)# interface fastethernet 0/0
Router (config-if) # no IP address
Router (config-if) # no shutdown
Router (config) # int fa 0.1
VLAN number
Router (config-subif) # encapsulation (ISL or dot1Q) …………………….
IP Subnet mask
Router (config-subif) # IP address ………. ……………………
I put IP address to the sub interface in the network of the VLAN network which connects to it.

WAN
NAT
Router # show IP NAT translations ( to display who uses the NAT )

Inside Outside
(1) (2)

(1) Router (config-if ) # IP NAT inside (2) Router (config-if ) # IP NAT outside
1- Static :
Router (config) # IP NAT inside source static Local(privet) IP
….…………… Global(real) IP
……………..
2- Dynamic :
Name of pool Start IP ………
End IP netmask …………….
Subnet mask
Router (config) # IP NAT pool …………… ………
0 : 99 permit …………
Router (config) # Access-list ……… Src. Wild card mask
Src. IP [ ………………….]
0 : 99 Name
Router (config) # IP NAT inside source list ……. Pool ………………
3- PAT :
Name of pool Start IP ………
End IP netmask …………….
Subnet mask
Router (config) # IP NAT pool …………… ………
0 : 99 permit …………
Router (config) # Access-list ……… Src. Wild card mask
Src. IP [ ………………….]

Name
Router (config) # IP NAT inside source list ……. Pool ……………… Overload

-7-
-8-

You might also like