Showing posts with label ccna. Show all posts
Showing posts with label ccna. Show all posts

Sunday, April 9, 2017

WAN (Wide Area Network)

WAN Network
WAN is use to connect network of different geographical areas.
CSU/DSU is a device use in wan, CSU stand for channel service unit. DSU stand for data service unit.

CSU/DSU is use for avoiding local loop.
WAN Technologies: leased line, circuit switching, and packet switching.
  1. Leased line technology: in this technology two routers can connect purchased a dedicated line. i.e. E1, T2, T3. E1 line provides 2.048 mbps speed. T2 line provides 1.544 mbps speed. T3 line provides 45 mbps speed. Advantage of leased line: always available. Disadvantage: it is very expensive.
  2. Circuit switching technology: work on physical circuit same as telephone line. In circuit switching wireless modem and ISD are used. ISDN (integrated services digital network).
  3. Packet switching technology: work on virtual circuit, in this logical bandwidth is build. Same as road/highway which are divided logically.
Types of virtual circuit:
  • Permanent virtual circuit (PVC): same as leased line but it is not dedicated; frame relay is use in (PVC)
  • Switch virtual circuit (SVC): same as ISDN, ATM is use in switch virtual circuit (SVC)
WAN Protocols: HDLC (high level data link control), PPP (Point to Point Protocol), Frame Relay.
HDLC: always use in leased line, data link layer protocol. HDLC is CISCO proprietary protocol; provide no security (authentication).
To change protocol: Router(config)# interface s0/0
Router(config-if)# encapsulation PPP
PPP: Support multi vendors (CISCO, Juniper etc), can work on lease line and circuit switching. PPP provide security (authentication) for authentication two protocols are used.
  • PAP (password authentication protocol): send user name and password in plain text form.
  • CHAP (challenge handshake authentication): send user name and password in encrypted form.

PPP consist of two ports: LCP (link control protocol), NCP (network control protocol).
LCP perform following task: connection establishment, compression, authentication, multi-link.
NCP allow multiple routed protocols to send data.
PPP configuration:
Router1(config)# hostname Branch
Branch(config)# enable secret CISCO
Branch(config)# username Head password icne@123
Branch(config)# interface serial 0/0
Branch(config-if)# encapsulation PPP
Branch(config-if)# ppp authentication pap/chap
Branch(config-if)# ip address 10.0.0.1 255.0.0.0
Branch(config-if)# no shutdown
Branch(config-if)# clock rate 64000
Router2(config)# hostname Head
Head(config)# enable secret Microsoft
Head(config)# user name Branch Password icne@123
Head(config)# interface serial 0/0
Head(config-if)# encapsulation ppp
Head(config-if)# ip address 10.0.0.2 255.0.0.0
Head(config-if)# no shutdown
Frame Relay: Frame relay is a packet switching technology, frame relay use a packet switching type called PVC. Frame relay use a number called DLCI (Data link connection identifier).
DLCI use to identify PVC connection, in frame relay leased line but not dedicated.
Encapsulation: Frame relay (only use on CISCO routers), IETF (Globally used).
LMI (local management interface): through LMI packets are share between frame relay routers and switches.
LMI Types: CISCO LMI (use only on CISCO routers)
ANSI LMI (Globally used).

Frame relay configuration
Router1(config)# interface s0/0/0
Router1(config-if)# no ip address
Router1(config-if)# no shutdown
Router1(config-if)# encapsulation frame-relay
Router1(config)# interface s0/0/0.102 point-to-point
Router1(config-router1)# ip address 1.1.1.100 255.255.255.0
Router1(config-router)# bandwith 64
Router1(config-router1)# frame-relay interface-dlci 102
Router1(config-router1)# frame-relay lmi-type cisco, ansi, q933a (optional)
Router1(config)# interface s0/0/0.103 point-to-point
Router1(config-router1)# ip address 2.2.2.100 255.255.255.0

