cisco reference guide€¦ · in a network topology, the router is at the top. the router is the...
TRANSCRIPT
Cisco Reference
Guide
By Frank Hall
By Frank Hall
Table of Contents
NETWORKING: THE BASICS ............................................ 4
THE OPEN SYSTEM INTERCONNECTION (OSI) MODEL ..... 5
DEVICES ......................................................................... 6
THE HUB ......................................................................... 6
SWITCHES ...................................................................... 6
ROUTERS ........................................................................ 7
NETWORKING: CABLES ................................................... 8
CABLE TYPES ................................................................. 8
NETWORKING: CABLING CONFIGURATION FOR CONNECTING NETWORK
DEVICES ......................................................................... 9
STRAIGHT THROUGH VS. CROSSOVER ......................... 10
NETWORKING: THE BASICS SUMMARY ......................... 10
SUBNETTING FINDING HOSTS AND SUBNETS ................ 11
SO WHAT ARE HOSTS AND SUBNETS? .......................... 11
By Frank Hall
SUBNET ADDRESS: HOW ARE THEY CONSTRUCTED? ... 11
IP ADDRESSES: THE DIVIDE BETWEEN HOSTS AND SUBNETS 12
FINDING THE SUBNETS: THE MATH PART ..................... 14
FINDING THE HOSTS PER SUBNET: THE MATH PART .... 14
SUBNETTING: SUMMARY ............................................... 16
CISCO COMMANDS ........................................................ 17
CREATE VLAN ON CISCO SWITCH ................................. 26
NETWORKING CHEAT SHEETS ...................................... 29
IPV4 SUBNETTING LONG SHEET ................................... 31
IPV6 LONG SHEET ........................................................ 32
COMMON COMMUNICATION PORTS .............................. 34
PHYSICAL TERMINATORS ............................................. 36
By Frank Hall
Networking: The Basics
In this lesson we are going to cover the very basics of computer networking. This is the bare
essentials you need to know before moving on to Cisco networking. This will cover the
different types of cables, cable types, interconnecting Cisco network devices and finally the
OSI model.
By Frank Hall
The Open System Interconnection (OSI) model
The Open System Interconnection (OSI) model defines the network process function. This
includes components of networking and data transmission. When you understand how the
OSI Model works you will understand how everything can communicate in a network. The
table below depicts the seven layers and what each layer does.
Devices
The Hub A hub is the dumbest network device. It does not have any memory. It is not
configurable. Most importantly is does not route. All a hub does is connect two or more
computers, receives a transmission signal, amplifies the signal, and sends to every
By Frank Hall
computer on the hub. Unlike a switch or router when a hub transmits a signal it goes out
every port, or what is called multicast.
Switches Switches are more intelligent than a hub and is used to connect multiple devices on the
same network. Unlike a hub, a switch has memory that can store configurations. The
network switch handles packets of data differently than a hub, sending specific data to the
computer it is sending the data.
By Frank Hall
Routers
In a network topology, the router is at the top. The router is the most intelligent networking
device. A router is more intelligent than hubs and switches because it has memory, security,
maintains routing information, and is configurable. A router transmits data from one
computer network to another. Unlike switches and hubs, the router routes packages to the
network along with local computers. It is used to communicate through networks. All
connections go to the router.
By Frank Hall
Networking: Cables
Cable Types There are many types of cables that are used for networking computers and network
devices together. The three most common cables that are used today are CAT-5/CAT-5e,
CAT-6, and Fiber Optic. The cable type we will be using is CAT-5 and the configurations of
this cable that are used on the hubs, switches and routers.
1 - CAT-5/CAT-5e
2 CAT-5 Cable is a twisted pair cable that used for a structured computer networks. There are eight twisted
pairs of copper wiring in a CAT-5 Cable. The twisting of the cables reduces the electrical interference and
crosstalk between the cables. CAT-5 supports 10Base-T, 100Base-T, and 1000Base-T transfer rate speed.
By Frank Hall
3 - CAT-6
CAT-6 Cable is very similar to CAT-5 in appearance but the difference is how the cable handles higher transfer
rates. CAT-6 uses all four twisted pairs and supports up to 1 Gb per second. It also has additional shielding
which reduces crosstalk more than CAT-5 cable.
4 - Fiber Optic
Fiber Optic cable contains glass tubes wrapped in insulated casing and is designed for transfer speeds of
100Mbps and higher. It uses pulsating light to carry the data. Since fiber uses glass tubes and light it is less
susceptible to electrical inference and crosstalk.
Illustrations are from Verizon.com, pakistanstuff.com, citrusmicro.com
By Frank Hall
Networking: Cabling configuration for connecting network devices There are two ways to configure your CAT-5 Cable for connecting them to computers and
network devices. These two configurations are called Straight Through and Crossover. The
terms straight through and crossover refer to how the cables are arranged in the connector.
4 - A Straight through Cable is arranged the same at both ends of the cable.
5 - A Crossover Cable is similar but the transmit(TX) and receive(RX) lines are in opposite positions at the ends of the
cable.
Straight Through vs. Crossover When connecting network devices, the rule is “Same device uses a crossover. Different
device used a straight through.” As seen in these two diagrams.
By Frank Hall
Now that you know how to network devices with the correct cables this will ensure data
flow, network availability, and security are maintained at a constant rate. Know how each
cable is constructed and which device it connects to will increase in your troubleshooting
abilities.
When connecting network devices, the rule is “Same device uses a crossover. Different
device used a straight through.” As seen in these two diagrams.
Networking: The Basics summary This concludes my class on Networking the basics you need to know. You have learned
about the OSI Model, the seven layers and how data flow works according the OSI Model.
You know have the knowledge of the different network devices and how they affect data
flow on a network. Finally, you have learned about network cables, how they are
constructed, how straight through and crossover cables are constructed, and which
network device is connected using either a straight through or crossover cables.
Subnetting Finding Hosts and subnets
Knowing how to subnet a very important part of creating a computer network. You must
know how to divide your IP addresses among your routers, switches and workstations. This
is to use all your IP addresses efficiently and to ensure your network operates with as few
problems as possible. When you are creating your network you must determine the
number of hosts and subnets that will need to be used.
By Frank Hall
So what are Hosts and Subnets?
A Host in relationship to a network is a computer/device that connectivity to your network
and is able to communicate with other computer and devices. A host address is used to
identify a device that is on the network. When this host address is combined with a
network address a 32 bit IP address is created.
A Subnet or subnetwork is a subdivision of your IP network. Subnetting allows you to create
multiple logical networks that exist within a single Class A, B, or C network. If you do not
subnet, you are only able to use one network from your Class A, B, or C network, which is
unrealistic.
Subnet Address: How are they constructed?
An IPv4 address is made up of 8 bits. These 8 bits are arranged into octets. When you have
4 octets you have a full 32bit IPv4 IP address as the illustration below has displayed. Each
byte in the octet has a
place value that from 128-1. How do we get to 128 from 1? That is simple each place value
is doubled. That is to say (1+1=2, 2+2=4, 4+4=8, etc. To 128). When the IP address is
displayed in binary, as seen below, when the bit is used it is marked with a one (1). If the bit
is not needed or used it will be marked with a zero (0).
In order to figure out which octet is valued at all you need to do is to add up the place
holders that are marked with a one (1) meaning this bit is being used. As seen in the display
below in the first three octets if you add 128+64+32+16+8+4+2+1 = 255. This also indicates
that all the bits are being used in this octet. Now in the fourth octet when we add the bits
that are on which are 128+64+32+16 = 240. The subnet IP address is 255.255.255.240.
By Frank Hall
IP Addresses: The divide between Hosts and Subnets
The number of hosts or subnets depends on the Class of network. For instance, a Class
"A" network requires more hosts then subnets. A Class "C" network requires more
subnets. When determining how many hosts and subnets are needed always remember
the hosts you need the less subnets you have. The more subnets that are needed the less
hosts you have to use in your network.
The chart displays the subnet for each network class. As describes to you in the previous slide the Class "A"
network has the least number of network/subnets and the most hosts. While the Class “C" has the most
networks/subnets and the least number of hosts.
By Frank Hall
Finding the Subnets: The Math Part
When you are determining the number of subnets that are need for your network the
formula that is used is 2^n (n=number of borrowed bits from the host). No in the diagram
below we have the last two octets of out IP address displayed in the actual number and in
binary. When you apply the formula 2^n what you are calculating is the number of bits
that are being used or marked as one “1”. So our formula is 24 or 2x2x2x2 = 16. So the
number of subnets is 16.
By Frank Hall
Finding the Hosts per Subnet: The Math Part When you are determining the number of hosts per subnet that are need for your
network the formula that is used is 2^n -2 (n= number of bits in the host portion. Then we
subtract 2). In the diagram below we have the last two octets of our subnet address
displayed in the actual number and in binary. When you apply the formula 2^n -2 what
you are calculating is the number of bits that are not being used or marked as zero “0”
from the host bits. You must subtract 2 because an address consisting of all 0 bits
specifies the network, and an address of all 1 bits is used for network broadcasts. So our
formula is 24 -2 or (2x2x2x2) -2. So the number of hosts per subnet is 14.
Now that you understand how to find hosts and subnets how do you find the subnet mask when
all you have is an IP address and the number of subnets?
IP 192.168.10.0 You need 14 subnets. What is the subnet mask?
To solve this, you need to work the 2^n -2 formula in reverse. The formula will be 2^n +2. 14
subnets = 24 +2 = 16 which is the number of subnets. You use the 24 which indicates the
number of bits that are used in the subnet and add then together for the subnet address or
128+64+32+16 which is 240.
By Frank Hall
Subnetting: Summary
Now that you have reviewed this presentation you should now know how to find
Subnets, hosts per Subnet, or find the subnet mask. Of course you need to practice these
skills to keep them sharp. If you have any questions always feel free to ask.
Oh yes I nearly forgot. There is a cheat sheet on the last slide. Don’t always depend on
knowing the cheat sheet. It’s good to have when you are taking a test, it is always better to
know how to find the solution on your own.
By Frank Hall
Cisco Commands
Cisco Modes
Description Keyboard short cut
User mode
Switch>
Enter Privilege mode
Switch>enable
Privileged mode
Switch#
Enter configuration mode
Switch configure terminal
Global Config mode
Switch(config)#
Enter Interface mode
Switch(config)#interface fa0/1
Interface mode
Switch(config-if)
Return to global configuration
Switch(config-if)exit
Exit Global Config mode
Switch(config)#exit
Return to use mode
Switch#disable
Logout
Switch>exit
Keyboard Shortcuts
Description Keyboard shortcut
Recall Previous command
Up arrow or <Ctrl> p
Recall Next command
Down arrow or <Ctrl> n
Beginning of command
<Ctrl> a
By Frank Hall
End of command
<Ctrl> e
Delete input
<Ctrl> d
Exit Configuration Mode
<Ctrl> z
Complete command
TAB
Device Configuration
Description Commands
Configure device system name
Switch(config)#hostname sw1
Sets the encrypted enable password
Switch(config)#enable secret cisco
Sets the unencrypted enable password
Switch(config)#enable password cisco
Enable password encryption on all clear text password within the configuration file
Switch(config)#service password-encryption
Configure a Message Of The Banner, with an ending character of $
Switch(config)#banner motd $
Assign IP address to vlan Switch(config)#int vlan 1 Switch(config-if)#ip addr 172.22.1.11 255.255.255.0
Assign Default gateway, note the mode
Switch(config)#ip default-gateway 10.1.1.1
Select one interface
Switch(config)#int fa0/1
Select a range of interfaces (version dependant)
Switch(config)#int range fa0/1 – 12
Set the interface description
Switch(config-if)#description
By Frank
By Frank Hall
Add vlan using config mode switch(config)#vlan 11 switch(configvlan)#name
test
Configure Interface fa0/1 @
speed 100 Mbps and full duplex
Switch(config-if)#speed 100 Switch(config-if)#duplex full
Assign interface to vlan
switch(config-if)#switchport access vlan 11
Enable Port Security. Switch(config-if)#switchport mode access Switch(config-if)#switchport port-security Switch(configif)#switchport port-security mac-address sticky
Disable Interface Switch(config-if)shutdown
Enable Interface
Switch(config-if)no shutdown
Configures 5 Telnet sessions each with a password of ‘cisco’
Switch(config)#line vty 0 4 Switch(config-line)#login Switch(config-line)#password cisco
Enable and define console
password of ‘cisco’ Switch(config)#line con 0 Switch(config-line)#login Switch(config-line)#password cisco
Synchronise console messages (keep what you have typing on the screen)
Switch(config-line)#logging synchronous
Set the timezone and automatically adjust
Switch(config)#clock timezone gmt 0 Switch(config)#clock
summer-time gmt recurring
Sets the switch priority for the vlan. This combined with the switch mac address creates the switch BID
Switch(config)#spanning-tree vlan 1 priority 4096
Enables portfast
Switch(config)#int fa0/1 Switch(config-if)#spanning-tree portfast
Enables RSTP. Other options are, PVST and MST
Switch(config)#spanning-tree mode rapid-pvst
Creates a vlan. Note this now done in config mode not vlan database. Also note the ‘int vlan’ command does NOT create vlans
Switch(config)#vlan 2 Switch(config-vlan)#name sales
By Frank Hall
Assign an interface to vlan 2
Switch(config-if)#switchport access vlan 2
Unconditionally forces an interface into trunking. Other options are access and dynamic
Switch(config-if)#switchport mode trunk
Manually assign a switch to a VTP domain. A switch will automatically become part of a VTP domain if it’s currently in the ‘null’ domain and receives a VTP frame
Switch(config)#vtp domain lab
Changes the VTP mode from the default ‘server’ mode to client mode. In client mode no changes can be made
Switch(config)#vtp mode client
Enable the http server to SDM can be used
Router(config)#ip http server
Defines a username and password. The list can be used for many things from PPP authentication to user access
Router(config)#username sue password cisco
Defines a local host file. Like /etc/hosts in unix
Router(config)#ip host mypc 10.1.1.3
Disables DNS lookup. Useful when a command as been miss typed
Router(config)#no ip domain-lookup
Sets the logical (not
physical) bandwidth of interface. This is used by
routing protocols, SNMP queuing etc
Router(config)#int s0 Router(config-if)#bandwidth
Sets the physical clock
Router(config-if)#clock rate 64000
Set the serial interface WAN encapsulation. Other options are PPP or frame-relay
Router(config-if)#encapsulation hdlc
Authentication on PPP is optional. This command enable chap on the interface. Other option PAP
Router(config-if)#ppp authentication chap
By Frank Hall
Defines the type of LMI being used. If left unconfigured the correct LMI type should be automatically detected
Router(config-if)#frame-relay lmi-type cisco
Defines a static route. Renumber static routes have an admin distance of 1. Therefore will over ride any dynamic routing.
Router(config)#ip route 50.0.0.0 255.0.0.0 10.1.2.1
Enables RIP version 1 on all LOCAL interfaces which have a 10.x.x.x address Enables RIP version 2
Router(config)#router rip Router(config-router)#network 10.0.0.0 Router(config-router)#version 2
Enable the router to provide a
DHCP service. Router(config)#ip dhcp pool MYPOOL Router(dhcp-config)#network 10.1.1.0 255.255.255.0 Router(dhcp-config)#default-router 10.1.1.1 Router(dhcp-config)#exit Router(config)#ip dhcp excluded-address 10.1.1.1
10.1.1.99
Changes the config register
which controls what the Router(config)#config-register 0x2102
router does when the router boots
Creates a logical sub interface below the physical interface Enables 802.1q trunking on the interface Define the ip address
Router(config)#int fa0/0.1
Router(config-subif)#encapsulation dot1Q 1
Router(config-subif)#ip address 10.1.1.1 255.255.255.0
Enable OSPF on any local interface which start with the ip address 10.1.x.x. Note the inverted mask
Router(config-)#router ospf 1 Router(config-router)#network 10.1.0.0 0.0.255.255 area 0
EIGRP can be configured in a similar way to RIP or the mask option could be used
Router(config)#router eigrp 1 Router(config-router)#network 172.16.0.0 Or Router(config-router)#network 172.16.2.0 0.0.0.255
Defines a standard ACL. Standard ACL use number 1-99
Router(config)#access-list 1 permit 172.16.1.1
Defines an Extended ACL. The
first address is the source IP
address
Router(config)#access-list 101 deny tcp host 172.16.1.1 host 172.16.2.1 eq telnet Router(config)#access-list 101 permit ip any any
By Frank Hall
Use the group command to attach an ACL to an interface. is used under an interface if the ACL is to filter traffic
Router(config)#interface fa0/0 Router(config-if)#ip access-group 1 out
An example using named ACL
in stead of numbers Router(config)#ip access-list extended my_list Router(config-ext-nacl)# deny tcp host 172.16.1.1 host 172.16.2.1 eq ftp Router(config-ext-nacl)# permit ip any any
Attaching a named ACL to an
interface Router(config)#int fa0/0 Router(config-if)#ip access-group my_list in
Configuring a static NAT to allow a server to be access via the Internet, using the IP address on interface s0/0/1
Router(config)#ip nat inside source static 10.1.1.2 interface s0/0/1
Defining interface which NAT takes place between
Router(config)#int fa0/0.1 Router(config-if)#ip nat inside
Enables RIPng Router(config)#ipv6 unicast-routing ROuter(config)#ipv6 router rip ccna
Router(config)#int s0/0/0 Router(config-if)#ipv6 rip ccna enable
Privilege Commands
Description Commands Manually starts the setup dialog which is automatically invoked when the device starts with no config
Switch#setup
Displays the config held in DRAM. Which is lost if not copy run start command is not used
Switch#show running-config
Displays the NVRAM (None volatile) config.
Switch#show startup-config
Saves the config. Without this
command all
changes/configuration will be
lost.
Switch#copy running-config startup-config
By Frank Hall
Saves the running config to a TFTP server
Switch#copy running-config tftp
Copies IOS files to a TFTP server
Switch#copy flash tftp
Copies files from a TFTP server the device flash
Switch#copy tftp flash
Erase the config held in NVRAM. If this is followed with the reload command all configuration is lost
Switch#erase startup-config
Reboots the device
Switch#reload
Abort sequence
<Shift> <Ctrl> 6
Suspend Telnet Session
<Shift> <Ctrl> 6(then let all keys go, then)x
Show the current sessions. The one with a * is your active session
Switch#show sessions
Forcible closes a telnet session
Switch#disconnect
Set the device local clock.
Note this is not done in
config mode
Switch#clock set 10:00:00 april 2 2008
Display the IOS version along with other useful info e.g sys uptime, config register etc
Switch#show version
Displays the file contents of the flash
Switch#show flash
Displays the clock
Switch#show clock
Displays the users currently logged on
Switch#show users
ault displays the last 10 commands
Switch#show history
Displays the ARP cache
Switch#show arp
By Frank Hall
Displays the spanning tree status on vlan 1
Switch#show spanning-tree vlan 1
Lists all the configured vlans
Switch#show vlan
Displays VTP info such as VTP
mode, VTP domain, VTP counter.
Switch#sh vtp status
Ping selected address
Switch#ping 10.1.1.1
Extended ping. Must be in privilege mode
Switch#ping
Display the interface status
Switch#show int fa0/1
Displays the vlan status and the IP address VLAN 1 (often the management vlan)
Switch#show interfaces vlan 1
Displays a list of CDP neighbours
Switch#show cdp neighbors
Extended information on the above
Switch#show cdp neighbors details
Display CDP packets as they arrive
Switch#debug cdp packets
Display ping packets as they arrive
Switch#debug icmp packets
Display switch MAC Addresses table. These entries are learnt from the source mac address in the Ethernet frames
Switch#show mac address-table
Displays the interface operational status and IP addresses for all router interfaces
Router#show ip interface brief
Displays all the configured routing protocols
Router#show ip protocols
Displays the IP routeing table
Router#show ip route
Displays the NAT translations
Router#show ip nat translations
By Frank Hall
Displays the physical cable DTE/DCE, x.21, V.35, RS232 configuration
Router#show controllers s 0
Displays the end-to-end status. Recall that ‘show interface’ does not
Router#show frame-relay pvc
Displays the type of LMI and the number LMI frames
Router#show frame-relay lmi
Displays the frame relay inverse ARP table
Router#show frame-relay map
To be come neighbours both the local and remote interface must be correctly configured.
Router#show ip ospf neighbor
If adjacent routers don’t become neighbours. Then use the command to check the local router interface is configured correctly
Router#show ip ospf interface
Same information as the above OSPF commands but with EIGRP. Remember that AS numbers MUST match
Router#show ip eigrp neighbor
Same information as the above OSPF commands but with EIGRP
Router#show ip eigrp interface
IPv6 ping. Recall that :: means all zero in between
Router#ping 2000:1000:500:3::1
By Frank Hall
Create VLAN on Cisco Switch If you are planning to have only one network in your whole switch (for example, 10.10.192.0). i.e.
All the ports in the switch will be connected to the 10.10.192.0 network, then you don’t need to
create a VLAN, just use the default VLAN 1.
Every switch comes with the default VLAN 1 as shown below. In this example, all the ports in this
switch (from 1 through 8) are part of the default VLAN 1.
• #show vlan
VLAN Name Status Ports
---- -------------------------------- --------- ------------
1 default active Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4
Gi1/0/5, Gi1/0/6, Gi1/0/7, Gi1/0/8
In the following example, we are creating 192 VLAN network (for 10.10.192.0 network). While
creating a VLAN you also need to specify the range of ports from the switch that needs to be part of
this VLAN network.
In this example, ports 3 through 6 are configured as part of 192 VLAN network.
By Frank Hall
• config t
• vlan 192
• interface range gigabitEthernet 1/0/3-6
• switchport access vlan 192
• exit
In the above commands:
• config t – Goes into the configuration mode
• vlan 192 – Creates VLAN 192
• interface range gigabitEthernet 1/0/3-6 – Indicates that the port numbers 3 through 6 are
assigned to this VLAN
• swithport access vlan 192 – Indicates that the access to the vlan 192 is enabled
Apart from providing the access to the vlan 192 for the port numbers 3 through 6, you can also
specify the following additional switchport configuration parameters (for example, nonegotiate
and mode access)
• config t
• interface range gigabitEthernet 1/0/3-6
• switchport mode access
• switchport nonegotiate
• exit
Once you’ve created a VLAN verify it as shown below,
• #show vlan
VLAN Name Status Ports
---- -------------------------------- --------- ------------
1 default active Gi1/0/1, Gi1/0/2, Gi1/0/7, Gi1/0/8
192 VLAN0192 active Gi1/0/3, Gi1/0/4, Gi1/0/5, Gi1/0/6
Delete VLAN on Cisco Switch
You might want to delete a VLAN, if you are planning to switch the ports assigned to VLAN 192 to a
different VLAN. Or, you might want to delete a VLAN, just because you’ve created it by mistake.
Let us assume that you want to delete the VLAN 192 (ports 3 through 6) that you just
created.
Deleting a VLAN is as simple as assigning the default VLAN 1 to the ports that are part of the VLAN
you want to delete, and delete the VLAN.
By Frank Hall
i.e. If you want to delete VLAN 192, assign VLAN 1 to the ports 3 through 6, and just delete the
VLAN 192.
First, assign the default VLAN 1 to ports 3 through 6 as shown below.
• interface range gigabitEThernet 1/0/3-6
• switchport access vlan 1
• exit
Next, delete the vlan itself as shown below.
• no vlan 192
Finally, verify that the VLAN 192 got deleted as shown below.
• #show vlan
VLAN Name Status Ports
---- -------------------------------- --------- ------------
1 default active Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4
Gi1/0/5, Gi1/0/6, Gi1/0/7, Gi1/0/8
If you don’t know what you are doing, do not execute any of the above commands on
production switch, as you might bring down your network.
6 - Here is a step by step tutorial on configuring a VLAN.
By Frank Hall
Networking Cheat Sheets
By Frank Hall
By Frank Hall
By Frank Hall
By Frank Hall
By Frank Hall
Notes
Notes
By Frank Hall
Notes
By Frank Hall