Tuesday, June 19, 2012

Intro To Ethernet Cabling


Different cabling standards are used some of the standards defined by EIA/TIA are
cabling standard Intro To Ethernet Cabling   Introduction To OSI Layer Model    The Internetworking Part4
10Base2-This is 10 MBPS baseband technology and can have length up to 185 meters .Maximum supported workstations can be 30.It is also called thinnet.AUI connectors are used to connect devices the segment
10Base5-This is also 10MBPS baseband connection and can have length upto 500 metres.It is called thicknet.Also used AUI connectors
10BaseT-It Uses 3 UTP wire and we need a switch or hub in this technology .Only device can connect to one segment using rj45 jacks.
100BaseTX-Uses CAT5 or later cables .It also supports one user per segment but with 100mbps speed. Physical star topology and logical bus.
100BaseFx-Uses multimode fiber. Max length can be 412 meters
1000BaseCX-Copper twisted pair cable can be upto 25 metres

Types of Cables
1.)Straight-
straight cable Intro To Ethernet Cabling   Introduction To OSI Layer Model    The Internetworking Part4
This type of cable is used to connect devices like Pc to Switch or router to switch. In real time only 4 wires are necessary .PIN 1,2,3 and 6 are two receiving and transmitting pairs.Connecting 1-1,2-2,3-3 and 6-6 will make connect your pc to hub or switch but it wont work with any other thing like voice or isdn
2.)Crossover Cable-
crossover cable Intro To Ethernet Cabling   Introduction To OSI Layer Model    The Internetworking Part4
This type of cable is used to connect devices of same type .like
Switch to switch or hub to hub etc .
3.)Rollover cable-
rollover cable Intro To Ethernet Cabling   Introduction To OSI Layer Model    The Internetworking Part4
It is a special cable it looks like an Ethernet cable but its function is to connect the router or switch using serial comm. Port with the help of DB9/25 or rs232 adapter.

Introduction To OSI Layer Model – The Internetworking Tutorial


