Showing posts with label LABS. Show all posts
Showing posts with label LABS. Show all posts

CCNA LAB - RIPv2

What is RIPv2?

·       RIPv2 is a distance vector routing protocol.
·       RIPv2 is a Classless routing protocol.
·       RIPv2 uses hop count as its only metric for path selection.
·      RIPv2 have administrative Distance is 120
·       Advertised routes with hop counts greater than 15 are unreachable.
·       Use of multicast addresses in sending update



RIPv2 is  an enhancement of RIPv1's features and extensions rather than an entirely new protocol. Some of these enhanced features include:
·       Next-hop addresses included in the routing updates
·       Use of multicast addresses in sending updates
·       Authentication option available
 RIPv2 is a distance vector routing protocol like RIPv1 so both versions of RIP share the following features and limitations:
·       Use of hold down and other timers to help prevent routing loops.
·       Use of split horizon or split horizon with poison reverse to also help prevent loops.
·       Use of triggered updates when there is a change in the topology for faster convergence.
·       Maximum hop count limit of 15 hops, with the hop count of 16 signifying an unreachable network.

RIPv2 Message?


RIPv2 has the same basic message format as RIPv1, two significant extensions are added.
  • The first extension in the RIPv2 message format is the sub-net mask field that allows a 32 bit mask to be included in the RIP route entry
  • The second significant extension to the RIPv2 message format is the addition of the Next Hop address.

RIPv2 Configuration

Topology
Configuration for R1

 R1#conf t
R1(config)#int s1/0
R1(config-if)#ip add 100.1.1.2 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int s1/1
R1(config-if)#ip address 20.1.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex

 RIPv2 Configuration Commands for R1

R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 20.1.1.0
R1(config-router)#network 100.1.1.0

 Configuration for R2

R2#config t
R2(config)#int f1/0
R2(config-if)#ip address 172.16.2.1 255.255.0.0
R2(config-if)#no shu
R2(config-if)#int s2/0
R2(config-if)#ip address 100.1.1.1 255.255.255.0
R2(config-if)#no shut
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 172.16.0.0
R2(config-router)#network 100.1.1.0

Configuration for R3

R3(config)#int s2/0 
R3(config-if)#ip add 20.1.1.2 255.255.255.0 
R3(config-if)#int f1/0
R3(config-if)#ip add 10.2.2.1 255.255.255.0
R3(config-if)#ex
R3(config)#router rip
R3(config-router)#ver 2
R3(config-router)#network 10.2.2.0
R3(config-router)#network 20.1.1.0


RIP Verification:

 Show ip route command should display all RIP networks and end to end ping should be successful.



CCNA LAB - RIP Version 1

What is RIP?

  1. RIP is a distance vector routing protocol.
  2. RIP is a Classful routing protocol.
  3. RIP uses hop count as its only metric for path selection.
  4. RIP have administrative Distance is 120 
  5. Advertised routes with hop counts greater than 15 are unreachable.
  6. Messages are broadcast every 30 seconds.
Routing Protocols

RIP Message

The data portion of a RIP message is encapsulated into a UDP segment, with both source and destination port numbers set to 520. The IP header and data link headers add broadcast destination addresses before the message is sent out to all RIP configured interfaces.
RIP Message structure

RIP is Classful routing protocol

RIPv1 does not send subnet mask information in the update. Therefore, a router either uses the subnet mask configured on a local interface, or applies the default subnet mask based on the address class. Due to this limitation, RIPv1 networks cannot be discontiguous nor can they implement VLSM

IP classes

RIPv1 configuration

Syntax:

Router#router rip
Router(config-router)#network directly-connected-classful-network-address

Example:
R1(config-router)#network 192.168.1.0
R1(config-router)#network 192.168.2.0
R1(config-router)#network 192.168.3.0

LAB

RIP lab topology

IP address table:


Task 1: Configure IP address for each devices

Router R1:
R1>enable
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 172.30.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial 1/0
R1(config-if)#ip ad
R1(config-if)#ip address 172.30.2.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config-if)#

Router R2:
R2>enable
R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#interface f0/0
R2(config-if)#ip address 172.30.3.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial 1/0
R2(config-if)#ip address 172.30.2.2 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial 1/1
R2(config-if)#ip address 192.168.4.9 255.255.255.252
R2(config-if)#clock rate 64000
R2(config-if)#no shutdown

Router R3:

R3>enable
R3#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#interface s
R3(config)#interface serial 1/0
R3(config-if)#ip address 192.168.4.10 255.255.255.252
R3(config-if)#clock rate 64000
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.5.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#

