Pages

Total Pageviews

Wednesday, August 21, 2019

Introduction to Network - Course 4


3.4.1.2 Lab - Using Wireshark to View Network Traffic 

Lab - Using Wireshark to View Network Traffic
Topology
Objectives
Part 1: Capture and Analyze Local ICMP Data in Wireshark
Part 2: Capture and Analyze Remote ICMP Data in Wireshark
Background / Scenario
Wireshark is a software protocol analyzer, or "packet sniffer" application, used for network troubleshooting, analysis, software and protocol development, and education. As data streams travel back and forth over the network, the sniffer "captures" each protocol data unit (PDU) and can decode and analyze its content according to the appropriate RFC or other specifications.
Wireshark is a useful tool for anyone working with networks and can be used with most labs in the CCNA courses for data analysis and troubleshooting. In this lab, you will use Wireshark to capture ICMP data packet IP addresses and Ethernet frame MAC addresses.
Required Resources
·         1 PC (Windows 7 or 8 with Internet access)
·         Additional PC(s) on a local-area network (LAN) will be used to reply to ping requests.
Part 1:     Capture and Analyze Local ICMP Data in Wireshark
In Part 1 of this lab, you will ping another PC on the LAN and capture ICMP requests and replies in Wireshark. You will also look inside the frames captured for specific information. This analysis should help to clarify how packet headers are used to transport data to their destination.
Step 1:     Retrieve your PC’s interface addresses.
For this lab, you will need to retrieve your PC’s IP address and its network interface card (NIC) physical address, also called the MAC address.
a.     Open a command window, type ipconfig /all, and then press Enter.
b.     Note your PC interface’s IP address and MAC (physical) address.
c.     Ask a team member for their PC’s IP address and provide your PC’s IP address to them. Do not provide them with your MAC address at this time.
Step 2:     Start Wireshark and begin capturing data.
a.     On your PC, click the Windows Start button to see Wireshark listed as one of the programs on the pop-up menu. Double-click Wireshark.
b.     After Wireshark starts, double-click Ethernet or other available active interface.
Note: The wavelike line indicates active interface.


Information will start scrolling down the top section in Wireshark. The data lines will appear in different colors based on protocol.
c.     This information can scroll by very quickly depending on what communication is taking place between your PC and the LAN. We can apply a filter to make it easier to view and work with the data that is being captured by Wireshark. For this lab, we are only interested in displaying ICMP (ping) PDUs. Type icmp in the Filter box at the top of Wireshark and press Enter or click on the blue arrow button (to apply new filter setting) to view only ICMP (ping) PDUs.


d.     This filter causes all data in the top window to disappear, but you are still capturing the traffic on the interface. Bring up the command prompt window that you opened earlier and ping the IP address that you received from your team member. Notice that you start seeing data appear in the top window of Wireshark again.
Note: If your team member’s PC does not reply to your pings, this may be because their PC firewall is blocking these requests. Please see Appendix A: Allowing ICMP Traffic Through a Firewall for information on how to allow ICMP traffic through the firewall using Windows 7.
e.     Stop capturing data by clicking the Red Square icon.


Step 3:     Examine the captured data.
In Step 3, examine the data that was generated by the ping requests of your team member’s PC. Wireshark data is displayed in three sections: 1) The top section displays the list of PDU frames captured with a summary of the IP packet information listed, 2) the middle section lists PDU information for the frame selected in the top part of the screen and separates a captured PDU frame by its protocol layers, and 3) the bottom section displays the raw data of each layer. The raw data is displayed in both hexadecimal and decimal form.
a.     Click the first ICMP request PDU frames in the top section of Wireshark. Notice that the Source column has your PC’s IP address, and the Destination contains the IP address of the teammate’s PC you pinged.


