Settings RIPv2(Routing Information Protocol v2) is an extremely simple process and consists of three steps:

  1. enable the protocol with the global router rip command
  2. changing the protocol version to the second version 2
  3. selection of networks that the protocol will “broadcast”, for which the network command(s) is used;

The first two commands are obvious, but the last command requires some explanation: with network you specify the interfaces that will participate in the routing process. This command takes classful networking as a parameter and enables RIP on the appropriate interfaces.

RIPv2 configuration example

In our topology, routers R1 and R2 have directly connected subnets.

We need to include the subnet data in the RIP dynamic routing process. To do this, we first need to enable RIP on both routers and then broadcast the network data using the network command. On router R1 go to global configuration mode and enter the following commands:

Router rip verison 2 network 10.0.0.0 network 172.16.0.0

A little clarification - first we enable the dynamic routing protocol, then change the version to the second one, then use the network 10.0.0.0 command to enable the Fa0/1 interface on router R1. As we already said, the network command takes a classful network, so that every interface with a subnet starting with 10 will be added to R.I.P. process. For example, if the address 10.1.0.1 is on another interface, it will also be added to the routing process. We also need to connect two routers in RIP, to do this we add another network command - with the address 172.16.0.0

IP addresses starting with 10 are class A by default and have a standard subnet mask of 255.0.0.0.

On R2, the setup looks similar, only with a different subnet - because the subnet 192.168.0.0 is directly connected to the R2 router.

Router rip verison 2 network 192.168.0.0 network 172.16.0.0

How to check the routing table?

To check, you need to enter the show ip route command - you should see the subnet 192.168.0.0/24 on R1 and the subnet 10.0.0.0/24 on R2 marked with the letter R - that is, this is a RIP route. The administrative distance and metric for this route will also be visible there.

But if there are a lot of routers, then manually entering routes is very labor-intensive and there is a high chance of getting confused. This is why we came up with dynamic routing, so that everything can be configured itself =)

This cheat sheet uses the dynamic routing protocol RIPv2.

// This is how I will denote comments.

    We establish a console connection via hyperterminal with the following settings:
  • Speed: 9600; Data bits: 8; Parity: No; Stop bits: 1; Flow control: No;
  • //when logging into the router, enter the password - cisco
  • R1>enable //Enter privileged mode.
  • //enter the password - class
  • R1#configure terminal //enter global configuration mode
  • R1(config)# router rip//with this command we enable the RIP protocol on the router, and find ourselves in protocol configuration mode
  • R1(config-router)#
  • R1(config-router)#version 2 //enable RIP Version 2
  • R2(config-router)#no auto-summary //disable automatic summarization of routes
  • //in order to find out which networks are connected to the router, you need to enter the command in privileged mode R1#show ip route
  • R2(config-router)#network 192.168.0.0 //enter the networks that will be transmitted to other routers, in our case I entered all connected
  • R2(config-router)#network 192.168.0.128
  • R2(config-router)#network 192.168.0.192
  • //here we set an interface to which there is no need to send routing table updates
  • R2(config-router)#passive-interface FastEthernet0/0
  • R1(config-line)#end //exit to privileged EXEC Mode
  • R1#show running-config //Check the entered data.
  • R1#copy running-config startup-config //Save the completed settings into non-volatile memory.

Download the completed router setup task

I suggest downloading the file with the completed task for the PacketTracer emulator program, opening it and looking at the implementation. Router R2 is also configured with dynamic routing, so everything pings successfully.

Setting up a router by copying the configuration

    To perform automatic basic setup (everything above) of the router, follow these steps:
  • 1. Copy the text below to the clipboard: enter everything, click right click on the selection and select "Copy".
  • 2. If necessary, clear the router of all settings and reboot it.
  • 3. Enter the global configuration mode and call the Hyper Terminal menu “Edit”, and in it “Transfer to host computer”.
  • 4. Be sure to check your settings using the show running-config command
  • 5. If necessary, enable the interfaces with the no shutdown command from the mode of each interface

