Tuesday, 5 August 2014

How to Connect to Cisco Console Port with MINICOM

If you are a linux user user you must learn how to connect to your Cisco router or switch using roll-over cable (the cable that comes with your device).
Step1Installing Minicom
Linux users will use application called ‘minicom’.  If you are Ubuntu user you can install it using either ‘Synaptic Package Manager’ or type in the following in your terminal window:
$ sudo apt-get install minicom
Once it is installed, you must configure the ‘minicom’ to communicate with the console port of your router/switch.
Step 2 – Connection to Console Port
Power up your router/switch and connect the roll-over cable to your computer’s serial port (DB-9) and to the ‘console’ port of your router/switch (RJ-45).
Step 3 – Configure Minicom
Open your Terminal window (Applications ==> Accessories ==> Terminal) and type in:

$ minicom -s


Scroll down to ‘Serial Port Setup’ and hit Enter:
Pic. 1
Choose ‘A’ to set up the serial port of your computer (here the first serial port is referenced as ttyS0) so it reads as highlighted below. Then hit Enter again to accept the change:
Pic. 2
Next, press ‘E’ and then ‘C’ again to access the transmission speed and change it to ’9600′ value (no apostrophies). You should see values like highlighted below:
Pic. 3
Then hit Enter twice to get back to the first screen (Pic.1)
The last thing is to save this configuration (you can choose ‘dfl’ to be the default template or with some other name).
Pic. 4
 
If you chose ‘dflp and then, ‘Exit from Minicom’, you can try out your work now. Type in:
$ minicom
and hit Enter
You should see the console prompt of your router/switch. If you want to leave the minicom use CTRL-A keystroke and then type ‘x’ and confirm you want to leave the application.

Navigation in Cisco IOS

Once, you have connected to your Cisco switch or router console port, and power up the device you will see some information displayed during the start of the device. If the device has no initial configuration you are presented with:
Pic. 1 – System Configuration Dialog
You can safely cancel this request as its capability to configure the device is not very impressive. Instead, you are going to do things all professionals do: command after command.
What follows is bunch of messages sent to the screen and after hitting the Enter key few times you get something like this (here is the router, but a switch would introduce itself as … Switch> ):
Router>
IOS Modes (contexts)
This prompt of the device tells you in which ‘context’ you are, and the one above with the ‘>’ character is known as ‘user exec mode‘ or ‘privilege level 1 mode‘. You can’t configure much in this mode of operation. It is designed as a ‘monitoring’ mode not a ‘configuration’ one. Also, the monitoring capability is limited. For instance, you can’t see the running configuration of the device.
Type in the following command:
Router>enable
Router#
The prompt changes to ‘#’ which is called ‘privileged exec mode‘, ‘enabled mode‘ or sometimes ‘privilege level 15 mode‘. I would like to draw your attention to two things here. Both modes of operation (or contexts, if you like) have two things in common:
  1. They are used primarily to monitor the device (you will be using ‘show‘ and ‘debug‘ commands in those modes).
  2. They are context for immediate execution of your commands. If the syntax is correct, system executes the command immediately.
Those two modes differ from one another as well:
  1. User Exec Mode – is limited in terms of what information will be available.
  2. Enabled Exec Mode – gives the operator ALL information (like root or Administrator account on a computer).
Question Mark
As the commands take many attributes your best friend is the question mark ‘?‘. This help is known as the ‘context-sensitive help‘. This means that depending on which context you use, while typing a question mark (?) the system is going to list the commands that can be executed in that particular mode of operation. See more in the attached video.
Configurations
In order to configure things in Cisco IOS (except for some minor changes), you must enter the ‘global configuration mode‘ first which is characterized by the following prompt:
Router(config)#
This context can be accessed by typing the following command in the ‘privileged exec mode‘:
Router#configure terminal
Whatever you configure this particular mode it is going to be applied to the device as a whole unit (e.g. hostname, default gateway on a switch etc.).
If you want to enter the context of the interface to configure it with some parameters like ip address, speed, duplex, description etc. , you must enter that interface from the global configuration mode like the one below:
Router(config)#interface fastethernet1/0
If you do not know what interfaces your device has, type the following command in the enabled mode:
Router#show ip interface brief
As you see, in the ‘global configuration mode’ I did the following actions in order to access the context of the interface:
  1. Entered the interface type (here: Fast Ethernet).
  2. Referenced the module number (here: 1)
  3. Referenced the port number in the module 1 (here: 0)