b.     With this PDU frame still selected in the top section, navigate to the middle section. Click the plus sign to the left of the Ethernet II row to view the Destination and Source MAC addresses.
Does the Source MAC address match your PC’s interface? __yes____
Does the Destination MAC address in Wireshark match your team member’s MAC address?
_yes____
How is the MAC address of the pinged PC obtained by your PC?
The MAC address is obtained through an ARP request ___________________________________________________________________________________
Note: In the preceding example of a captured ICMP request, ICMP data is encapsulated inside an IPv4 packet PDU (IPv4 header) which is then encapsulated in an Ethernet II frame PDU (Ethernet II header) for transmission on the LAN.
Part 2:     Capture and Analyze Remote ICMP Data in Wireshark
In Part 2, you will ping remote hosts (hosts not on the LAN) and examine the generated data from those pings. You will then determine what is different about this data from the data examined in Part 1.
Step 1:     Start capturing data on the interface.
a.     Click the Blue shark fin icon to start capturing again.



b.     A window prompts to save the previously captured data before starting another capture. It is not necessary to save this data. Click Continue without Saving.
c.     With the capture active, ping the following three website URLs:
1)    www.yahoo.com
2)    www.cisco.com
3)    www.google.com
Note: When you ping the URLs listed, notice that the Domain Name Server (DNS) translates the URL to an IP address. Note the IP address received for each URL.
d.     You can stop capturing data by clicking the Red Square icon.
Step 2:     Examining and analyzing the data from the remote hosts.
a.     Review the captured data in Wireshark, examine the IP and MAC addresses of the three locations that you pinged. List the destination IP and MAC addresses for all three locations in the space provided.
1st Location:     IP: 98.138.219.231 __._____ MAC: 00:00:0c:07:ac:17
2nd Location:     IP: 72.163.4.185 ____._____ MAC: 00:00:0c:07:ac:17
3rd Location:     IP: 172.217.10.46 ___._____ MAC: 00:00:0c:07:ac:17
b.     What is significant about this information?
All of the MAC addresses are the same. ___________________________________________________________________
c.     How does this information differ from the local ping information you received in Part 1?
_____________________________Local ping gives you you the MAC address whereas the ping to a remote host doesn’t._______________________________________________________
____________________________________________________________________________________
Reflection
Why does Wireshark show the actual MAC address of the local hosts, but not the actual MAC address for the remote hosts?
____Because it is within its own network within its own security , whereas on remote hosts it does not have the privilege to acquire the MAC address.___________________________________________________________________________________
_______________________________________________________________________________________
If the members of your team are unable to ping your PC, the firewall may be blocking those requests. This appendix describes how to create a rule in the firewall to allow ping requests. It also describes how to disable the new ICMP rule after you have completed the lab.


Step 1:     Create a new inbound rule allowing ICMP traffic through the firewall.
a.     From the Control Panel, click the System and Security option.
b.     From the System and Security window, click Windows Firewall.
c.     In the left pane of the Windows Firewall window, click Advanced settings.
d.     On the Advanced Security window, choose the Inbound Rules option on the left sidebar and then click New Rule… on the right sidebar.
e.     This launches the New Inbound Rule wizard. On the Rule Type screen, click the Custom radio button and click Next


f.      In the left pane, click the Protocol and Ports option and using the Protocol type drop-down menu, select ICMPv4, and then click Next.
g.     In the left pane, click the Name option and in the Name field, type Allow ICMP Requests. Click Finish.
 
This new rule should allow your team members to receive ping replies from your PC.
Step 2:     Disabling or deleting the new ICMP rule.
After the lab is complete, you may want to disable or even delete the new rule you created in Step 1. Using the Disable Rule option allows you to enable the rule again at a later date. Deleting the rule permanently deletes it from the list of Inbound Rules.
a.     On the Advanced Security window, click Inbound Rules in the left pane and then locate the rule you created in Step 1.
b.     To disable the rule, click the Disable Rule option. When you choose this option, you will see this option change to Enable Rule. You can toggle back and forth between Disable Rule and Enable Rule; the status of the rule also shows in the Enabled column of the Inbound Rules list.


c.     To permanently delete the ICMP rule, click Delete. If you choose this option, you must re-create the rule again to allow ICMP replies.



http://erdoganakbiyik.blogspot.com/
https://www.youtube.com/channel/UCDsUnmBfVdEPkcC8FlzPKcg

Tuesday, July 2, 2019

Introduction to Network - Course 3