PC1:
PC1> ip 172.30.1.10 255.255.255.0 172.30.1.1
Checking for duplicate address...
PC1 : 172.30.1.10 255.255.255.0 gateway 172.30.1.1

PC2:
PC2> ip 172.30.3.10 255.255.255.0 172.30.3.1
Checking for duplicate address...
PC1 : 172.30.3.10 255.255.255.0 gateway 172.30.3.1

PC3:
PC3> ip 192.168.5.10 255.255.255.0 192.168.5.1
Checking for duplicate address...
PC1 : 192.168.5.10 255.255.255.0 gateway 192.168.5.1

Task 2: Configure RIPv1 in each router

Router 1:
R1>enable
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#router rip

R1(config-router)#network 172.30.0.0


Notice that only a single network statement is needed for R1. This statement includes both interfaces on different subnets of the 172.30.0.0 major network. 

One things, sending updates out f0/0 interface wastes the bandwidth and processing resources of all devices on the LAN. So we should prevent send out Rip update via f0/0 use command "passive-interface fastEthernet 0/0"

R1(config-router)#passive-interface fastEthernet 0/0

Router 2:
R2>enable
R2#configure terminal
R2(config)#router rip
R2(config-router)#network 172.30.0.0
R2(config-router)#network 192.168.4.0
R2(config-router)#passive-interface fastEthernet 0/0

Router 3:
R3>enable
R3#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router rip
R3(config-router)#network 192.168.4.0
R3(config-router)#network 192.168.5.0
R3(config-router)#passive-interface fastEthernet 0/0

Task 3: Verify RIP

Step 1: Use the show ip route command to verify that each router has all of the networks in the topology in the routing table.

In Router R1:

R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.30.0.0/24 is subnetted, 3 subnets
C       172.30.2.0 is directly connected, Serial1/0
R       172.30.3.0 [120/1] via 172.30.2.2, 00:00:07, Serial1/0
C       172.30.1.0 is directly connected, FastEthernet0/0
R    192.168.4.0/24 [120/1] via 172.30.2.2, 00:00:07, Serial1/0
R    192.168.5.0/24 [120/1] via 172.30.2.2, 00:00:07, Serial1/0

In router R2

R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.30.0.0/24 is subnetted, 3 subnets
C       172.30.2.0 is directly connected, Serial1/0
C       172.30.3.0 is directly connected, FastEthernet0/0
R       172.30.1.0 [120/1] via 172.30.2.1, 00:00:08, Serial1/0
     192.168.4.0/30 is subnetted, 1 subnets
C       192.168.4.8 is directly connected, Serial1/1
R    192.168.5.0/24 [120/1] via 192.168.4.10, 00:00:14, Serial1/1

And Router R3:

R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

R    172.30.0.0/16 [120/1] via 192.168.4.9, 00:00:09, Serial1/0
     192.168.4.0/30 is subnetted, 1 subnets
C       192.168.4.8 is directly connected, Serial1/0
C    192.168.5.0/24 is directly connected, FastEthernet0/0

Step 2: Verify that all necessary interface are active
To view necessary port are active, we use command "Show ip protocol" 

R1#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 23 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial1/0             1     1 2
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    172.30.0.0
  Passive Interface(s):
    FastEthernet0/0
  Routing Information Sources:
    Gateway         Distance      Last Update
    172.30.2.2           120      00:00:19
  Distance: (default is 120)

Step 3: View RIP message send and receive
To view sending and receiving RIP message, we need to turn on debug mode in each router. Note, turn debug on will wastes the bandwidth and processing resources of all devices

R1#debug ip rip
RIP protocol debugging is on
R1#
*Jan 28 17:34:20.559: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (172.30.2.1)
*Jan 28 17:34:20.559: RIP: build update entries
*Jan 28 17:34:20.559:   subnet 172.30.1.0 metric 1
R1#
*Jan 28 17:34:21.627: RIP: received v1 update from 172.30.2.2 on Serial1/0
*Jan 28 17:34:21.627:      172.30.3.0 in 1 hops
*Jan 28 17:34:21.631:      192.168.4.0 in 1 hops
*Jan 28 

To turn debug mode, we use command "undebug all"

R1#undebug all
All possible debugging has been turned off

I hope this post will help you understand well RIPv1. Next lab i will show you how to configure RIPv1 in Stub network. See you soon.

Router basic command and static route configuration


Topology Diagram

IP address table:



Learning Objectives
  1. Perform basic configuration tasks on a router
  2. Configure and activate Serial and Ethernet interface
  3. Test connectivity
  4. Gather information to discover causes for lack of connectivity between devices
  5. Configure a static route using an intermediate address.