Router1(config-router1)# bandwith 64
Router1(config-router1)# frame-relay interface-dlci 103
Router1# show frame-relay lmi or show frame-relay pvc or show frame-relay map
Router2(config)# interface s0/0/0
Router2(config-if)# encapsulation frame-relay
Router2(config-if)# no ip address
Router2(config-if)# no shutdown
Router2(config-if)# interface s0/0/0.201 point-to point
Router2(config-router2)# ip address 1.1.1.1 255.255.255.0
Router2(config-router2)# bandwith 64
Router2(config-router2)# frame-relay interface-dlci 201
Router3(config)# interface s0/0/0
Router3(config-if)# encapsulation frame-relay
Router3(config-if)# no ip address
Router3(config-if)# no shutdown
Router3(config-if)# interface s0/0/0.301 point-to-point
Router3(config-router3)# ip address 2.2.2.2 255.255.255.0
Router3(config-router3)# bandwith 64
Router3(config-router3)# frame-relay interface-dlci 301
Routing on frame-relay:
Router2(config)# router rip
Router2(config-router)# network 1.1.1.0
Router3(config)# router rip
Router3(config-router)# network 2.2.2.0
Router1(config)# router rip
Router1(config-router)# network 1.1.1.0
Router1(config-router)# network 2.2.2.0
Cloud configuration:
Config > serial1 > lmi (cisco) > dlci (201) > name (r2 to r1) > add.
Serial2 > lmi (cisco) > dlci (301) > name (r3 to r1) > add.
Serial3 > lmi (cisco) > dlci (102) > name (r1 to r3) > add.
Serial3 > lmi (cisco) > dlci (103) > name (r1 to r3) > add.
Frame-relay > select here their paths.
Using DNS to resolve names:
Router(config)# ip domain-lookup
Router(config)# ip name-server 192.168.1.50
Router(config)# ip domain-name corvit.com
Router# ping router2 or show processes
Backup and Restore IOS:
Backup:
Router# show version or show flash (remember the IOS name)
Router# copy flash tftp
Source file name []? Give name of the IOS
Address or name of remote host [] 10.0.0.100
Destination file name [] any
Restore:
Router# copy tftp flash
Router# copy tftp startup-config
Router and Switch configuration software: Hyper terminal, Teraterm (SSH), Secure CRT, Putty.
Switch(config)# interface VLAN 1
Switch(config-if)# ip address 1.1.1.1 255.0.0.0
Switch(config-if)# no shutdown
And give default gateway.
Banner motd: banner is message of the day.
Switch(config)# banner motd @don’t login to the router, if you are not authorized@ > enter
Description:
Switch(config)# interface f0/0
Switch(config-if)# description This is IT department line
SSH (Secure shell):
Switch(config)# aaa new-mode
Switch(config)# username ali password corvit
Switch(config)# ip domain-name Kabul.com
Switch(config)# crypto key generate rsa general-key modelus 1024
Switch(config)# ssh version 2
Switch(config)# line vty 0 4
Switch(config-line)# transport input ssh telnet
Router# show ip arp
Cmd: route print , cmd: tracert –d yahoo.com
To give privilege exec mode permission to users:
Router(config)# line vty 0 4
Router(config-line)# login local
Router(config-line)# transport input telnet
To give permission to one user:
Router(config)# username Ali privilege 15 password CISCO
Router# show run | include network
Router# dir all (shows all memories partitions and IOS).
IP OSPF Authentication key:
Router1(config)# interface s0/0/1
Router1(config-if)# ip ospf authentication
Router1(config-if)# ip ospf authentication-key icne@123
Router1(config)# service password-encryption
Router2(config)# interface s0/0/0
Router2(config-if)# ip ospf authentication
Router2(config-if)# ip ospf authentication-key icne@123
Router2(config-if)# service password-encryption
Note: we must configure the authentication-key command on each port of router, to authenticate. Now without authentication router can’t share its routing table with neighbors.
Internet and VPN (virtual private network):
Advantages: lower cost, security, scalability. Data sends in tunnel by encrypted form, using public network as private network.
Two types of VPN: Site to Site VPN, Remote access VPN.
Note: in remote access VPN, user will install a software by name (CISCO easy VPN) or secure socket layer (SSL) on his laptop.
Redundancy FHRP Technologies:
HSRP (Hot-standby redundancy protocol): CISCO introduced in 1994, hello timer 3 sec, hold timer 10 sec.
Virtual load balancing, Version1 mac(07:ac). Version2 mac(DC:9F).
If R1 wan link were down how R2 know to become active? We will give a command to R1 to decrement priority value. Ex: -20
The higher priority router will be active and second router will be standby.
If R2 3hello packets not received then R2 will be active.
Router1(config)# interface f0/0
Router1(config-if)# standby 1 ip 1.1.1.1 (1 is the group number it will be same on both side)
Router2(config)# interface f0/0
Router2(config-if)# standby 1 ip 1.1.1.1