2.1.4.7 Lab - Establishing a Console Session with Tera Term 

Lab - Establishing a Console Session with Tera Term
Topology
Objectives
Part 1: Access a Cisco Switch through the Serial Console Port
Part 2: Display and Configure Basic Device Settings
Part 3: (Optional) Access a Cisco Router Using a Mini-USB Console Cable
Note: Netlab users or other remote access equipment should complete only Part 2.
Background / Scenario
Various models of Cisco routers and switches are used in all types of networks. These devices are managed using a local console connection or a remote connection. Nearly all Cisco devices have a serial console port to which you can connect. Some newer models, such as the 1941 Integrated Services Router (ISR) G2 used in this lab, also have a USB console port.
In this lab, you will learn how to access a Cisco device via a direct local connection to the console port, using the terminal emulation program called Tera Term. You will also learn how to configure the serial port settings for the Tera Term console connection. After you have established a console connection with the Cisco device, you can display or configure device settings. You will only display settings and configure the clock in this lab.
Note: The routers used with CCNA hands-on labs are Cisco 1941 ISRs with Cisco IOS Release 15.2(4)M3 (universalk9 image). The switches used in the labs are Cisco Catalyst 2960s with Cisco IOS Release 15.0(2) (lanbasek9 image). Other routers, switches, and Cisco IOS versions can be used. Depending on the model and Cisco IOS version, the commands available and the output produced might vary from what is shown in the labs. Refer to the Router Interface Summary Table at the end of the lab for the correct interface identifiers.
Note: Make sure that the switch and router have been erased and have no startup configuration. If you are unsure, contact your instructor.
Required Resources
·         1 Router (Cisco 1941 with Cisco IOS software, release 15.2(4)M3 universal image or comparable)
·         1 Switch (Cisco 2960 with Cisco IOS Release 15.0(2) lanbasek9 image or comparable)
·         1 PC (Windows 7 or 8 with a terminal emulation program, such as Tera Term)
·         Rollover (DB-9 to RJ-45) console cable to configure the switch or router via the RJ-45 console port
·         Mini-USB cable to configure the router via the USB console port
You will connect a PC to a Cisco switch using a rollover console cable. This connection will allow you to access the CLI and display settings or configure the switch.
Step 1:   Connect a Cisco switch and computer using a rollover console cable.
a.     Connect the rollover console cable to the RJ-45 console port of the switch.
b.     Connect the other cable end to the serial COM port on the computer.
Note: Serial COM ports are no longer available on most computers. A USB-to-DB9 adapter can be used with the rollover console cable for console connection between the computer and a Cisco device. USB-to-DB9 adapters can be purchased at any computer electronics store.
Note: If using a USB-to-DB9 adapter to connect to the COM port, you may be required to install a driver for the adapter provided by the manufacturer of your computer. To determine the COM port used by the adapter, please see Part 3 Step 4. The correct COM port number is required to connect to the Cisco IOS device using a terminal emulator in Step 2.
c.     Turn on the Cisco switch and computer.
Tera Term is a terminal emulation program. This program allows you to access the terminal output of the switch. It also allows you to configure the switch.
a.     Start Tera Term by clicking the Windows Start button located in the task bar. Locate Tera Term under All Programs.
Note: If the program is not installed on the system, Tera Term can be downloaded from the following link by selecting Tera Term:
b.     In the New Connection dialog box, click the Serial radio button. Verify that the correct COM port is selected and click OK to continue.
c.     From the Tera Term Setup menu, choose the Serial port… to verify the serial settings. The default parameters for the console port are 9600 baud, 8 data bits, no parity, 1 stop bit, and no flow control. The Tera Term default settings match the console port settings for communications with the Cisco IOS switch.
d.     When you can see the terminal output, you are ready to configure a Cisco switch. The following console example displays the terminal output of the switch while it is loading.
Part 2:     Display and Configure Basic Device Settings
In this section, you are introduced to the user and privileged executive modes. You will determine the IOS version, display the clock settings, and configure the clock on the switch.
Step 1:   Display the switch IOS image version.
a.     After the switch has completed its startup process, the following message is displayed. Enter n to continue.
Would you like to enter the initial configuration dialog? [yes/no]: n
Note: If you do not see the above message, please contact your instructor to reset your switch to the initial configuration.
b.     While you are in the user EXEC mode, display the IOS version for your switch.
Switch> show version
Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Sat 28-Jul-12 00:29 by prod_rel_team