Please, note that routers count ports starting from 0, switches starting from 1.
You’ll learn other contexts as we go through numerous labs and video presentations.
Abbreviations
You don’t have to type in the full words of the commands and certain attributes that follow the commands. For instance, instead of typing:
Router#configure terminal
Router(config)#
You can type:
Router#conf t
Router(config)#
As long as the abbreviation uniquely describes which command you want to use, the system has no problem accepting it.
Shortcuts And Keystrokes
When you type enough of the characters that uniquely identify the command in a given context you can use ‘tab‘ key and the system is going to complete the command on the screen for you (just like in Linux).
I often use the following keystrokes while editing the commands:
  • CTRL-z – takes the cursor back to the ‘enabled exec’ mode from any other context
  • CTRL-a – takes the cursor to the beginning of the line
  • CTRL-e – takes the cursor to the end of the line
  • CTRL-k – erases everything to the right of the cursor
  • CTRL-u – erases everything to the left of the cursor
  • Upper Arrow or CTRL-P – displays previous command from the history buffer
  • Lower Arrow or CTRL-N – displays next command from the history buffer
System keeps the record of up to ten (default) commands you typed in. You can increase/decrease the history buffer up to 256 commands.
If you want to check the history buffer size, type in:
Router#show terminal | include history
Changing the buffer size can be accomplished with the following command in the ‘enabled mode’
Router#terminal history size 256
The above command  will increase the size of the history buffer to 256 commands.
If you want to see the buffer (which commands were typed) use this command:
Router#show history
Please, take a look at the video I posted below to see most of those things in action. Practice them until you are confident with the content of this lesson before you proceed to the next one.
Next lesson is going to be about creating an initial configuration of our router and/or switch

OSI Reference Model by quontra solutions

Before OSI it was difficult for the vendors to create network products OSI, why U need to study, its a structured approach to troubleshoot

Each has independent model
Before considering how to configure Cisco routers and switches, you must be introduced to basic networking concepts you’ll need to understand in order to grasp the advanced concepts discussed in later chapters

ISO developed the seven-layer.
Application Layer, Presentation Layer And Session Layers are Both called Upper Layer.

And Transport Layer, Network Layer, Data Link Layer And Physical Layers are both called Lower Layer.

Application Layer :- Top (seventh) layer of the OSI Reference Model is the application layer. It provides the user interface. Examples of TCP/IP applications include telnet, FTP, HTTP, HTTPS, SMTP, SNMP, DNS, ICMP And all of browser.
This layer deal with networking applications.
Examples:
Email
Web browsers
Presentation :- The Presentation layer gets its name from its purpose: It presents data to the Application layer and is responsible for data translation and code formatting
Exam Watch The presentation layer determines how data is represented to the user. Examples of presentation layer protocols and standards include ASCII, BMP, GIF, JPEG, WAV, AVI, and MPEG.
ASCII (the American Standard Code for Information Interchange, used by most devices today) uses seven bits to represent characters. EBCDIC (Extended Binary-Coded Decimal Interchange Code, developed by IBM)
PICT A picture format used by Macintosh programs for transferring QuickDraw graphics.
TIFF Tagged Image File Format; a standard graphics format for high-resolution, bitmapped images.
JPEG Photo standards brought to us by the Joint Photographic Experts Group. Other standards guide movies and sound:
MIDI Musical Instrument Digital Interface (sometimes called Musical Instrument Device Interface), used for digitized music.
MPEG Increasingly popular Moving Picture Experts Group standard for the compression and coding of motion video for CDs. It provides digital storage and bit rates up to 1.5Mbps.
QuickTime For use with Macintosh programs; manages audio and video applications.
RTF Rich Text Format, a file format that lets you exchange text files between different word processors, even in different operating systems.

This layer is responsible for presenting the data in the required format which may include:
Code Formatting
Encryption
Compression
Session :-   Exam Watch The session layer is responsible for setting up and tearing down network connections. Examples include RPCs and NFS.
The actual mechanics of this process, however, are implemented at the transport layer. To set up connections or tear down connections, the session layer communicates with the transport layer. Remote Procedure Call (RPC) is an example of an IP session protocol; the Network File System (NFS), which uses RPC, is an example application at this layer.