Introduction to OSI layer model – The inter networking.
Why we need a model for inter networking . If a model has a flaw why cant we just change the model according to our needs and then use it . This is what WE do while coding but this is not in case of networking.
Imagine you being an English reader and I am writing this article in French. Will you be able to understand it . Probably not .This is the same case with networks they need to work on the same architecture through.
In the earlier days of internet there was no defined model for networking which was a pain in the neck (I wanted to use something else in place of neck but icon smile Introduction To OSI Layer Model    The Internetworking Tutorial Part1 ) So OSI(Open System Interconnect came up with A layered approach .Which was consistent for all and it divided the network architecture into 7 layers .Why we needed a division . Hmmm consider a post office . The post office is divided into several departments one receives the parcel and add some info to it . The next department parses the parcel based on the info from previous department and send it to the higher department. If the parcel reaches directly to second department it cannot process as it needs some information which can only be present if it comes visa department1. All the work can be done by a single department also but it will lead to a disastrous situation. It is just like a man who is working as a peon , clerk, manager accountant etc a one man army example
Similarly this division was necessary for networking . The 7 layers were Application, Presentation, Session, Transport, Network, Data Link, and Physical . CHEAT SHEET( Please Do Not Take Sausage Pizza Away ) .The first letter of each word is the starting character of a layers name but in opposite order .Each OSI Layerprovide services to the layer above it and receives service from the layer below it.Same as I mentioned in the above example.
Introduction To OSI Layer Model The Internetworking Tutorial Part1 Introduction To OSI Layer Model    The Internetworking Tutorial Part1
Application layer:-The top most layer of OSI .Generally people say that http,ftp etc are example of application layer but actually they are application programs they act as an interface with the application layer .The primary role of the application layer is that it checks resource usability and synchronization with the remote partner.There is no layer above it so it doesn’t have to server anyone.
Presentation Layer:- The function of this layer is very critical as it provides encryption services .for eg consider a connection between a MAC and PC , MAC might be using some other data format like(EBCDIC) and PC using ASCII , so this layer converts the data into standard form so that it can be understood irrespective of the Host machine. Other service apart from encryption are decryption,data compression and decompression
Session layer:- This layer establishes the connection with the remote machines.The mode of communication like simplex,duplex or half duplex is decided at this layer.It also separates the data of different applications from each other .
Transport Layer:- The transport layer is responsible for S&R also called segmentation and reassembly .The data from upper layers is combined together and sent as a single data stream .In broad terms end to end data transport .It used 2 protocols TCP and UDP. To make the connection reliable it is combined with techniques like Flow Control,Windowing,Acknowledgments, re transmission and Not ready stop(Discussed later)
Network Layer:-This layer basically is used for routing .It tracks location of devices (they belong to which network).Data travels into form of packets data packets and route update packets.
Data Link Layer:-This layer is divided into 2 parts the upper part being the LLC(Logical Link Control)And the lower being MAC(Medium Access control).The DLL deals with movement of data on Local area networks .The data movement is in forms of frames and forwarded on the basis of Hardware address called the MAC address
Physical Layer:- This layer defines the specifications of data transmission , the data travels in form of digital signal eg 01110001000. The real transmission takes place here i.e. traveling through a medium whether Cable,fiber or Air.

How to Setup SSH Access on a Cisco Router for Security


How to Setup SSH Access on a Cisco Router for Security
Telnet connections is not secure the data sent via telnet can be read by a packet sniffer and decoded so it is a security breach . We should avoid using telnet at all the times . we can enable ssh on cisco routers
We need to login to global configuration mode. The first criteria is to set a domain name and hostname of the router on the basis of which the RSA key is generated.
Router(config)#hostname Akash
It sets the username of the cisco router to Akash
Akash(config)#username Akash password abc
This sets the username to akash and password to abc
Akash(config)#ip domain-name routemybrain.com
Akash(config)#crypto key genrerate rsa general –keys modulus 1024
It generates an RSA key of 1024 bits we can set it upto 2048 bits
Now after generating the keys we need to make sure we setup some extra stuff like idle time out and maximum retries
Akash(config)#ip ssh time-out 60
This time out is in seconds
Akash(config)#ip ssh authentication-retries 2
Akash(config)#line vty 0 184
It selects all the lines available . If you leave a single line open hackers can exploit that
Akash(config-line)#transport input ssh telnet
This last command is very important it enables telnet and ssh both but if you want to just enable ssh on the cisco router type
Akash(config-line)#transport input ssh


How to Upgrade IOS on a Cisco Router


When would you need this: The upgrade is required when you plan to add more duties to the router or new hardware. The installation is required when the IOS image you have on the router is corrupted.
Special Requirements: The router’s flash size should be enough for the new IOS image.
Before starting the procedure of IOS upgrade or installation, you will need to install TFTP server software on a PC connected to the router Ethernet interface. There are many free downloadable TFTP servers’ software on the Internet, however, our recommendation is Free TFTP Server 6.0.
Afterwards, you make sure to direct the TFTP server to the folder containing the new IOS image that you have.
We will put down two procedures for two different type of routers; a procedure for routers having Internal Flash (ex: 2600), and a slightly different procedure for routers with PCMCIA flash cards (ex: 3600).

Upgrade Procedure for Cisco Routers with Internal Flash:
1. Create a console connection with the default settings (9600 baud, 8 databits, 0 parity bits, 1 stop bit, no flow control).
2. Verify the connectivity between the router and the TFTP server using ‘ping’. Make sure that the router interface and the TFTP server IP addresses are in the same range and the ping is responding well.
3. Although the upgrade will be happening in the flash and the configuration is saved in the NVRAM, make a backup of the configuration. This is recommended in case something goes wrong in the upgrade. Also, make a backup copy of the IOS you already have on the router. In case the new IOS image is corrupted, you will be on the safe side. For the backup process, please refer to the IOS backup procedure and configuration backup procedure.
4. Start the upgrade by the command:
Router#copy tftp flash
Now you will be prompted for the IP address of the TFTP server:
Address or name of remote host []? XXX.XXX.XXX.XXX
Afterwards, you will be asked for the name of the new IOS file being copied from the TFTP server:
Source filename []? cXXXX-X-XX.XXX-XX.bin
Please note that the file name is case sensitive, so be %100 sure of what you are writing.
Now you will be asked for the destination file name on your router,
Destination filename []? cXXXX-X-XX.XXX-XX.bin
It is preferred to keep it as the source file name, to be able to easily identify the files on the TFTP servers as compared to the ones on the routers.
Now you will be asked whether to erase the existing file(s) in the flash or not. If you have enough free space on the flash, don’t erase the old IOS image, you might need it.
Erase flash: before copying? [confirm]
Afterwards, the router starts copying the new IOS file to the router, or start erasing the flash and then copying.
Erasing the flash filesystem will remove all files! Continue? [confirm]y
Erasing device… eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeee …erased
Erase of flash: complete
Loading cXXXX-X-XX.XXX-XX.bin from XXX.XXX.XXX.XXX (via Ethernet0/0): !!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - xxxxx/yyyyyyy bytes]