Since the RIP protocol has little theory and it works relatively simply, I suggest starting this section with a story about what it is routing protocols (routing protocol), as well as some interesting points about filling out and using the routing table.

Routing protocols

Routing protocols allow routers to exchange information about existing routes. The most popular routing protocols today are R.I.P., EIGRP, OSPF And BGP.

  • R.I.P.– probably the oldest (relative to those listed) routing protocol. Used in small networks. It has a number of disadvantages compared to other routing protocols, but is much easier to configure than its competitors.
  • EIGRP– proprietary routing protocol, works exclusively on Cisco devices. Easy to maintain and configure.
  • OSPF– standardized routing protocol. Can be used in large networks, responds relatively quickly to changes in network topology, but compared to EIGRP, a little difficult to understand.
  • BGP– standardized routing protocol. Typically used to exchange information on routers in global network Internet. Very difficult to understand.

We have already gone through what it is Administrative Distance(), and we know its value for static ( static) and connected ( connected) routes. Table 7.1 shows the sources from which they learned about the route and the meaning Administrative Distance(AD).

Table 7.1 Basic values ​​of Administrative Distance

Source Administrative Distance
Connected directly ( connected) 0
Statics ( static) 1
BGP 20
EIGRP 90
OSPF 110
R.I.P. 120
External EIGRP 170
iBGP 200
Not defined 255

Looking at this table, we can say that if the same route is defined statically and found through the RIP protocol, then the static route will be added to the routing table. Or another example, if the same route is found using the EIGRP and OSPF routing protocols, then the route learned through EIGRP will appear in the routing table. What's happened External EIGRP And iBGP We will look at it in one of the following sections.


Important Note o filling the routing table. If there are several identical routes, the route with the lowest metric (AD) gets into the routing table. Identical routes– routes with the same network number and prefix (mask), so network numbers 10.77.0.0/16 and 10.77.0.0/24 will be assigned to different routes.


Important Note about choosing a route when transmitting packets. When transmitting packets, the router looks at the recipient's IP address and looks for the route with the longest match. For example, there are three routes to networks 10.77.7.0/24, 10.77.0.0/16 and the default route 0.0.0.0. The router needs to send a packet with the recipient IP address 10.77.7.7. The router determines the longest match. The default route has the smallest match (0 bits), route 10.77.0.0/16 has a match of the first two octets of 10.77 (16 bits), and route 10.77.7.0/24 has the maximum match (of the routes provided) of 10.77.7 (24 bits) , therefore the router will decide to send the packet along the route 10.77.7.0/24. We will definitely look into this case in practice.

Now we can move on to analyzing the first routing protocol - Routing Information Protocol.

Routing Information Protocol (RIP)

R.I.P. belongs to the category of protocols with the code name distance-vector. As a metric, it uses the number of “hops” (hop count, in American terminology, packets are not transmitted between routers, but “jumped”) to each route.

Figure 7.1 shows how routers determine the number of hops to the 10.99.1.0/24 subnet.


Important Note. When using the RIP routing protocol, the maximum number of hops must be taken into account - 15.

RIP protocol versions

  • RIP version 1– protocol published 1988. Can only work with classful addressing. Updates are sent using a broadcast address.
  • RIP version 2– the protocol has been updated, support for classless addressing has been added (support for VLSM, Variable Length Subnet Masks), and support for authorizing updates has also been added. Updates are sent using the multicast address 224.0.0.9.
  • RIPng(RIP next generation) – IPv6 support has been added.

RIP timers

By default, the router sends updates every 30 seconds. The updates contain not only routes that are directly connected to it, but also routes learned from other routers via the RIP protocol.

If the router does not receive updates within 180 seconds, then the routes obtained using previous updates are marked as “not updated”. And if updates have not arrived within 240 seconds, then the marked routes are deleted (240 seconds is 4 minutes, users will simply eat you up during this time, this is one of the shortcomings of the RIP protocol).

Initial data