This layer establishes, manages, and terminates sessions between two communicating hosts.
Creates Virtual Circuit
Coordinates communication between systems
Organize their communication by offering three different modes
Simplex
Half Duplex
Full Duplex
Example:
·  Client Software
( Used for logging in)

Transport :-
This layer breaks up the data from the sending host and then reassembles it in the receiver.
It also is used to insure reliable data transport across the network.
Can be reliable or unreliable
Sequencing
Acknowledgment
Retransmission
Flow Control
Windows
Protocol Port
PDU – Segments
Data Link :-
This layer provides reliable transit of data across a physical link.
Performs Physical Addressing.
Combines bits into bytes and bytes into frames.
Preamble is sequence of 1’s and 0’s signifies the beginning of a frame.
Error detection, not correction.
FCS is used for error detection.
Access to media using MAC address.
LLC and MAC.
CRC run on the data field and and the values is kept in FCS.
Logical Link Control performs Link establishment.
MAC Performs Access method.
OSI (Open Systems Interconnection) Reference Model:
This is a protocol suit, and it follows Department of defense model.
The seven layers of OSI layer.
Application Layer
[NNTP • SIP • SSI • DNS • FTP • Gopher • HTTP • NFS • NTP • SMPP • SMTP • SNMP • Telnet • DHCP • Netconf • RTP • SPDY • etc.]
Presentation Layer
[MIME • XDR • TLS • SSL]
Session Layer
[Named Pipes • NetBIOS • SAP • L2TP • PPTP • SOCKS]
Transport Layer
[TCP • UDP • SCTP • DCCP • SPX]
Network Layer
[IP (IPv4, IPv6) • ICMP • IPsec • IGMP • IPX • AppleTalk]
Data Link Layer
[ATM • SDLC • HDLC • ARP • CSLIP • SLIP • GFP • PLIP • IEEE 802.3 • Frame Relay • ITU-T G.hn PPP •DLL • X.25 • Network Switch •]
Physical Layer
[EIA/TIA-232 • EIA/TIA-449 • ITU-T V-Series • I.430 • I.431 • POTS • PDH • SONET/SDH • PON • OTN • DSL • IEEE 802.3 • IEEE 802.11 • IEEE 802.15 • IEEE 802.16 • IEEE 1394 • ITU-T G.hn PHY • USB • Bluetooth • Hubs]

Cabling Networking cables

Networking cables are used to connect one network device to other network devices or to connect two or more computers to share printer, scanner, Router, Switch, Hub etc. Different types of network cables like Optical fiber cable, Coaxial cable, Twisted Pair cables are used reckon on network’s size, topology and protocol.

10 MBps Ethernet (IEEE 802.3)
Specification 10Base5 10Base2 10BaseT
No of segment 500m 185m 100m
Highest segment number 5 5 1024
Highest segment node 3 3 1024
Number of nodes per segment 100 30 2
Tap distance 2.5km - -
Highest hub connectivity 4 - -
Repeater distance 2.5km 925m -
Topology Bus Bus Star
Cabling Thick coaxial Thin coaxial UTP
Transmission Half duplex Half duplex Half duplex

100 MBps Ethernet (fast Ethernet)

Specification 100BaseT4(802.3u) 100BaseT2(802.3y) 100BaseTX(802.3u)
Cabling Cat3 UTP Cat3 UTP Cat5 UTP
Topology Star Star Star
Bandwidth 100mbps 100mbps 100mbps
Transmission mode Half duplex Full duplex Full duplex
Area coverage 100m 100m 100m

1000 mbps Gigabit Ethernet

Name Cabling Topology Transmission Bandwidth Area
100BaseT(802.3ab) Cat5 or Cat5e UTP Star Full duplex 1000mbps 100m
1000BaseTX(802.3ab) Cat6 or higher UTP Star Full duplex 1000mbps 100m
1000BaseLX(802.3z) 1270-nm Fiber optic Star Full duplex 2000mbps 550m(multimode) 5km(single mode)
1000BAseSX(802.3z) 770nm or 860nm Fiber optic Star Full duplex 1000mbps 220 or 550m
1000BAseLH(802.3z) 1300nm or 1310nm Fiber optic Star Full duplex 1000mbps 10km
1000BaseZX 1550nm Fiber optic Star Full duplex 1000mbps 70km