Verifying checksum…  OK (0xAC8A)
xxxxxx bytes copied in xx.xx secs (yyyy bytes/sec)
The copying process takes several minutes; the time differs from network to network. During the copy process, messages are displayed to indicate which file has been accessed.
The exclamation point “!” indicates that the copy process is taking place. Each exclamation point indicates that ten packets have been transferred successfully. A checksum verification of the image occurs after the image is written to flash memory.
5. Before reloading the router, you need to make sure of two things. The first is that the configuration register value is 0×2102. You can check that wit the ‘show version’ command. If the configuration register’s value is not 0×2102, you will need to set it to that value with the following command:
Router(config)#config-register 0×2102
The second thing is needed to be checked if you did not erase the contents of the flash. You will need to setup the router to boot from the new IOS file with the following commands:
Router(config)#no boot system
Router(config)#boot system flash cXXXX-X-XX.XXX-XX.bin



6. If you type the reload command, the router asks you if you want to save the configuration. You should be very cautious here. The reason is that if the router is in boot mode for instance, it is a subset of the full Cisco IOS software which is running and there is no routing functionality. Therefore, all the routing configuration is gone in the running configuration and if you save the configuration at this time, then you erase the good startup-configuration in NVRAM and replace it by the incomplete running-configuration. Save the configuration only if you are sure that you have the full configuration in the output of show run. It is NOT necessary to save the configuration to take into account the new config-register if this one has been changed previously. That is done automatically.
Router#reload
System configuration has been modified. Save? [yes/no]: y 
Building configuration…
[OK]
Proceed with reload? [confirm]y
7. To verify that the new image is loaded after the ‘reload’, use ‘show version’ command.
00:22:25: %SYS-5-CONFIG_I: Configured from console by console
Cisco Internetwork Operating System Software 
IOS ™ CXXXX Software (CXXXX-X-X), Version XX.X(XX), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Mon 25-Mar-02 20:33 by xxxxx
Image text-base: 0×80008088, data-base: 0×80828788

ROM: System Bootstrap, Version xx.x(x)XA4, RELEASE SOFTWARE (fc1)

XXXX uptime is 22 minutes
System returned to ROM by reload
System image file is “flash: cXXXX-X-XX.XXX-XX.bin “     <<< Check it here

Note: In step 1 or after the upgrade, if the router boots into rommon mode or boot mode and you have one of the following case:
rommon 1 > dir flash: 
device does not contain a valid magic number 
dir: cannot open device “flash:” 
rommon 2 >
or
router(boot)>
device does not contain a valid magic number
boot: cannot open “flash:”
boot: cannot determine first file name on device “flash:”
This means that the flash is empty or the file system is corrupted. In this case, you have to consider using the procedure of Upgrading or Installing the IOS from ROMmon mode .
  