All “manipulations” can be carried out using PC0 (or from other PCs on the network).

In this practical work the network has already been planned, addressing is distributed and DHCP is configured. A telnet server is configured on the network equipment, the password is cisco123. There is no access to ISP (Internet Server Provider) routers.

Abbreviations in names: Br – Branch; HO -Head Office; CE – Customer Edge.

  • 1c-srv-2.local – 172.16.12.2
  • 1c-srv-1.local – 172.16.14.5
  • core-r1.local – 10.1.1.1
  • core-r2.local – 10.1.1.2
  • r2.local – 10.77.2.1
  • r3.local – 10.77.2.254
  • br-r1.local – 10.1.2.2
  • small-r1.local – 10.1.3.2
  • dns.local – 10.77.2.5

Goals

  1. Understand the presented topology
  2. Configure RIP on routers: r2, br-r2, small-br-r1. Parse command show ip route
  3. Parse command show ip rip database
  4. Parse command passive-interface .
  5. Affect the movement of the package

Execution

  1. Understand the presented topology

    First of all, let's define colored rectangles. The blue rectangle denotes the boundaries of the “Head Office” network, the green – the boundaries of the “Branch” network, and the yellow – the boundaries of the “Branch” network. “Branch” and “Branch” are connected to the “Head Office” through the provision of L2 channels (L2VPN) by the provider, that is, roughly speaking, the provider provides us with a wire between the “Head Office” and the “Branch”.

    It should also be noted that on routers r2 and r3 DHCP is configured for network 10.77.2.0/23. In this case, router r2 outputs the range 10.77.2.255 – 10.77.3.99, with a gateway 10.77.2.1, and r3 outputs the range 10.77.3.100 – 10.77.3.199 with a gateway 10.77.2.254. This is done for redundancy (a bad example of redundancy).

    This practical work presents a relatively small network, but it already causes difficulties when writing static routes (especially if they need to be reserved). Therefore we will use a routing protocol. On at the moment All routers have the RIP routing protocol configured, except those that will be discussed in the next paragraph.

  2. Configure RIP on routers: r2, br-r1, small-br-r1

    I suggest setting up r2 first, and then going through all the commands used in order. To connect to r2, you can use PC0 by running the command telnet r2.local. (It is advisable to study the command before setting up show ip route)

    PC> telnet r2.local Trying 10.77.2.1 ...Open User Access Verification Password: r2# conf t Enter configuration commands, one per line. End with CNTL/Z. r2(config)# router rip r2(config-router)# version 2 r2(config-router)# network 10.0.0.0 r2(config-router)# no auto-summary r2(config-router)# exit r2(config) # exit r2# r2# sh runn Building configuration... Current configuration: 1158 bytes ! version 12.4... ! router rip version 2 network 10.0.0.0 no auto-summary ! ...

    To enable the routing protocol on the router, you need to use the command router rip, using it we also get into the configuration mode for this protocol. The first thing we did was determine the protocol version. The default is version 1, which only supports classful addressing. This does not suit us, so using the command version 2, we installed the second version of the RIP protocol. Next, we indicated the network in which this protocol should work - network 10.0.0.0. The command consists of the word network And network class number. No matter how hard you try to enter a classless network number here, the router will convert it into a class one and add it to the configuration. After specifying a network, RIP runs on those interfaces that fall within the specified class range. In our case, the range is 10.0.0.1 – 10.255.255.254, which includes all interfaces of router r2 (it’s easier for us). And the last command that was used during setup is no auto-summary . Auto-summary– this is an automatic summation of routes (a very dangerous thing 😊). For example, the router has information about two routes connected to it - 10.1.1.0/24 and 10.2.1.0/24, and if it is indicated that the routes can be “summed”, then the router will advertise only one route - 10.0.0.0/8, which is not very correct. Always think before using auto-summary and don't forget to turn it off!

    Now let's examine the routing table.

    R2# sh ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP ... Gateway of last resort is not set 10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks R 10.1.1.0/30 via 10.1.1.5, 00:00:15, FastEthernet0/0 C 10.1.1.4/30 is directly connected, FastEthernet0/0 R 10.1.1.8/30 via 10.77.2.254, 00: 00:05, Vlan1 C 10.1.2.0/30 is directly connected, FastEthernet0/1 R 10.1.3.0/30 via 10.77.2.254, 00:00:05, Vlan1 C 10.77.2.0/23 is directly connected, Vlan1

    Super! As mentioned earlier, half of the routers already have RIP configured, which is why we see that the routing table is full. Opposite each route recognized through RIP is a letter R. Now let's figure out what it is . The first number is the Administrative Distance, the second number of “hops” to the specified subnet is the metric used by RIP. Next to each route there is a time - countdown with last update route.

    Now let's configure the router br-r1. Unfortunately, you won't be able to connect from PC0. But you can connect from the router r2.

    R2# br-r1.local Translating "br-r1.local"...domain server (10.77.2.5) Trying 10.1.2.2 ...Open User Access Verification Password: br-r1# conf t Enter configuration commands, one per line. End with CNTL/Z. br-r1(config)# router rip br-r1(config-router)# ver 2 br-r1(config-router)# no auto-summary br-r1(config-router)# net 10.0.0.0 br-r1( config-router)# net 172.16.14.1 br-r1(config-router)# exit br-r1(config)# exit br-r1# sh runn Building configuration... Current configuration: 1204 bytes ! version 12.4... ! router rip version 2 network 10.0.0.0 network 172.16.0.0 no auto-summary ! ...

    Overall setup br-r1 no different from setting r2. The only thing we tried was to specify the IP address as the network number, but as can be seen from show run, the IP address was converted into a network number, and a class number.

    Before completing this part, all that remains is to configure RIP on the router small-br-r1. You can access it from the router r3. Below is a “copy-paste” for setting it up.

    Router rip version 2 network 10.0.0.0 network 192.168.10.0 no auto-summary

  3. Parse command show ip rip database

    To study the command show ip rip database, router has been selected core-r2, we also need a routing table.

    Core-r2# show ip rip database 10.1.1.0/30 auto-summary 10.1.1.0/30 directly connected, Vlan1 10.1.1.4/30 auto-summary 10.1.1.4/30 via 10.1.1.1, 00:00:15, Vlan1 10.1.1.8/30 auto-summary 10.1.1.8/30 directly connected, FastEthernet0/0 10.1.2.0/30 auto-summary 10.1.2.0/30 via 10.1.1.1, 00:00:15, Vlan1 via 10.1.1.10, 00 :00:12, FastEthernet0/0 10.1.2.4/30 auto-summary 10.1.2.4/30 via 10.1.1.1, 00:00:15, Vlan1 via 10.1.1.10, 00:00:12, FastEthernet0/0 10.1.3.0 /30 auto-summary 10.1.3.0/30 via 10.1.1.10, 00:00:12, FastEthernet0/0 10.77.2.0/23 auto-summary 10.77.2.0/23 via 10.1.1.10, 00:00:12, FastEthernet0/ 0 172.16.12.0/30 auto-summary 172.16.12.0/30 via 10.1.1.1, 00:00:15, Vlan1 via 10.1.1.10, 00:00:12, FastEthernet0/0 172.16.14.0/24 auto-summary 172.16. 14.0/24 via 10.1.1.1, 00:00:15, Vlan1 via 10.1.1.10, 00:00:12, FastEthernet0/0 192.168.10.0/24 auto-summary 192.168.10.0/24 via 10.1.1.10, 00:00 :12, FastEthernet0/0 core-r2# sh ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP ... Gateway of last resort is not set 4.0. 0.0/28 is subnetted, 1 subnets C 4.4.4.0 is directly connected, FastEthernet0/1 10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks C 10.1.1.0/30 is directly connected, Vlan1 R 10.1.1.4/30 via 10.1.1.1, 00:00:04, Vlan1 C 10.1.1.8/30 is directly connected, FastEthernet0/0 R 10.1.2.0/30 via 10.1.1.1, 00:00:04, Vlan1 via 10.1.1.10, 00: 00:29, FastEthernet0/0 R 10.1.2.4/30 via 10.1.1.1, 00:00:04, Vlan1 via 10.1.1.10, 00:00:29, FastEthernet0/0 R 10.1.3.0/30 via 10.1.1.10, 00:00:29, FastEthernet0/0 R 10.77.2.0/23 via 10.1.1.10, 00:00:29, FastEthernet0/0 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks R 172.16.12.0/30 via 10.1.1.1, 00:00:04, Vlan1 via 10.1.1.10, 00:00:29, FastEthernet0/0 R 172.16.14.0/24 via 10.1.1.1, 00:00:04, Vlan1 via 10.1.1.10, 00: 00:29, FastEthernet0/0 R 192.168.10.0/24 via 10.1.1.10, 00:00:29, FastEthernet0/0

    Team show ip rip database shows all routes that the RIP protocol knows about. Let us immediately stipulate that the lines with the word auto-summary We are not interested because we have disabled “route summarization”. As you can see, this route database contains not only routes learned from other routers, but also routes connected directly to this router. It is this table that the router sends out every 30 seconds. Now let’s analyze the routes learned from other routers, for example, for the network number 10.1.2.4/30. The metric (number of “jumps”) is indicated in square brackets (), then it is indicated who sent the information about this route ( via 10.1.1.10). Please note that there are two routes to this subnet, through 10.1.1.10 and through 10.1.1.1, both with a metric of 3 (the path to the 10.1.2.4/30 subnet goes through 3 routers). Now let's find the subnet 10.1.2.4/30 in the routing table ( show ip route), as you can see, both routes have been added. It is very important that if two routes to the same subnet appear in the routing table, the router performs load balancing. Unfortunately, consideration of types of balancing and more fine tuning the RIP protocol will not be considered (since Packet Tracer simply does not have enough commands).

  4. Parse command passive-interface. Add a static route

    Using the command passive-interface you can specify an interface that will not send out the route database, but will still receive updates. In our example, it is convenient to do this at the border of the “Head Office” and “Branch” networks, so that the router r2 will receive routing information from the router br-r1, but will not transmit information about its route database. For this scheme to work, you will have to add br-r1 one static route. First, let's add a static route to br-r1, then install passive-interface and see how the RIP protocol route base has changed to br-r1.

    Br-r1(config)# ip route 0.0.0.0 0.0.0.0 10.1.2.1 r2(config)# router rip r2(config-router)# passive-interface fa 0/1

    Interface Fa0/1 router r2“looks” at the router br-r1, now he's in mode passive-interface– receives information about routes, but does not send it out. Now let's look at the routing table at br-r1, you must first clear it with the command clear ip route *(thus the router will need to re-collect all the route information).

    Br-r1# clear ip route * br-r1# sh ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP ... Gateway of last resort is 10.1. 2.1 to network 0.0.0.0 10.0.0.0/30 is subnetted, 2 subnets C 10.1.2.0 is directly connected, FastEthernet0/0 C 10.1.2.4 is directly connected, Vlan2 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.12.0/30 is directly connected, Vlan1 C 172.16.14.0/24 is directly connected, FastEthernet0/1 S* 0.0.0.0/0 via 10.1.2.1

    Great, now on br-r1 compact routing table, while the router has a default route pointing to r2. You can verify for yourself that the routing table is on r2 has routes to the “Branch” network.

  5. Affect the movement of the package

    As noted in the theory part, “if there are several identical routes, the route with the lowest metric (AD) gets into the routing table.” But what if we add an intersecting route? I suggest you experiment.

    Now data transfer between “Branch” (172.16.14.0/24) and “Branch” (192.168.10.0/24) occurs according to the following scheme:

    “Branch” → R2 → R3 → “Branch”

    Now, by adding one single route, we change the path for some addresses(not for the entire subnet).

    R2(config)# ip route 192.168.10.0 255.255.255.240 10.1.1.5 core-r1(config)# ip route 192.168.10.0 255.255.255.240 10.1.1.2

    Before explaining, let's trace to two addresses 192.168.10.10 (small-br-sw-1) and 192.168.10.50 (PC4) from PC3, Figure 7.3.

    Let's look at the first trace, which shows the expected path. As stated above, the path is:

    “Branch” (172.16.14.0/24) → Br-R1 → 10.1.2.0/30 → R2 → 10.77.2.0/23 → R3 → 10.1.3.0/30 → Small-Br-R1 → “Department” (192.168.10.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 /24)

    By adding a route for the subnet 192.168.10.0/28 to routers r2 and core_r1, some packets will go a different route, namely packets with a recipient address from the range 192.168.10.0 – 192.168.10.15. So when we trace to 192.168.10.10, the trace has grown to two more routers:

    “Branch” (172.16.14.0/24) → br-r1 → 10.1.2.0/30 → r2 → 10.1.1.4/30 → core-r1 → 10.1.1.0/30 → core-r2 → 10.1.1.8/30 → r3 → 10.1.3.0/30 → small-br-r1 → “Branch” (192.168.10.0/24)

    If you look at the r2 routing table, you can see two intersecting routes to the subnet 192.168.10.0/24 and 192.168.10.0/28. Now you should have understood what we discussed in the theoretical part - “when transmitting packets, the router looks at the recipient’s IP address and looks for the route with the longest match” (or minimum prefix).

    And one more interesting fact. After adding routes, data to the address 192.168.10.10 will pass through 6 routers, but the response will only be transmitted through 4 routers (for example, from 192.168.10.10 to PC3). Try to guess why.