what is Encapsulation

The term “encapsulation” is used to describe a process of adding headers and trailers around some data. For example, when you send an email using your favourite email program (like Outlook or Thunderbird) that email is sent from the Application layer to the Transport layer. The Transport layer encapsulates the data and adds its own header (with its own information, such as which port will be used) and passes the data to the Internet layer, which again encapsulates the received data and adds its own header, usually with information about the source and destination IP addresses. The Internet layer than passes the data to the Network Access layer. This layer is the only layer that adds both a header and a trailer. The data is then sent through a physical network link.
Each layer adds its own information:
encapsulation
The term “decapsulation” refers to the process of removing headers and trailers as data passes from lower to upper layers. This process happens on a computer that is receiving data.

Frame, packet, segment

 
Frame – the term “frame” refers to the encapsulated data defined by the Network Access layer. A frame can have a header and a trailer that encapsulate a data section.
 
Packet – the term “packet” is used to describe the encapsulated data defined by the Internet layer. A packet can have a header with the source and destination IP addresses.
 
Segment – the term “segment” describes encapsulated data defined by the Transport layer. A segment can have a header with informations such as source and destionation port numbers, sequence and acknowledgment numbers, etc.

What is Ethernet ?

Ethernet is the most used networking technology for LANs today. It defines wiring and signaling for the Physical layer of the OSI model. For the Data Link layer, it defines frame formats and protocols.
 
Ethernet is described as IEEE 802.3 standard. It uses Carrier Sense Multiple Access with Collision Detection (CSMA/CD) access method and supports speeds up to 100 Gbps. It can use coaxial, twisted pair and fiber optic cables. Ethernet uses frames to with source and destination MAC addresses to deliver data.

Explanation of MAC & IP addresses

MAC address

A Media Access Control (MAC) address is a 48-bit address that is used for communication between two hosts in an Ethernet environment. It is a hardware address, which means that it is stored in the firmware of the network card.
 
A MAC address is supposed to be globaly unique. Each network card vendor gets its share of addresses (represented by the first 24 bits).
 
The address is written in the form of 12 hexadecimal digits. For example, consider the following MAC address:
 
D8-D3-85-EB-12-E3
 
Every hexadecimal character represents 4 bits, so the first six hexadecimal characters represent the vendor (in this case, Hewlett Packard).

How to find out your own MAC address?

If you are using Windows, enter the Command Prompt (Start – Programs – Accessories – Command Prompt). Type the ipconfig/all command and you should see a field called Physical address under the Ethernet adapter settings:
  
ipconfig/all command
 
If you are using Linux, type the ifconfig command. You should see your MAC address referred to as HWaddress.
 
ifconfig mac address

IP address

An IP address is a 32-bit number that identifies a host on a network. It is usually written in the form of four decimal numbers seperated by periods (e.g. 10.0.50.1).    
 
In contrast to MAC address, an IP address is a logical address. Any device that wants to communicate with other device using TCP/IP needs to have an IP address. It can be configured manually or it can be obtained from a DHCP server.
 
The term “IP address” is usually used for IPv4, which is the fourth version of the IP protocol. A newer version exists, IPv6, and uses 128-bit addressing.
 
Private IP addresses
 
There are three ranges of addresses that can be used in a private network (e.g. your home LAN). These addresses are not routable through the Internet.
 
Private addresses ranges:
 
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
How to find out your IP address
 
Windows users:
 
Enter the Command Promt (Start – Programs – Accessories – Command Prompt). Enter ipconfig. You should see a field called IP address.
 
ipconfig

Explanation of Network Topology

A network consists of multiple computers connected using some type of interface, each having more interface devices such as a NIC and or a serial device for Point-to-Point Protocol networking. every computer is supported by network software that provides the client functionality. So The hardware used to transmit data across the network is called the media. It may include  fiber optic,  wireless transmission or copper cable. The standard cabling used for the purposes of this document is 10Base-T category 5 ethernet cable. So this is twisted copper cabling which appears at the surface to look similar to TV coaxial cable. It’s terminated on each end by a connector that looks like a telephone connector. And It’s maximum segment length is 100 meters.
Network Categories:-
There are two types of network categories which are below:
  1. Server based
  2. Peer-to-peer