Upgrade Procedure for Cisco Routers with PCMCIA Flash:
1. Create a console connection with the default settings (9600 baud, 8 databits, 0 parity bits, 1 stop bit, no flow control). If your router does not boot regularly, refer to the note above.
2. Check if you have enough space in the flash card for the new IOS file:
Router#dir slot1:
If you find that there is not enough space, you can delete one or more files from the flash:
Router#delete slot1: FILENAME.bin
If you delete on or more files from the flash DO NOT reload or powercycle the router until you finish this procedure. The flash image you are working on is currently loaded into RAM, so you can keep working properly until you reload or powercycle the router.
3. Verify the connectivity to the TFTP sever with the ‘ping’ command. And make sure that the TFTP server software is running and the working directory of the TFTP server contains the new IOS file. It is also adviced that you backup the configuration and old IOS file before proceeding. For this purpose, you can refer to IOS backup procedure and configuration backup procedure.
4. Copy the new IOS file from the TFTP server to the router:
Router#copy tftp slot1:
Address or name of remote host []? XXX.XXX.XXX.XXX
Source filename []? cXXXX-X-XX.XXX-XX.bin
Destination filename [cXXXX-X-XX.XXX-XX.bin]?
Accessing tftp://XXX.XXX.XXX.XXX/cXXXX-X-XX.XXX-XX.bin…
Erase slot1: before copying? [confirm]n     <<< You can say ‘no’ here because you have already emptied space for the new IOS file
Loading cXXXX-X-XX.XXX-XX.bin from XXX.XXX.XXX.XXX (via Ethernet1/0): 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!
[OK - xxxxxxx/yyyyyyy bytes]

Verifying checksum…  OK (0x13F0)
xxxxxxx bytes copied in 67.708 secs (zzzz bytes/sec)
Router#
5. Verify the new IOS file in the flash car:
Router#dir slot1:
6. Direct the router to load the new IOS file in the next boot:
Router(config)#no boot system
Router(config)#boot system flash slot1:cXXXX-X-XX.XXX-XX.bin
7. Make sure that the configuration register has the value of 0×2102. This is verified by the ‘show version’ command. If the configuration register has a value other than 0×2102, use the following command to change it:
Router(config)#config-register 0×2102
8. Save the configuration with one of the two following commands:
Router#write memory
Or
Router#copy run start
9. Reload the router with ‘reload’ command. And after the reload, verify the new IOS version with the ‘show version’ command. This command will also show you the name of the IOS file that has been loaded.

Extended IP Access Control List and Configuration.


Extended IP Access Control List

RouterA(config)#access-list 103 remark stop telnet to router A whose source ip 1.1.1.2

RouterA(config)#access-list 103 deny tcp host 1.1.1.2 host 1.1.1.2 eq 23
RouterA(config)#access-list 103 permit ip any

RouterA(config)#int s0/0
RouterA(config-if)#ip access-group 103 in

RouterA#show access-lists
Extended ip access list 103
Deny tcp host 1.1.1.2 host 1.1.1.1 eq telnet(2 matches)
Permit ip any (160 matches)

Standard IP Access Control List.


RouterA#configure terminal
RouterA(config)#access-list 1 remark stop all traffic whose source ip 1.1.1.2
RouterA(config)#access-list 1 deny 1.1.1.2 0.0.0.0
RouterA(config)#access-list 1 permit any

RouterA(config)#int s0/0
RouterA(config-if)#ip access-group 1 in

RouterA#show access-lists
Standard IP access list 1
Deny 1.1.1.2
Permit any

Now verify these configuration on router with command us under:
RouterA#show ip int s0/0

RouterB#ping

Router basic Troubleshooting Tips


Router A# show interface serial0 
Serial is up line protocol is up, it is the first message that shows us that your serial port is configure properly. It is just possible when you have already given IP address, run no shutdown and configures some other command. 
There are some possible errors messages may occur after the command is given. 
Serial is up line protocol is down, it means that check your router encapsulation configuration. 
Serial is down, line protocol is down.
  • You have not given or define clock rate.
  • Cable not connected or not working.
  • Serial cable is not plug. Possible causes.
Serial is administratively down line protocol is down. 
It means that router is shut down by administrator manually for troubleshooting purpose.