ROM: Bootstrap program is C2960 boot loader
BOOTLDR: C2960 Boot Loader (C2960-HBOOT-M) Version 12.2(53r)SEY3, RELEASE SOFTWARE (fc1)

Switch uptime is 2 minutes
System returned to ROM by power-on
System image file is "flash://c2960-lanbasek9-mz.150-2.SE.bin"
<output omitted>


Which IOS image version is currently in use by your switch?
c3560-advipservicesk9-mz.122-25.SEB2.bin
Step 2:   Configure the clock.
As you learn more about networking, you will see that configuring the correct time on a Cisco switch can be helpful when you are troubleshooting problems. The following steps manually configure the internal clock of the switch.
a.     Display the current clock settings.
Switch> show clock
*00:30:05.261 UTC Mon Mar 1 1993
b.     The clock setting is changed from within the privileged EXEC mode. Enter the privileged EXEC mode by typing enable at the user EXEC mode prompt.
Switch> enable
c.     Configure the clock setting. The question mark (?) provides help and allows you to determine the expected input for configuring the current time, date, and year. Press Enter to complete the clock configuration.
Switch# clock set ?
  hh:mm:ss  Current Time

Switch# clock set 15:08:00 ?
  <1-31>  Day of the month
  MONTH   Month of the year

Switch# clock set 15:08:00 Oct 26 ?
  <1993-2035>  Year

Switch# clock set 15:08:00 Oct 26 2012
Switch#
*Oct 26 15:08:00.000: %SYS-6-CLOCKUPDATE: System clock has been updated from 00:31:43 UTC Mon Mar 1 1993 to 15:08:00 UTC Fri Oct 26 2012, configured from console by console.
d.     Enter the show clock command to verify that the clock setting has updated.
Switch# show clock
15:08:07.205 UTC Fri Oct 26 2012
Part 3:     (Optional) Access a Cisco Router Using a Mini-USB Console Cable
If you are using a Cisco 1941 router, or other Cisco IOS devices with a mini-USB console port, you can access the device console port using a mini-USB cable connected to the USB port on your computer.
Note: The mini-USB console cable is the same type of mini-USB cables that are used with other electronics devices, such as USB hard drives, USB printers, or USB hubs. These mini-USB cables can be purchased from Cisco Systems, Inc. or other third-party vendors. Please verify that you are using a mini-USB cable, not a micro-USB cable, to connect to the mini-USB console port on a Cisco IOS device.
Note: You must use either the USB port or the RJ-45 port. Do not use both ports simultaneously. When the USB port is used, it takes priority over the RJ-45 console port.
Step 1:   Set up the physical connection with a mini-USB cable.
a.     Connect the mini-USB cable to the mini-USB console port of the router.
b.     Connect the other cable end to a USB port on the computer.
c.     Turn on the Cisco router and computer.
Step 2:   Verify that the USB console is ready.
If you are using a Microsoft Windows-based PC and the USB console port LED indicator (labeled EN) does not turn green, please install the Cisco USB console driver.