In a server based network, there are computers set up to be primary providers of services such as mail service or file service. The computers providing the service are called servers and use the service are called client computers and the computers that request.
In a peer-to-peer network, various computers on the network can act both as servers and clients. For instance, many Microsoft Windows based computers will allow print sharing and file. These computers can act both as a client and a server and are also referred to as peers.Now Many networks are combination peer-to-peer and server based networks.This Network operating system uses to communicate on the network to other computers. network operating system supports the applications on that computer. Network OperatingSystem includes Windows XP, Windows NT, Novell Netware, Unix, Linux, Dos and others.
Three Network Topologies :-
The network topology describes the method to use do the physical wiring of the network. The main ones are bus, ring, and star.
1. Bus – Both ends of the network must be terminated with a terminator. A cask connector can be used to extend it.
2. Star – All devices rotate around a central hub, which controls the network communications, and can communicate with other hubs.This topology Range limits are about 100 meters from the hub.
3. Ring – All devices are connected from one to another, as like a ring. A data token is used to grant authorization for each computer to communicate.

MAC & IP addresses

MAC address


A Media Access Control (MAC) address is a 48-bit address that is used for communication between two hosts in an Ethernet environment. It is a hardware address, which means that it is stored in the firmware of the network card.
 
A MAC address is supposed to be globaly unique. Each network card vendor gets its share of addresses (represented by the first 24 bits).
 
The address is written in the form of 12 hexadecimal digits. For example, consider the following MAC address:
 
D8-D3-85-EB-12-E3
 
Every hexadecimal character represents 4 bits, so the first six hexadecimal characters represent the vendor (in this case, Hewlett Packard).

How to find out your own MAC address?


If you are using Windows, enter the Command Prompt (Start – Programs – Accessories – Command Prompt). Type the ipconfig/all command and you should see a field called Physical address under the Ethernet adapter settings:
ipconfig/all command
If you are using Linux, type the ifconfig command. You should see your MAC address referred to as HWaddress.
ifconfig mac address

IP address

An IP address is a 32-bit number that identifies a host on a network. It is usually written in the form of four decimal numbers seperated by periods (e.g. 10.0.50.1).    
 
In contrast to MAC address, an IP address is a logical address. Any device that wants to communicate with other device using TCP/IP needs to have an IP address. It can be configured manually or it can be obtained from a DHCP server.
 
The term “IP address” is usually used for IPv4, which is the fourth version of the IP protocol. A newer version exists, IPv6, and uses 128-bit addressing.
 
Private IP addresses
 
There are three ranges of addresses that can be used in a private network (e.g. your home LAN). These addresses are not routable through the Internet.
 
Private addresses ranges:
 
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
How to find out your IP address
 
Windows users:
 
Enter the Command Promt (Start – Programs – Accessories – Command Prompt). Enter ipconfig. You should see a field called IP address.
ipconfig

Ping (Packet Internet Groper)

A ping is perhaps the most commonly used tool when troubleshooting a network. Ping (Packet Internet Groper) tool is included with most operating systems. It is invoked using a ping command. Ping command uses ICMP (Internet Control Message Protocol). Ping works by sending an ICMP echo request message to the specified IP address. If the computer with the destination IP address is reachable, it responds with an ICMP echo reply message.
 
A ping command usually outputs some other information about a network performance, e.g. a round-trip time, a time to send an ICMP request packetand receive an ICMP reply packet.
 
Here is an output of the ping command from Windows 7:
ping
In the example above we have pinged the ip address 10.10.100.1. By default, ping on Windows sends four ICMP request packets. As you can see from the output above, the host with the IP address of 10.10.100.1 is reachable and has replied with four ICMP reply packets. You can also see that the remote host has replied within 1 ms, which indicates that the network is not congested.

ARP-Address-Resolution-Protocol

ARP (Address Resolution Protocol) is a network protocol used to find out the hardware (MAC) address of a device from an IP address. It is used when a device wants to communicate with some other device on a local network (for example on an Ethernet network that requires physical addresses to be known before sending packets). The sending device uses ARP to translate IP addresses to MAC addresses. The device sends an ARP request message containing the IP address of the receiving device. All devices on a local network segment see the message, but only the device that has that IP address responds with the ARP reply message containing its MAC address. The sending device now has enough information to send the packet to the receiving device.
 
ARP request packets are sent to the broadcast addresses (FF:FF:FF:FF:FF:FF for the Ethernet broadcasts and 255.255.255.255 for the IP broadcast).
ARP broadcast explained: 
 