Initial data

All “manipulations” can be carried out using PC0 (or from other devices). The password for the equipment is cisco123, connect using telnet. To access network equipment, use the addressing presented in the diagram; DNS records are also configured (presented below). The network uses the RIP routing protocol. All devices on the network can access the Internet through the core-r1 router.

Configured DNS records (DNS server):

  • 1c-srv-2.local – 172.16.12.2
  • 1c-srv-1.local – 172.16.14.5
  • core-r1.local – 10.1.1.1
  • core-r2.local – 10.1.1.2
  • r2.local – 10.77.2.1
  • r3.local – 10.77.2.254
  • br-r1.local – 10.1.2.2
  • small-r1.local – 10.1.3.2
  • dns.local – 10.77.2.5

Exercise

  1. Your company policy allows remote control network equipment via the Internet. I received a task to make the following static NAT translations (on the core-r1 router):
    • 3.3.3.3:3001 – 10.77.2.1:23
    • 3.3.3.3:3002 – 10.77.2.254:23
    • 3.3.3.3:3003 – 10.77.2.10:23
    • 3.3.3.3:3004 – 10.77.2.11:23
  2. At the moment, all devices in the “Branch” access the Internet through the “Head Office”, this has led to high load on the channel between these offices. It was decided that the “Branch” should access via its own Internet; for this purpose, a br-core-r1 router was allocated. The provider is already connected to this router, the addressing is on the diagram. Your task is to configure br-core-r1 and br-r1 according to the plan presented below.

    Configure br-core-r1 (the router can be accessed from router br-r1):

    • Configure the RIPv2 routing protocol, without automatic route summarization.
    • Configure NAT/PAT Overload using a Standard ACL called Branch-NAT (already created).
    • Configure port translation: 172.16.12.2:80 – 8.8.8.3:8080 and 172.16.14.5:80 – 8.8.8.4:8080.

    Configure br-r1:

    • Add a static route for network 10.0.0.0/8 via r2.
    • Add a static route for network 192.168.0.0/16 via r2.
    • Add default route via br-core-r1.

    (to check the result use PC_HOME)

If you find an error in the text, select the text and press Ctrl + Enter

ID: 154 Created: Oct 19, 2016 Modified Jan 15, 2019