A USB driver must be installed prior to connecting a Microsoft Windows-based PC to a Cisco IOS device with a USB cable. The driver can be found on www.cisco.com with the related Cisco IOS device. The USB driver can be downloaded from the following link:
Note: You must have a valid Cisco Connection Online (CCO) account to download this file.
Note: This link is related to the Cisco 1941 router. However, the USB console driver is not Cisco IOS device-model specific. This USB console driver only works with Cisco routers and switches. The computer requires a reboot after finishing the installation of the USB driver.
Note: After the files are extracted, the folder contains instructions for installation, removal, and the necessary drivers for different operating systems and architectures. Please choose the appropriate version for your system.
When the LED indicator for the USB console port has turned green, the USB console port is ready for access.
Step 3:   (Optional) Enable the COM port for the Windows 7 PC.
If you are using a Microsoft Windows 7 PC, you may need to perform the following steps to enable the COM port:
a.     Click the Windows Start icon to access the Control Panel.
b.     Open the Device Manager.
c.     Click the Ports (COM & LPT) tree link to expand it. Right-click the USB Serial Port icon and choose Update Driver Software.
d.     Choose Browse my computer for driver software.
e.     Choose Let me pick from a list of device drivers on my computer and click Next.
f.      Choose the Cisco Serial driver and click Next.
g.     Note the port number assigned at the top of the window. In this sample, COM 5 is used for communication with the router. Click Close.
h.     Open Tera Term. Click the Serial radio button and choose the appropriate serial port, which is Port COM5: Cisco Serial (COM 5) in this example. This port should now be available for communication with the router. Click OK.