arp process
 
Let’s say that Host A wants to communicate with host B. Host A knows the IP address of host B, but it doesn’t know the host B’s MAC address. In order to find out the MAC address of host B, host A sends an ARP request, listing the host B’s IP address as the destination IP address and the MAC address of FF:FF:FF:FF:FF:FF (Ethernet broadcast). Switch will forward the frame out all interfaces (except the incoming interface). Each device on the segment will receive the packet, but because the destination IP address is host B’s IP address, only host B will reply with the ARP reply packet, listing its MAC address. Host A now has enough information to send the traffic to host B.
 
All operating systems maintain ARP caches that are checked before sending an ARP request message. You can display ARP entries in Windows by using the arp -a command:
 
windows arp

DHCP-Dynamic Host Configuration Protocol

DHCP is a network protocol that is used to assign various network parameters to a device. This greatly simplifies administration, since there is no need to assign static network parameters for each device separately. DHCP is a client-server protocol. A client is a device that is configured to use DHCP to request network parameters from a DHCP server. DHCP server maintains a pool of available IP addresses and assignes one of them to the host. A DHCP server can also provide some other parameters, such as:
• subnet mask
• default gateway
• domain name
• DNS server
 
Cisco routers can be used as a DHCP server.
 
DHCP process explained:
 
DHCP client goes through the four step process:
 
dhcp process explained
1: A DHCP client sends a broadcast packet (DHCP Discover) to discover DHCP servers on the LAN segment.
 
2: The DHCP servers receive the DHCP Discover packet and respond with DHCP Offer packets, offering IP addressing information.
 
3: If the client receives the DHCP Offer packets from multiple DHCP servers,
the first DHCP Offer packet is accepted. The client responds by broadcasting a DHCP Request packet, requesting network parameters from a single server.
 
4: The DHCP server approves the lease with a DHCP Acknowledgement packet. The packet includes the lease duration and other configuration information.

DNS -Domain Name System

DNS is a network protocol used to translate hostnames into IP addresses. DNS is not required to establish a network connection, but it is much more user friendly for human users than the numeric addressing scheme. Consider this example. You can access the Google homepage by typing 74.125.227.99, but it’s much easier just to type www.google.com!
 
To use DNS, you must have a DNS server configured to handle the resolution process. A DNS server have a special-purpose application installed. The application maintains a table of dynamic or static hostname-to-IP address mappings. When a user request some network resource using a hostname, (for example by typing www.google.com in a browser), a DNS request is sent to the DNS server asking for the IP address of the hostname. The DNS server then replies with the IP address. The user’s browser can now use that IP address to access www.google.com.
 
The figure below explains the concept:
 
dns process
 
Suppose that the DNS Client wants to communicate with the server named Server1. Since the DNC Client doesn’t know the IP address of Server1, it sends a DNS Request to the DNS Server, asking for Server1′s IP address. The DNS Server replies with the IP address of Server1 (DNS Reply).
 
The picture below shows a sample DNS record:
 
dns record
Here you can see that the host with the hostname APP1 is using the IP address of 10.0.0.3.

Telnet

Telnet is a network protocol that allows a user to communicate with a remote device. It is a virtual terminal protocol used mostly by network administrators to remotely access and manage devices. Administrator can access the device by “telnetting” to the IP address or hostname of a remote device.
 
To use telnet, you must have a software (Telnet client) installed. On a remote device, a Telnet server must be installed and running. Telnet uses TCP port 23.
 
One of the greatest disadvantages of this protocol is that all data, including usernames and passwords, is sent in clear text, which is a potential security risk. This is the main reason why Telnet is rarely used today and is being replaced by a much secure protocol called SSH.
 
The word “telnet” can also refer to the software that implements the telnet protocol.
On Windows, you can start a Telnet session by typing the telnet IP_ADDRESS or HOSTNAME command:
 
telnet windows

SSH-Secure Shell

SSH is a network protocol used to remotely access and manage a device. The key difference between Telnet and SSH is that SSH uses encryption, which means that all data transmitted over a network is secure from eavesdropping.
 
Like Telnet, a user accessing a remote device must have an SSH client installed. On a remote device, an SSH server must be installed and running. SSH uses TCP port 22 by default.
 
SSH relies on public key cryptography for its encryption.
 