Router1# show standby brief (router1 changed status to  active and router2 status changed to standby mode.
Router1(config-if)# standby preempt
To change priority:
Router1(config-if)# standby 1 priority 130
Router1(config-if)# standby version 2
When WAN link were down:
Router1(config-if)# standby 1 track s0/0 20
Router2(config-if)# standby 1 preempt
GLBP (Gateway load balancing protocol): CISCO introduced in 2005. AVG (Active virtual gateway), it will reply to all ARP requests for the virtual ip addresses.
AVF(Active virtual forwarder), if Router1 down, the AVF will active the next higher priority router.
If all routers have same priority, then the higher gateway address routers will be AVG.
Router1(config)# interface s0/0
Router1(config-if)# ip address 20.20.20.2 255.255.255.0
Router1(config-if)# no shutdown
Router1(config)# interface f0/1
Router1(config-if)# ip address 1.1.1.2 255.255.255.0
Router1(config-if)# no shutdown
Router2(config)# interface s0/0
Router2(config-if)# ip address 30.30.30.3 255.255.255.0
Router2(config-if)# no shutdown
Router2(config)# interface f0/1

Router2(config-if)# ip address 1.1.1.3 255.255.255.0
Router2(config-if)# no shutdown
Router3(config)# interface f0/1
Router3(config-if)# ip address 1.1.1.4 255.255.255.0
Router3(config-if)# no shutdown
Router1(config)# interface f0/1
Router1(config-if)# glbp 1 ip 1.1.1.1
Router2(config)# interface f0/1
Router2(config-if)# glbp 1 ip 1.1.1.1
Router3(config)# interface f0/1
Router3(config-if)# glbp 1 ip 1.1.1.1
Router3# show glbp
Router(config-if)# glbp 1 load-balancing weighted
Router(config-if)# glbp 1 authentication md5 key-string cisco
Router(config-if)# glbp 1 weighting 110 lower 80 upper 90

Saturday, April 8, 2017

Introduction to Cisco switch