Task 1: Execute basic command in each router: host name, enable secret, password, login...

  •  Change router name from R1 to GNS3 
            R1>enable
            R1#configure terminal
            R1(config)#hostname GNS3
            GNS3(config)#
  • Enable password before enter to privilege mode (password: gns3)
           R1#configure terminal 
           R1(config)#enable secret gns3  
          
  • Configure Banner 
R1>enable  
Password:  
R1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z. 
R1(config)#banner motd # 
Warning! This is my banner :)#
Show banner in user mode window
  • Configure password telnet, this configuration will help your router more secure.
R1>enable 
Password: 
R1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z. 
R1(config)#line vty 0 4 
R1(config-line)#password gns3 
R1(config-line)#login
Use Show running-configure to show result

Password in clear text, easy to attack.
We should use "service password-encryption" to increase secure for telnet password
R1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z. 
R1(config)#service password-encryption 
R1(config)#exit
Telnet password already encrypted
  • To save router configuration use command "copy running-config startup-config"
R1#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration... 
[OK]
  • Clear configuration in router use command "erase startup-config
R1#erase startup-config 
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]

        Task 2: Configure IP for each interface in each router and PCs

        • Router R1
        Configure ip address for port serial 2/0 and f0/0

        R1>enable 
        Password: 
        R1#configure terminal 
        Enter configuration commands, one per line.  End with CNTL/Z 
        R1(config)#interface serial 2/0 
        R1(config-if)#ip address 172.16.2.1 255.255.255.0 
        R1(config-if)#clock rate 64000
        R1(config-if)#no shutdown 
        R1(config-if)#exit 
        R1(config)#interface fastEthernet 0/0
        R1(config-if)#ip address 172.16.3.1 255.255.255.0 
        R1(config-if)#no shutdown
        Show result, use command "show ip interface brief"

        Show detail port information in router R1

        • Router R2
        Configure ip address for interface serial 2/0, serial 2/1 and f0/0

        R2>enable 

        Password: 

        R2#configure terminal 

        Enter configuration commands, one per line.  End with CNTL/Z. 

        R2(config)#interface serial 2/0 
        R2(config-if)#ip address 172.16.2.2 255.255.255.0 
        R2(config-if)#clock rate 64000 
        R2(config-if)#no shutdown
        R2(config-if)#exit 
        R2(config)#interface fastEthernet 0/0 
        R2(config-if)#ip address 172.16.1.1 255.255.255.0 
        R2(config-if)#no shut 
        R2(config-if)#exit 
        R2(config)#interface serial 2/1 
        R2(config-if)#ip address 192.168.1.1 255.255.255.0 
        R2(config-if)#clock rate 64000 
        R2(config-if)#no shutdown 
        R2(config-if)#
        Interfaces configuration

        • Router R3
        Configure ip address for interface serial 2/0 and f0/0

        R3>enable 
        Password: 
        R3#configure terminal 
        Enter configuration commands, one per line.  End with CNTL/Z. 
        R3(config)#interface serial 2/0 
        R3(config-if)#ip address 192.168.1.2 255.255.255.0 
        R3(config-if)#clock rate 64000 
        R3(config-if)#no shut 
        R3(config-if)#exit 
        R3(config)#interface fastEthernet 0/0 
        R3(config-if)#ip address 192.168.2.1 255.255.255.0 
        R3(config-if)#no shut
        Router R3 interface configurations
        • PC1
        PC1> ip 172.16.3.2 255.255.255.0 172.16.3.1
        Checking for duplicate address...
        PC1 : 172.16.3.2 255.255.255.0 gateway 172.16.3.1
        • PC2
        PC2> ip 172.16.1.2 255.255.255.0 172.16.1.1
        Checking for duplicate address...
        PC1 : 172.16.1.2 255.255.255.0 gateway 172.16.1.1
        • PC3
        PC3> ip 192.168.2.2 255.255.255.0 192.168.2.1
        Checking for duplicate address...
        PC1 : 192.168.2.2 255.255.255.0 gateway 192.168.2.1

        Task 3: Configure static route

        • Enable debug routing use command "debug ip routing"
        R1#debug ip routing 
        IP routing debugging is on

              • Static route syntax

              or 


              • Router R1
              Reachability towards 172.16.1.0/24,192.168.1.0/24 and route 192.168.2.0 . The next-hop router is R2. The same outbound interface is s2/0. 

              R1> 
              R1>enable
              R1#configure terminal 
              Enter configuration commands, one per line.  End with CNTL/Z. 
              R1(config)#ip route 172.16.1.0 255.255.255.0 serial 2/0 
              *Jan 23 10:22:33.231: RT: SET_LAST_RDB for 172.16.1.0/24  NEW rdb: is directly connected
              *Jan 23 10:22:33.231: RT: add 172.16.1.0/24 via 0.0.0.0, static metric [1/0]
              *Jan 23 10:22:33.235: RT: NET-RED 172.16.1.0/24
               
              R1(config)#ip route 192.168.1.0 255.255.255.0  
              R1(config)#ip route 192.168.1.0 255.255.255.0 serial 2/0 
              *Jan 23 10:23:00.371: RT: SET_LAST_RDB for 192.168.1.0/24  NEW rdb: is directly connected
              *Jan 23 10:23:00.371: RT: add 192.168.1.0/24 via 0.0.0.0, static metric [1/0]
              *Jan 23 10:23:00.375: RT: NET-RED 192.168.1.0/24
               
              R1(config)#ip route 192.168.2.0 255.255.255.0 serial 2/0 
              *Jan 23 10:23:20.967: RT: SET_LAST_RDB for 192.168.2.0/24  NEW rdb: is directly connected
              *Jan 23 10:23:20.971: RT: add 192.168.2.0/24 via 0.0.0.0, static metric [1/0]*Jan 23 10:23:20.971: RT: NET-RED 192.168.2.0/24
              Note: Yellow mark is debug ip routing information. You only can receive this information after enable debug mode use "debug ip routing" command

              • Router R2

              Reachability towards 172.16.3.0/24,192.168.2.0/24  . The next-hop router  R1 outbound interface is s2/0 and R3 outbound interface is s2/1.
              R2#configure terminal 
              Enter configuration commands, one per line.  End with CNTL/Z. 
              R2(config)#ip route 172.16.3.0 255.255.255.0 serial 2/0 
              R2(config)#ip route 192.168.2.0 255.255.255.0 serial 2/1

              •  Router R3

               Reach-ability towards 172.16.3.0/24172.16.1.0/24, 172.16.2.0/24 . The next-hop router  R3 outbound interface is s2/0.
              R3# 
              R3#configure terminal 
              Enter configuration commands, one per line.  End with CNTL/Z. 
              R3(config)#ip route 172.16.3.0 255.255.255.0 serial 2/0 
              R3(config)#ip route 172.16.2.0 255.255.255.0 serial 2/0 
              R3(config)#ip route 172.16.1.0 255.255.255.0 serial 2/0
              Note: You can not just be changed, we must remove old route configuration before add new route information. Otherwise, both old and new route will keep in configuration file.
              To remove ip route, use command "no ip route"
               ExampleR3(config)#no ip route 172.16.1.0 255.255.255.0 serial 2/0

              • Show ip route table use "show ip route" command


              R1#show ip route
              Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
                     D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
                     N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
                     E1 - OSPF external type 1, E2 - OSPF external type 2
                     i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
                     ia - IS-IS inter area, * - candidate default, U - per-user static route
                     o - ODR, P - periodic downloaded static route
              Gateway of last resort is not set
                   172.16.0.0/24 is subnetted, 3 subnets
              S       172.16.1.0 is directly connected, Serial2/0
              C       172.16.2.0 is directly connected, Serial2/0
              C       172.16.3.0 is directly connected, FastEthernet0/0
              S    192.168.1.0/24 is directly connected, Serial2/0
              S    192.168.2.0/24 is directly connected, Serial2/0

              • Check connectivity
              Form PC1 ping to PC2 and PC3


                                                 PC1> ping 172.16.1.284 bytes from 172.16.1.2 icmp_seq=1 ttl=62 time=61.365 ms84 bytes from 172.16.1.2 icmp_seq=2 ttl=62 time=73.770 ms84 bytes from 172.16.1.2 icmp_seq=3 ttl=62 time=41.482 ms84 bytes from 172.16.1.2 icmp_seq=4 ttl=62 time=44.665 ms84 bytes from 172.16.1.2 icmp_seq=5 ttl=62 time=41.450 ms
                                                PC1> ping 192.168.2.2
                                                84 bytes from 192.168.2.2 icmp_seq=1 ttl=61 time=65.602 ms
                                                84 bytes from 192.168.2.2 icmp_seq=2 ttl=61 time=58.691 ms
                                                84 bytes from 192.168.2.2 icmp_seq=3 ttl=61 time=57.872 ms
                                                84 bytes from 192.168.2.2 icmp_seq=4 ttl=61 time=58.364 ms
                                                84 bytes from 192.168.2.2 icmp_seq=5 ttl=61 time=62.914 ms
                                                Do same thing in PC2 and PC3.