Here is an example of creating an SSH session using Putty, a free SSH client:
 
putty
 
NOTE – SSH is the most common way to remotely access a Cisco device

FTP -File Transfer Protocol

FTP is a network protocol used to transfer files from one computer to another over a TCP network. Like Telnet, it uses a client-network arhitecture, which means that a user has to have an FTP client installed to access an FTP server running on the remote machine. After establishing an FTP connection, the user can download or upload files to and from the FTP server.
 
FTP uses two TCP ports: port 20 for sending data and port 21 for sending control commands.
 
FTP can use authentication, but like Telnet, all data is sent in clear text, including usernames and passwords.

TFTP-Trivial File Protocol

TFTP is a network protocol used to transfer files between remote machines. It is a simple version of FTP, lacking some of the more advanced features FTP offers, but requiring less resources than FTP.
 
Because of it’s simplicity TFTP can be used only to send and receive files. It uses UDP port 69 for communication.
 
Because of it’s disadvantages TFTP is not widely used today, but it’s used to save and restore a router configuration or to backup an IOS image.
 
TFTP doesn’t support user authentication and sends all data in clear text

HTTP Hypertext Transfer Protocol

HTTP is an client-server protocol that allows clients to request web pages from web servers. It is an application level protocol widely used on the Internet. Clients are usually web browsers. When a user wants to access a web page, a browser sends an HTTP Request message to the web server. The server responds with the requested web page. Web servers usually use TCP port 80.
 
Clients and web servers use request-response method to communicate with each other, with clients sending the HTTP Requests and servers responding with the HTTP Responses. Clients usually send their requests using GET or POST methods, for example GET /homepage.html. Web servers responds with a status message (200 if the request was successful) and sends the requested resource.
 
An example will clarify this process:

http process explained

HTTPS | Hypertext Transfer Protocol Secure

Hypertext Transfer Protocol Secure is a secure version of HTTP. This protocol enables secure communication between a client (e.g. web browser) and a server (e.g. web server) by using encryption. HTTPS uses SSL (Secure Socets Layer) protocol and for encryption and TCP port 443 for communication.
 
HTTPS is commonly used to create a secure channel over some insecure network, e.g. Internet. By default, most traffic on the Internet is unencryped and susceptible to sniffing attacks. HTTPS encrypts sensitive information, which makes a connection secure.
 
HTTPS is usually not used on the entire website because encryption slows down the site. Instead, it is used only to protect sensitive information like usernames and passwords.
 
HTTPS URLs begin with https instead of http. In Internet Explorer, you can immediately recognize that a web site is using HTTPS because a lock appears to the right of the address bar:
 
https ie lock

Cisco IOS overview

IOS (Internetwork Operating System) is a multitasking operating system used on most Cisco routers and switches. IOS has a command-line interface with the predetermined number of multiple-word commands. This operating system is used to configure routing, switching, internetworking and other features supported by a Cisco device.
 
Previous versions of Cisco switches ran CatOS, a discounted version of a CLI-based operating sytem.
 
Below you can see how IOS looks like when a Cisco device is started for the first time:
 
ios initial screen

 Accessing the IOS

There are three most common ways to access the IOS:
 
1. Console access – this type of access is usually used to configure newly acquired devices. These devices usually don’t have an IP address configured, and therefore can not be accessed through a network. Most of the Cisco devices have a physical console port. This port can be connected to a computer using a rollover cable, a special type of cable with pins on one end reversed on the other end of the cable. The rollover cable is a serial cable, which means that you can’t just plug it in an Ethernet port on your computer. You will need an adapter that converts an interface on your computer (usually a 9-pin serial interface) into RJ-45.
2. Telnet access – this type of access used to be a common way to access network devices. Telnet is an terminal emulation program that enables you to access IOS through the network and configure the device remotely. The device that is being configured needs to have an Telnet server installed and an IP address configured.
 
Telnet uses a well known TCP port 23. One of the biggest disadvantages of this protocol is that is sends all data as clear-text, which includes the passwords! This is the reason why this type of access is usually not used anymore. Instead, SSH is usually used.
 
3. SSH access – like Telnet, this access type enables you to configure devices remotely, but it adds an extra layer of security by encrypting all communications using public-key cryptography. SSH uses well known TCP port 22.

Types of memory on a Cisco device