Reflection
1.     How do you prevent unauthorized personnel from accessing your Cisco device through the console port?
________________________________Enable password protection, encrypt/enable secret, and shutdown unused ports____________________________________________________
____________________________________________________________________________________
2.     What are the advantages and disadvantages of using the serial console connection compared to the USB console connection to a Cisco router or switch?
__________________Mini usb port is advantages better than from old system serial console connection __________________________________________________________________
____________________________________________________________________________________
Router Interface Summary
Router Model
Ethernet Interface #1
Ethernet Interface #2
Serial Interface #1
Serial Interface #2
1800
Fast Ethernet 0/0 (F0/0)
Fast Ethernet 0/1 (F0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
1900
Gigabit Ethernet 0/0 (G0/0)
Gigabit Ethernet 0/1 (G0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
2801
Fast Ethernet 0/0 (F0/0)
Fast Ethernet 0/1 (F0/1)
Serial 0/1/0 (S0/1/0)
Serial 0/1/1 (S0/1/1)
2811
Fast Ethernet 0/0 (F0/0)
Fast Ethernet 0/1 (F0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
2900
Gigabit Ethernet 0/0 (G0/0)
Gigabit Ethernet 0/1 (G0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how many interfaces the router has. There is no way to effectively list all the combinations of configurations for each router class. This table includes identifiers for the possible combinations of Ethernet and Serial interfaces in the device. The table does not include any other type of interface, even though a specific router may contain one. An example of this might be an ISDN BRI interface. The string in parenthesis is the legal abbreviation that can be used in Cisco IOS commands to represent the interface.



http://erdoganakbiyik.blogspot.com/
https://www.youtube.com/channel/UCDsUnmBfVdEPkcC8FlzPKcg

Project #3 at Java Programming

import java.lang.Math;
import java.util.Scanner;
// This program was made by Erdogan Akbiyik

/*
Project 3 Fibonacci Program - The Fibonacci sequence is a sequence of numbers that result from the collection of each number with its predecessor.
In this sequence, when the numbers are proportional to each other, the golden ratio is revealed, that is, when a number is divided by the number before
it, a sequence is obtained that is getting closer to the golden ratio.
*/

class Fibonacci
{
   public static int calculateFibonacci(int n)
   {
      double v = (Math.pow((1.0+Math.sqrt(5.0))/2.0,n)-Math.pow((1.0-Math.sqrt(5.0))/2.0,n))/Math.sqrt(5.0);
      return (int)v;
   }
   public static void main(String[] args)
   {
      Scanner keyboard = new Scanner(System.in);
      System.out.println("Welcome to Fibonacci Calculator");
      System.out.println("Please enter upper and lower bounds for range of Fibonacci values:");

      System.out.print("Lower: ");
      int lowerBound = keyboard.nextInt();
      System.out.print("Upper: ");
      int upperBound = keyboard.nextInt();
      System.out.println("Your values are:");

      for(int i = lowerBound;i<=upperBound;i++)
      {
         int value = calculateFibonacci(i);
         System.out.println(value);
      }
      System.out.println("Thanks for using my program!");

   }
}

// Sample Output:
// Fibonacci.java

// Welcome message
// Please enter upper and lower bounds for range of Fibonacci values:
// Lower:6
// Upper:12
// Your values are:
// 8
// 13
// 21
// 34
// 55
// 89
// 144
// Thanks for using program!


import java.util.Scanner;
// This program was made by Erdogan Akbiyik

/*
Project 3 PickWord Program - The purpose of this program is to find the numerical value of the word we want to find from the entered phrase.
*/

class PickWord {
   public static String pickAWord(String phrase, int index)
   {
      // While we cannot use String.split and StringTokenizer, we use for loop to find words in the phrase
      // We look up for the space character and we also control for multiple spaces int the phrase
      int currIndex = 0;
      String currWord = "";
      String lastWord = "";
      for(int i = 0; i<phrase.length();i++)
      {
         // Multiple spaces controlled and not count as a word
         if(phrase.charAt(i) == ' ')
         {         
            if(currWord != "")
            {
               //We found a word
               currIndex++;
               if(index <= currIndex) // We are going to cover zero and negative values
               {
                  return currWord;     // returning the value if its in the current index
               }
               lastWord = currWord;
               currWord = ""; 
            }       
         }
         else
         {
            currWord += phrase.charAt(i);   // we concantenate the charachter to word
         }
      }
      // If the index is greater than the word count just return the last word;
      return lastWord;
   }

   public static void main( String [] args) {
   
      Scanner phraseScanner = new Scanner(System.in);
      phraseScanner.useDelimiter ("\n");
      Scanner simpleScanner = new Scanner(System.in);
   
      System.out.println("Welcome to Word Picker");
      String response = "";
      do{
         System.out.println("Enter a phrase below please: ");
         String phrase = phraseScanner.next();
         System.out.print("Enter an index to pick word from the phrase: ");
         int index = simpleScanner.nextInt();
         String word = pickAWord(phrase, index);
         System.out.println("Picked word is : " + word);
         do {       
            System.out.print("Do you want to try again ? [y/n]: ");
            response = phraseScanner.next();
         } while(!(response.equals("y")||response.equals("n"))); //control user to enter y or n if not ask again
       
      } while(response.equals("y")); // if "y" then continue to run the program
      System.out.println("Thanks for using my program!");
   }
}   



import java.util.Scanner;
import java.lang.Math;
// This program was made by Erdogan Akbiyik

/*
Project 3 Triangle Program - The purpose of this program is created to be used to find the hypotenuse, perimeter and area of a triangle.
*/

class Triangle {
   public static double calculateArea(double a, double b)
   {
      double area = (a*b)/2.0;
      return area;
   }
   public static double calculateHypotenuse(double a, double b)
   {
      double hypotenuse = Math.sqrt(a*a+b*b);
      return hypotenuse;
   }
   public static double calculatePerimeter(double a, double b)
   {
      double hypotenuse = calculateHypotenuse(a,b);
      double perimeter = a+b+hypotenuse;
      return perimeter;
   }
   public static void main( String [] args) {
   
   
      Scanner scanner = new Scanner(System.in);
   
      System.out.println("Welcome to Right Triangle Analyzer");

      String response = "";
      do{
       
         System.out.println("Please enter the two smaller sides of the triangle as 'a' and 'b'");
         System.out.print("a : ");
         double a = scanner.nextDouble();
         System.out.print("b : ");
         double b = scanner.nextDouble();       
       
         double area = calculateArea(a,b);
         double hypotenuse = calculateHypotenuse(a,b);
         double perimeter = calculatePerimeter(a,b);
         System.out.println("Analysis of the triangle show below:");
         System.out.println("* Area: " + area);
         System.out.println("* Hypotenuse: " + hypotenuse);
         System.out.println("* Perimeter: " + perimeter);
       
         do {       
            System.out.print("Do you want to calculate again ? [y/n]: ");
            response = scanner.next();
         } while(!(response.equals("y")||response.equals("n"))); //control user to enter y or n if not ask again
       
      } while(response.equals("y")); // if "y" then continue to run the program
      System.out.println("Thanks for using my program!");
   }
 
}   



http://erdoganakbiyik.blogspot.com/
https://www.youtube.com/channel/UCDsUnmBfVdEPkcC8FlzPKcg