Cisoc Switch
Switch is a central device for all computers, switch work on datalink layer of OSI model.
Switch functions: address learning, forward/filtering decision, loop avoidance.
  1. Address learning: in address learning switch will find the mac address of every machine
  2. Forwarding/filtering decision: in filtering the data send to specific machine
  3. Loop avoidance: Loop (the process which repeats again and again is called loop. Avoidance (means removing or stopping through STP and RSTP protocol. Ex: switch#show spanning-tree
Switching: Switching is a process to move the data on the basis of hardware or MAC address.
Data link layer is responsible for switching; data link layer devices are switch and bridge.
ARP (address resolution protocol): ARP is use to find the address from known IP. Ex: cmd: arp –a
Switch# show mac-address-table
Cisco discovery protocol (CDP): CISCO proprietary protocol, works on layer2 (data link layer). Use to find detail information of neighbor device, sends updates every 60 seconds.
Switch# show cdp neighbors
Switch# show cdp entry
Switch# show cdp neighbor’s detail
STP (spanning tree protocol): STP is use to avoid ARP loop. In STP there is secondary path which is always down. Secondary is up where primary is down.
BPDU (bridge protocol data unit): Packet use to share information between switch and STP.
STP secondary link steps:
Step1: select a route bridge, (it is a focal point and decision making switch, which acts as a master for all other switches.
Every switch has priority number, switch have lower priority it will be our bridge. To view switch priority: switch# show spanning-tree
 If priority number is equal, every switch has a mac address a switch with a lower mac address will be our route bridge.
To change the priority number: switch(config)# spanning-tree vlan 1 priority 300 every port of root bridge will be designated port, and it will never block in any condition.

Step2: select root port, is a port of Non-root Bridge. Root port will be selected by cost.
Bandwidth:                             Cost:
10 mbps                                   100
100 mbps                                 19
1Gbps                                        4
10Gbps                                      2
To change cost: switch(config)# interface f0/1
Switch(config-if)# speed 10
Step2: block the redundant link every port (interface) has mac address. The port with higher mac address will be blocked a port in a blocking mode can’t perform any action, except sending and receiving BPDU.
If primary link down a new step, will be started to continue the communication. How the redundant link will know that primary is down? When primary is down either by unplugging or in cause of any damages, secondary or redundant link will follow a few steps to be up.
Step4 startup mode: blocking mode 20 seconds (waiting for primary may be up).
Listening mode 15 seconds (communicating with BPDU).
Learning mode 15 seconds (forwarding mode, startup mode).
How to create switch2 as a root bidge ?
We must decrease the priority of switch2 to make as a root bridge.
Switch2(config)# spaning-tree VLAN1 priority 4096 Or
Switch2(config)# spaning-tree VLAN1 root primary
Switch2# show spaning-tree
Rapid STP (RSTP):
Switch1(config)# interface f0/1
Switch1(config)# spanning-tree port fast
Switch2(config)# interface f0/1
Switch2(config)# spanning-tree port fast
Now run this command on all switches:
Switch1(config)# spanning-tree mode rapid-pvst
Switch2(config)# spanning-tree mode rapid-pvst
Switch3(config)# spanning-tree mode rapid-pvst

Note: after RSTP commands, when the primary path down, the secondary will be up without taking 30 seconds time.
VLAN (virtual LAN): VLAN is a group of ports in which computer can only communicate with their own group members.
Advantage of VLAN: Security will be increased, broadcast will be break.
Two types of VLAN:
Static VLAN: in which ports are manually added.
Dynamic VLAN: in which ports are created by using Mac addresses.
Two ports of VLAN:
Access port: access port carries its own VLAN data.
Trunk port: use to connect two different VLAN.
Switch(config)# vlan 10
Switch(config-vlan)# name sales
Switch(config)# vlan 20
Switch(config-vlan)# name IT
Switch(config)# vlan 30
Switch(config-vlan)# name HR
Switch(config)# interface f0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
To add more interfaces in a vlan:
Switch(config)# interface range fastethernet 0/1 – 5
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
To add different interfaces in a vlan:
Switch(config)# interface range fastethernet 0/1 , fastethernet 0/4 , fastethernet 0/13
Switch(config-if-range)# switch mode access
Switch(config-if-range)# switchport access vlan 10
Switch# show vlan
VTP (VLAN Trunking protocol): Use to share VLAN information between different switches.
VTP modes: Server mode, Client mode, transparent mode.
Server mode: it is a default mode of every CISCO catalyst switch.
In this mode you can create, delete, and modify VLAN. All VTP information advertised from server to client, in this information are stores in NVRAM.
Client mode: in this mode you can’t create, delete, and modify information are stores in RAM. VTP information sends by VTP server.
Transparent mode: in this mode we create, and delete VLAN. In this mode it has its own database, can’t store VTP information, and send by VTP server.
VTP Configuration:
Switch1(config)# VTP mode server
Switch1(config)# VTP domain corvit
Switch1(config)# VTP password icne@123
Switch1(config)# interface f0/6
Switch1(config-if)# no shutdown
Switch1(config-if)# switchport mode trunk
Switch1# show VTP status
Switch2(config)# VTP mode transparent
 Switch2(config)# VTP domain corvit
Switch2(config)# VTP password icne@123
Switch2(config)# interface range fastethernet 0/6 , fastethernet 0/5
Switch2(config-if-range)# switchport mode trunk
Switch3(config)# VTP mode client
Switch3(config)# VTP domain corvit
Switch3(config)# VTP password icne@123
Switch3(config)# interface fastethernet 0/6
Switch3(config-if)# switchport mode trunk
How to break Router password ?
Step1: reboot the router, when reboot click (ctrl+break) to restrict the router booting from NVRAM, to boot from RAM.
Step2: change that confreg value, i.e. 0x2102
Rommon1> confreg 0x2142
Rommon2> reset
Router(config)# no enable secret or no enable password
Router(config)# config-register 0x2102
Router# copy run start
Router# reload
Inter VLAN routing or router on stick:
Router(config)# interface f0/0
Router(config-if)# no shutdown
Router(config)# interface f0/0.1
Router(config-sub-if)# encapsulation dot1q 10 (vlan 10)
Router(config-sub-if)# ip address 10.0.0.100 255.0.0.0
Router(config)# interface f0/0.2
Router(config-sub-if)# encapsulation dot1q 20
Router(config-sub-if)# ip address 200.0.0.100 255.255.255.0
Router# show ip route
Port security:
Switch(config)# interface f0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security mac-address sticky
Switch(config-if)# switchport port-security maximum 1
Switch(config-if)# switchport port-security violation shutdown
Switch# show port-security
Switch# show port-security address
Switch# show port-security interface f0/1
Switch# show mac-address-table

Friday, April 7, 2017

Cisco Router

Introduction to Router
Router is a device which route the packet across different networks.
Router works on layer3 (network layer).
Router performs four functions, which are packet filtering, packet switching, path selection and internetwork communication.
IOS: internetwork operating system. IOS is an operating system which runs CISCO routers and switches. It is CISCO proprietary IOS.
RAM: Current configurations are store in ram.
NVRAM: Startup configurations are store in nvram. (non volatile, non changeable).
FLASH: IOS are store in flash.
ROM: Minuring of IOS are store in rom.
Router boot process:
Step1: Post (power on self test).
Step2: Boot up/operating system or loading IOS from flash.
Step3: Stop for some time (checking nvram).
Step4: Setup mode/dialogue/auto configuration mode, starts yes no questions to configure.
Router configuration:

Console port + computer com port (communication, open putty software then select serial and open.
Router prompt modes:
Router>: user mode. Here we can’t give any commands only enable. Enable (from this command it come to privilege mode.
Router#: privilege mode. Here we check network connectivity and show command. Configure terminal (from this command it come to global configuration mode.
Router(config)#: global mode. Here we can give any configuration commands. To go pervious, CTRL+Z, exit or end.
  Password: 1. Plain password. 2. Secret password.
  • Plain password: stores password in plain text form
        Ex: Router(config)#enable password ccna
  • Secret password: store password in encrypted form
        Ex: Router(config)#enable secret ccna
To delete password: Router(config)#no enable secret or password.
Show commands:
Router# show running-configuration (shows current configurations).
Router# show startup configuration (shows nvram configurations).
Router# show clock (shows current time and date).
Router# show history (shows given command list).
Router# show version (shows version of IOS).
Router# show flash (shows where IOS are stored).
Router# show ip interface brief (shows given ip addresses to interface).
Router# show controllers (shows DTE and DCE sides clock rate).
Different lines use to configure Router:
Console line 0 = 1. Auxiary line (aux) 0 = 1. Virtual terminal (vty) 0 4 = 5.
  • Console line:
Router(config)# line console 0
Router(config-line)# password corvit
Router(config-line)# exec-timeout 10
Router(config)# login
  • Auxiliary line:

Router(config)# line aux 0
Router(config-line)# password ccna
Router(config)# login
Virtual terminal line (vty):
Router(config)# line vty 0 4
Router(config-line)# password ccnp
Router(config)# login
Note: all these passwords stores in plain text form so by service password-encryption command it will encrypt all running and future passwords. Ex: Router(config)# service password-encryption.
Routing
Routing is a process to define path toward destination network.
Router is responsible for routing. Routing process work on layer3 (network layer).
Routing table: In routing table network ID of networks are stores.
Types of routing: Static routing, Default routing, Dynamic routing.
 Static routing and default routing done by administrator.
Dynamic routing uses different routing protocols. Ex: RIP, IGRP, EIGRP, ISIS, OSPF, BGP, etc.
Static routing: in static routing administrator itself define the path toward destination network
Router1(config)# ip route 192.168.0.0 255.255.255.0 10.0.0.2
Router2(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.1

Default routing: in default routing two routers are used, stub router and transit router.

  • Stub router: that router in which the next hope address is same for all destination networks is called stub router
  • Transit router: that router in which the next hope address is different for destination network is called transit router
Stub router1(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.2
Transit router(config)# ip route 192.168.0.0 255.255.255.0 10.0.0.1
Transit router(config)# ip route 192.168.10.0 255.255.255.0 20.0.0.2
Stub router2(config)# ip route 0.0.0.0 0.0.0.0 20.0.0.1

Dynamic routing: that routing protocol which works on dynamic routing protocol, dynamic routing protocols are those which itself finds path its destination networks.
Three Categories of dynamic routing protocols:
  • Distance vector routing protocol (DVRP). Use: RIP, IGRP
  • Link state routing protocol. Use: OSPF
  • Hybrid routing protocol. Use: EIGRP
Distance vector routing protocol (DVRP):
DVRP exchange their routing table periodically to their neighbors.
DVRP broadcast the routing table, DVRP share their routing table on 255.255.255.255.
RIP (routing information protocol): RIP works on DVRP, global protocol. Calculate cost or metric by calculating no of hops.
Class full routing protocol so doesn’t support of VLSM. Maximum hops 15. RIP configures different routers. Ex: CISCO and Jenifer.
Router1(config)# router rip
Router1(config)# network 192.168.0.0
Router1(config)# network 10.0.0.0
Router2(config)# router rip
Router2(config)# network 192.168.10.0
Router2(config)# network 10.0.0.0
Router# show ip rip database or show ip route or show ip protocol.

Router# debug ip rip  , it is use for back command showing.
Rip timers:
  • Update time 30 seconds
  • Invalid time 180 seconds
  • Hold-down time 180 seconds
  • Flushed time 240 seconds

Comparison RIPv1 and RIPv2:
RIPv1:                                                                                 RIPv2:
Works on DVRP.                                                          Works on DVRP.
Global protocol.                                                                     =
Calculate cost or metric                                                       =
By gudging number of hops.                                               =
Maximum hop 15.                                                                 =
Broadcast on 255.255.255.255.                      Multicast on 224.0.0.9.
Classfull routing protocol.                                Classless routing protocol.
No support of discontigeous                           Support discontiogeous
Network.                                                              Network.

Show interface serial 0/0:
  1. Serial 0/0 is up, line protocol is down. (Means clock rate is not obtained)
  2. Serial 0/0 is down, line protocol is down. (Means remote interface is down)
  3. Serial 0/0 is administratively down, line protocol is down. (Means no shutdown command is not obtained)
  4. Serial 0/0 is up, line protocol is up. (Means ok)

IGRP (interior gateway routing protocol):
IGRP is a CISCO proprietary protocol, IGRP works on DVRP.
IGRP hop no 90 by default and maximum is 255.
IGRP calculate cost or metric by judging load, bandwidth, delay and reliability use only bandwidth and delay.
IGRP is classfull routing protocol so doesn’t support VLSM.
IGRP update time is 90 seconds.
IGP: Those routing protocol which works on same autonomous number is called IGP. Protocol: (IGRP, EIGRP, OSPF, and IS-IS).
EGP (exterior gateway protocol): Those routing protocol which works on different autonomous number is called EGP. Protocol: (BGP).
Bandwidth: The maximum transmission speed of a media is called bandwidth.
Load: The traffic in line is called load.
Delay: The time taken to traverse from path is called delay.
Reliability: Reliability means in which failure chances is less.
K1=1 (bandwidth). K3=1 (delay).
EIGRP (enhanced interior gateway routing protocol):
EIGRP is CISCO proprietary protocol, which works on hybrid routing protocol means both DVRP and Link State features.
It advertises change immediately (feature of link state).
It sends periodic update (feature of DVRP).
EIGRP makes adjacency with neighbor’s router by hello packet.
Hello packet is share by 224.0.0.10
EIGRP calculate cost or metric by load, bandwidth, delay, and reliability.
EIGRP create three tables. Ex: neighbor table, topology table and routing table.
EIGRP works on same autonomous number, EIGRP is classless routing protocol so support of VLSM.
EIGRP use algorithm called “DUAL” (diffusing update algorithm) for creating topology table.
EIGRP maximum hop 255, EIGRP also called PDM (protocol dependent module) which allow using multiple routed protocols.
Router ID: is an id which is use for router identification in EIGRP, OSPF, and BGP.
Routed protocol: IP, IPX, and Apple talk.
Routing protocol: RIP, IGRP, EIGRP, OSPF, IS-IS, BGP, etc.
Router1(config)# router eigrp 10
Router1(config-router)# network 10.0.0.0
Router1(config-router)# network 200.0.0.0
Router2(config)# router eigrp 10
Router2(config-router)# network 10.0.0.0
Router2(config-router)# network 192.168.1.0
Router(config-router)# eigrp router-id 4.4.4.4
Router# show ip eigrp interfaces , show ip eigrp neighbors , show ip eigrp topology , show ip eigrp traffic
OSPF (open shortest path first protocol):
OSPF is a global protocol, which works on link state routing protocol.
Advertise link state to their neighbor router. Advertise change immediately. Makes adjacency with neighbor router by sharing hello packet. Hello packet are share  by ip 224.0.0.5.
Contain information about router-id, autonomous no.
OSPF calculate cost or metric by 108 /bandwidth.
In OSPF “DISJKSTRA” algorithm is use, work on same autonomous number. Maximum hops unlimited.
Routers are divided into different logical area, area 0 is called the backbone of router and all the areas must be connected to area 0.
Classless routing protocols, so support of VLSM.
Wild card mask bits are used instead of subnet mask.
Loopback interface: It is a logical interface which is not use for physical connectivity, only for practice purposes.
Also use for router-id, router take loopback address as id.
ABR-Router(config)# router ospf 10
ABR-Router(config-router)# network 192.168.0.0 0.0.0.255 area 10
ABR-Router(config-router)# network 10.0.0.0 0.255.255.255 area 0
BIR-Router(config)# router ospf 10
BIR-Router(config-router)# network 10.0.0.0 0.255.255.255 area 0
BIR-Router(config-router)# network 20.0.0.0 0.255.255.255 area 0
BIR-Router(config-router)# network 192.168.10.0 0.0.0.255 area 0
ABR-Router(config)# router ospf 10
ABR-Router(config-router)# network 20.0.0.0 0.255.255.255 area 0

ABR-Router(config-router)# network 200.0.0.0 0.0.0.255 area 20
DHCP: DHCP stand for dynamic host configuration protocol which is use for assigning IPs to clients and it solve all problems which are in RARP and Bootp so now days DHCP is practically implemented and we can configure router as a DHCP server.
Router(config)# interface f0/0
Router(config-if)# ip address 10.0.0.1 255.0.0.0
Router(config-if)# no shutdown
Router(config)# ip dhcp pool corvit
Router(dhcp-config)# network 10.0.0.0 255.0.0.0
Router(dhcp-config)# default-router 10.0.0.50
Router(dhcp-config)# dns-server 10.0.0.100
Router# show ip dhcp binding
Access control list (ACL):
ACL is a group of statements which defines policies on incoming and outgoing traffic or ACL provide security which are use to filter unwanted traffics in CISCO routers.
Two types of ACL: Standard ACL and Extended ACL or Name ACL.
Traffic in router:
  • Inbound traffic: The traffic entering the device is called inbound traffic
  •  Outbound traffic: The device leaving the device is called outbound traffic

Standard ACL (1-99)(1300-1999): In standard ACL we can define only source host, source network.
Router1(config)# access-list 10 deny 200.0.0.2 0.0.0.0
Router1(config)# access-list 10 permit any
Router1(config)# interface f0/0
Router1(config-if)# ip access-group 10 out
Router1# show access-list or show ip interface or to delete no access-list 10
To block telnet on a machine: first of all we must give password to privilege mode and password to telnet startup mode.
Router(config)# access-list 30 deny 200.0.0.4 0.0.0.0
Router(config)# access-list 30 permit any
Router(config)# line vty 0 4
Router(config)# access-class 30 in
Extended ACL (100-199)(2000-2699): In extended ACL we can define source host, source network, destination network, protocol as well as port.
Router(config)# access-list 120 deny ip 200.0.0.10 0.0.0.0 192.168.0.3 0.0.0.0
Router(config)# access-list 120 permit ip any any
Router(config)# interface f0/0
Router(config-if)# ip access-group 120 out
To block FTP server on a machine:
Router1(config)# access-list 130 deny tcp 200.0.10.2 host 10.0.0.8 eq www
Router1(config)# access-list 130 permit tcp any host 10.0.0.8 eq www or 80
Router1(config)# access-list 130 permit ip any any
Router1(config)# interface f0/0
Router1(config-if)# ip access-group 130 out

Name ACL (standard or extended):
Router(config)# ip access-list stand corvit
Router(config)# deny 200.0.0.3 0.0.0.0
Router(config-stand)# permit any
Router(config)# interface f0/0
Router(config-if)# ip access-group corvit out

NAT (network address translator): NAT is use to translate private IPs into Public IPs. Why we use NAT? To reduce the usage of public IPs and to hide internal IPs.
Basic setting:
Router(config)# interface f0/0
Router(config-if)# ip nat inside
Router(config)# interface serial 0/0
Router(config-if)# ip nat outside
NAT Types: Static NAT, Dynamic NAT, PAT/NAT overload.
Static NAT: in static NAT all private IPs are equal to public IPs. All configuration and translation are done by administrator.
Router(config)# ip nat inside source static 192.168.0.2 200.0.0.3
Router(config)# ip nat inside source static 192.168.0.3 200.0.0.4

Dynamic NAT: in dynamic NAT all private IPs are equal to public IPs. In dynamic NAT all configuration or translations are done automatically.
Router(config)# access-list 10 permit 192.168.1.0 0.0.0.31
Router(config)# ip nat pool corvit 200.0.0.1 200.0.0.15 netmask 255.255.255.224
Router(config)# ip nat inside source list 10 pool corvit overload
Router# show ip nat translations or show ip nat statistics or show run
PAT/NAT overload: PAT stand for port address translation.
In PAT private IPs are greater than public IPs. i.e. DSL
Means you can use one public IP for many private IPs.
In PAT by one IP we can translate 65535 users.
Router(config)# access-list 20 permit 192.168.1.0 0.0.0.31
Router(config)# ip nat pool kabul 200.0.0.1 200.0.0.1 netmask 255.255.255.252
Router(config)# ip nat inside source list 20 pool Kabul overload
IPv6 configuration in RIP: First basic setting on both routers.
Router1(config)# interface f0/0
Router1(config-if)# ipv6 address 2001::0001 /64
Router1(config-if)# no shutdown
Router1(config)# interface s0/0/0
Router1(config-if)# ipv6 address 2002::0001 /64
Router1(config-if)# clock rate 64000
Router1(config-if)# no shutdown basic setting also on router2.
RIP: 2800 series router
Router(config)# ipv6 unicast-routing
Router(config)# interface f0/0
Router(config-if)# ipv6 rip 1 enable
Router1(config)# interface s0/0/0
Router1(config)# ipv6 rip 1 enable also on router2 same as router1.
Note: 1 is process ID and it will be same on both sides.
To delete: no router rip 1 or no ipv6 router rip 1
Configuring EIGRP on IPv6: first basic setting and the below routing.
Router1(config)# ipv6 unicast-routing
Router1(config)# interface f0/0
Router1(config-if)# ipv6 eigrp 10
Router1(config)# interface s0/0/0
Router1(config-if)# ipv6 eigrp 10
Router1(config)# ipv6 router-eigrp 10
Router1(config)# no shutdown (by default EIGRP is down)
Configuring OSPF on IPv6:
Router(config)# ipv6 unicast-routing
Router(config)# ipv6 router ospf 10
Router(config-if)# router-id 1.1.1.1 (router-id will be different)
Router(config)# interface f0/0
Router(config-if)# ipv6 ospf 10 area 0
Router(config)#  interface s0/0/0
Router(config-if)# ipv6 ospf 10 area 0
Administrative distance: AD is a distance of routing protocol by which router select best path toward destination network.
Protocol:                       Administrative distance:                                                 
Directly connected router                                                  0
Static router                                                                       1
EIGRP summary route                                                      5
External BGP                                                                    20
Internal EIGRP                                                                 90
IGRP                                                                                 100
OSPF                                                                                 110

IS-IS                                                                                  115
RIP                                                                                    120
EGP                                                                                   140
ODR                                                                                  160
External EIGRP                                                                 170
Internal BGP                                                                      200
DHCP-learned                                                                    254
Unknown                                                                            255