Cisco devices usually have four types of memory that are being used for different purposes. These four types are:
•    ROM (Read-only memory) – stores a bootstrap program that is used to initialize a boot process. This is a read-only type of memory, so it can’t be altered.
•    RAM (Random Access Memory) – the running configuration of a device is stored here. This type of memory loses its content when a device is restarted.
•    Flash memory – used to store IOS software images. Can also be used to store other files, for example backup configuration files.  Retains its content even after a device is restarted.
•    NVRAM (Nonvolatile RAM) – usually used to store a startup configuration file. This type of memory retains its content even after a device is powered down or restarted.

IOS modes

IOS has many different modes. There are three main modes any many submodes. We will describe the three main modes and one submode.
 
user EXEC mode – the default mode for the IOS CLI. This is the mode that a user is placed in after accessing the IOS. Only basic commands (like ping or telnet) are available in this mode.
 
privileged EXEC Mode – this mode is accessed by typing the enable command from the user EXEC mode. This mode can be password protected. In this mode a user can view and change a device’s configuration.
 
global configuration mode – this mode can be accessed by typing the configure terminal command from the privileged EXEC mode. It is used to change the device’s configuration.
 
A global configuration mode can have many submodes. For example, when a user wants to configure an interface, he will have to enter the interface submode by entering the interface INTERFACE_TYPE INTERFACE_NUMBER command (e.g. interface FastEthernet 0/1 ) from the global configuration mode. This submode can have many commands that are specific for the interface.

IOS command-User EXEC

User EXEC mode commands

Initially, a user logs into the User Exec mode. This is the mode with the least number of commands. You can get a list of all available commands by typing the character “?”.
 
user exec mode commands
 
As you can see, most of the commands available are used to show statistics and perform some basic troubleshooting. The prompt on the left side of the screen always displays the device hostname (R1 in this case), followed by the character >.
 
All commands can be abbreviated to their first letters of the command name. For example, you can abbreviate ping by typing pin, because no other command in the User EXEC mode IOS mode begins with these letters.

Privileged EXEC IOS mode commands

Privileged EXEC mode commands

This IOS mode is also called enable mode because you must enter the enable command from a user EXEC mode, if you want to access this mode. You can use more commands in the privileged EXEC mode than you were able to use in the user EXEC mode. You can save a device configuration or reload a device in this mode. You can also enter a third mode, the configuration mode.
 
An access to this mode can be protected by a password.
The prompt for this mode shows # after the device hostname.
 
privileged exec mode commands

Global configuration IOS mode commands

Global configuration mode commands

To change a device configuration, you need to enter the global configuration mode. This mode can be accessed by typing configure terminal (or conf t, the abbreviated version of the command) from the enable mode. The prompt for this mode is hostname(config).
 
Global configuration mode commands are used to configure a device. You can set a hostname, configure authentication, set an IP address for an interface, etc. From this mode you can also access submodes, for example the interface mode, from where you can configure interface options.
 
You can get back to a privileged EXEC mode by typing the end command. You can also type CTRL + C to exit the configuration mode.
 
global configuration mode commands

Submode commands

Submode commands

A global configuration mode contains many submodes. For example, if you want to configure an interface you have to enter that interface configuration mode. Each submode contains only commands that pertain to the resource that is being configured.
 
To enter the interface configuration mode you need to specify which interface you would like to configure. This is done by using the interface INTERFACE_TYPE/INTERFACE_NUMBER global configuration command, where INTERFACE_TYPE represents the type of an interface (Ethernet, FastEthernet, Serial…) and INTERFACE_NUMBER represents the interface number, since CIsco devices usually have more than one physical interface. Once inside the interface configuration mode, you can get a list of avaliable commands by typing the “?” character. Each submode has its own prompt. Notice how the command prompt was changed to HOSTNAME(config-if).
 
interface mode commands

Running and startup configuration

CIsco devices store commands in a configuration file. Immediately after you type a command in the global configuration mode it is stored in the running configuration. A running configuration resides in a device’s RAM, so if a device loses power, all configured commands will be lost.
 
To avoid that scenario, you need to copy your current configuration into a startup configuration. A startup configuration is stored in the nonvolatile memory of a device, which means that all configuration changes are saved even if the device loses power.
 
To copy your running configuration into the startup configuration you need to type the command copy running-configuration startup-configuration.
 
copy running startup config