RIP dynamic routing protocol

1 Topology



2 PC1 PC2 configuration



3 AR1 AR2 AR3 configure IP address


AR1 configuration

[AR1]int g0/0/0

[AR1-GigabitEthernet0/0/0]ip address 10.10.10.2 24

[AR1-GigabitEthernet0/0/0]int g0/0/1

[AR1-GigabitEthernet0/0/1]ip address 20.20.20.2 24


AR2 configuration

[AR2]int g0/0/0

[AR2-GigabitEthernet0/0/0]ip address 10.10.10.1 24

[AR2-GigabitEthernet0/0/0]int g0/0/2

[AR2-GigabitEthernet0/0/2]ip address 192.168.1.1 24

[AR2-GigabitEthernet0/0/2]int g0/0/1

[AR2-GigabitEthernet0/0/1]ip address 30.30.30.1 24


AR3 configuration

[AR3]int g0/0/0

[AR3-GigabitEthernet0/0/0]ip address 20.20.20.1 24

[AR3-GigabitEthernet0/0/0]int g0/0/1

[AR3-GigabitEthernet0/0/1]ip address 30.30.30.2 24

[AR3-GigabitEthernet0/0/1]int g0/0/2

[AR3-GigabitEthernet0/0/2]ip address 192.168.3.1 24


4 AR1 AR2 AR3 turns on the RIP dynamic routing protocol and announces the network segments they are connected to.


AR1 configuration

[AR1]rip //Enter RIP

[AR1-rip-1]version 2 //RIP version is 2

[AR1-rip-1]network 10.0.0.0 //Announce all network segments on the router, declare an entire large network segment, RIP does not support masks, and masks will be automatically recognized

[AR1-rip-1]network 20.0.0.0 //Declare all network segments on the router, declare an entire large network segment, RIP does not support masks, and masks will be automatically recognized


AR2 configuration

[AR2]rip

[AR2-rip-1]version 2

[AR2-rip-1]network 192.168.1.0

[AR2-rip-1]network 10.0.0.0

[AR2-rip-1]network 30.0.0.0


AR3 configuration

[AR3]rip

[AR3-rip-1]version 2

[AR3-rip-1]network 192.168.3.0

[AR3-rip-1]network 20.0.0.0

[AR3-rip-1]network 30.0.0.0


5 Check the routing table on AR2. There is a route to the 192.168.3.0/24 network segment. The next hop is 30.30.30.2. The RIP protocol priority in the Huawei simulator is 100. The cost is calculated based on the number of hops.


[AR2]dis ip routing-table Route Flags: R - relay, D - download to fib

Routing Tables: Public

Destinations : 15       Routes : 16

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

10.10.10.0/24  Direct  0    0           D   10.10.10.1      GigabitEthernet

0/0/0

10.10.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/0

10.10.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/0

20.20.20.0/24  RIP     100  1           D   10.10.10.2      GigabitEthernet

0/0/0

RIP     100  1           D   30.30.30.2      GigabitEthernet

0/0/1

30.30.30.0/24  Direct  0    0           D   30.30.30.1      GigabitEthernet

0/0/1

30.30.30.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/1

30.30.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/1

127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0

127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

192.168.1.0/24  Direct  0    0           D   192.168.1.1     GigabitEthernet

0/0/2

192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/2

192.168.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/2

192.168.3.0/24  RIP     100  1           D   30.30.30.2      GigabitEthernet

0/0/1


6 Use the tracert target address command on PC1 to view the next hop that PC1 passes through when accessing PC2.



PC1 ping PC2 can be pinged successfully


PC>ping 192.168.3.2

Ping 192.168.3.2: 32 data bytes, Press Ctrl_C to break

Request timeout!

From 192.168.3.2: bytes=32 seq=2 ttl=126 time=31 ms

From 192.168.3.2: bytes=32 seq=3 ttl=126 time=16 ms

From 192.168.3.2: bytes=32 seq=4 ttl=126 time=15 ms

From 192.168.3.2: bytes=32 seq=5 ttl=126 time=16 ms

--- 192.168.3.2 ping statistics ---

5 packet(s) transmitted

4 packet(s) received

20.00% packet loss

round-trip min/avg/max = 0/19/31 ms

PC>


7 At this time, if the shortest RIP route is disconnected, the next hop information of AR2 routing table has changed. Cost2 is the two hops from source to destination.


[AR2]int g0/0/1

[AR2-GigabitEthernet0/0/1]sh

[AR2-GigabitEthernet0/0/1]shutdown


[AR2]dis ip routing-table Route Flags: R - relay, D - download to fib

Routing Tables: Public

Destinations : 12       Routes : 12

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

10.10.10.0/24  Direct  0    0           D   10.10.10.1      GigabitEthernet

0/0/0

10.10.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/0

10.10.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/0

20.20.20.0/24  RIP     100  1           D   10.10.10.2      GigabitEthernet

0/0/0

127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0

127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

192.168.1.0/24  Direct  0    0           D   192.168.1.1     GigabitEthernet

0/0/2

192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/2

192.168.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/2

192.168.3.0/24  RIP     100  2           D   10.10.10.2      GigabitEthernet

0/0/0


8 Use the tracert target address command on PC1 to check that there are more next hops and RIP has changed the forwarding path of the data packet.


PC>tracert 192.168.3.2

traceroute to 192.168.3.2, 8 hops max

(ICMP), press Ctrl+C to stop

1  192.168.1.1   15 ms  16 ms  16 ms

2    *10.10.10.2   15 ms  16 ms

3    *20.20.20.1   31 ms  16 ms

4    *192.168.3.2   16 ms  31 ms

PC>


PC1 PC2 can ping successfully

PC>ping 192.168.3.2

Ping 192.168.3.2: 32 data bytes, Press Ctrl_C to break

From 192.168.3.2: bytes=32 seq=1 ttl=125 time=31 ms

From 192.168.3.2: bytes=32 seq=2 ttl=125 time=16 ms

From 192.168.3.2: bytes=32 seq=3 ttl=125 time=31 ms

From 192.168.3.2: bytes=32 seq=4 ttl=125 time=16 ms

From 192.168.3.2: bytes=32 seq=5 ttl=125 time=31 ms

--- 192.168.3.2 ping statistics ---

5 packet(s) transmitted

5 packet(s) received

0.00% packet loss

round-trip min/avg/max = 16/25/31 ms

PC>


9 Packets are captured on AR2 and there are RIP messages.



The priority of RIP in the Huawei simulator is 100. The cost of RIP is recorded based on the hop count. RIP will select a route with a smaller hop count and record the selected route in the routing table. Unselected routes will not be recorded.


OSPF dynamic routing protocol


1 Topology



2 PC1 PC2 configuration



3 AR1 AR2 AR3 configure IP address


AR1 configuration

[AR1]int g0/0/0

[AR1-GigabitEthernet0/0/0]ip address 12.1.1.1 24

[AR1-GigabitEthernet0/0/0]int g0/0/1

[AR1-GigabitEthernet0/0/1]ip address 23.1.1.1 24


AR2 configuration

[AR2]int g0/0/0

[AR2-GigabitEthernet0/0/0]ip address 12.1.1.2 24

[AR2-GigabitEthernet0/0/0]int g0/0/1

[AR2-GigabitEthernet0/0/1]ip address 13.1.1.2 24


AR3 configuration

[AR3]int g0/0/0

[AR3-GigabitEthernet0/0/0]ip address 13.1.1.3 24

[AR3-GigabitEthernet0/0/0]int g0/0/1

[AR3-GigabitEthernet0/0/1]ip address 23.1.1.3 24

[AR3-GigabitEthernet0/0/1]int g0/0/2

[AR3-GigabitEthernet0/0/2]ip address 192.168.1.1 24


4 AR1 AR2 AR3 configure OSPF


AR1 configuration

[AR1]ospf 10 router-id 1.1.1.1

[AR1-ospf-10]area 0.0.0.0//Configuration area is 0

[AR1-ospf-10-area-0.0.0.0]network 12.1.1.1 0.0.0.0

[AR1-ospf-10-area-0.0.0.0]network 23.1.1.1 0.0.0.0


AR2 configuration

[AR2]ospf 10 router-id 2.2.2.2

[AR2-ospf-10]area 0.0.0.0

[AR2-ospf-10-area-0.0.0.0]network 12.1.1.2 0.0.0.0

[AR2-ospf-10-area-0.0.0.0]network 13.1.1.2 0.0.0.0

[AR2-ospf-10-area-0.0.0.0]network 192.168.2.1 0.0.0.0


AR3 configuration

[AR3]ospf 10 router-id 3.3.3.3

[AR3-ospf-10]area 0.0.0.0

[AR3-ospf-10-area-0.0.0.0]network 13.1.1.3 0.0.0.0

[AR3-ospf-10-area-0.0.0.0]network 23.1.1.3 0.0.0.0

[AR3-ospf-10-area-0.0.0.0]network 192.168.1.1 0.0.0.0


5 Check the routing table. OSPF has automatically learned the routes of the entire network.


[AR2]dis ip routing-table Route Flags: R - relay, D - download to fib

Routing Tables: Public

Destinations : 12       Routes : 13

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

12.1.1.0/24  Direct  0    0           D   12.1.1.2        GigabitEthernet

0/0/0

12.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/0

12.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/0

13.1.1.0/24  Direct  0    0           D   13.1.1.2        GigabitEthernet

0/0/1

13.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/1

13.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/1

23.1.1.0/24  OSPF    10   2           D   12.1.1.1        GigabitEthernet

0/0/0

OSPF    10   2           D   13.1.1.3        GigabitEthernet

0/0/1

127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0

127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

192.168.1.0/24  OSPF    10   2           D   13.1.1.3        GigabitEthernet

0/0/1

255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0


6 View AR1 AR2 AR3 adjacency relationship


[AR2]dis ospf peer brief

OSPF Process 10 with Router ID 2.2.2.2

  Peer Statistic Information



7 PC2 can ping PC1



8 Run tracert 192.168.1.100 on PC2 to view the data packet transmission path


PC>tracert 192.168.1.100

traceroute to 192.168.1.100, 8 hops max

(ICMP), press Ctrl+C to stop

1  192.168.2.1   16 ms  <1 ms  15 ms

2  13.1.1.3   16 ms  16 ms  31 ms

3  192.168.1.100   16 ms  15 ms  16 ms

PC>


9 Disconnect port 1 of AR2, and OSPF automatically adjusts the forwarding path.


[AR2]int g0/0/1

[AR2-GigabitEthernet0/0/1]shutdown


PC>tracert 192.168.1.100

traceroute to 192.168.1.100, 8 hops max

(ICMP), press Ctrl+C to stop

1  192.168.2.1   16 ms  16 ms  <1 ms

2  12.1.1.1   31 ms  <1 ms  15 ms

3  23.1.1.3   16 ms  31 ms  16 ms

4    *192.168.1.100   31 ms  16 ms


10 PC1 PC2 can ping successfully


PC>ping 192.168.1.100

Ping 192.168.1.100: 32 data bytes, Press Ctrl_C to break

From 192.168.1.100: bytes=32 seq=1 ttl=128 time<1 ms

From 192.168.1.100: bytes=32 seq=2 ttl=128 time<1 ms

From 192.168.1.100: bytes=32 seq=3 ttl=128 time<1 ms

From 192.168.1.100: bytes=32 seq=4 ttl=128 time<1 ms

From 192.168.1.100: bytes=32 seq=5 ttl=128 time<1 ms

--- 192.168.1.100 ping statistics ---

5 packet(s) transmitted

5 packet(s) received

0.00% packet loss

round-trip min/avg/max = 0/0/0 ms


Capture packets



Summary


In a router running OSPF protocol, all interfaces must be in the same area to establish neighbor/adjacency relationships.


From neighbor to adjacency, takes 40 seconds


If a neighbor does not respond to the relationship confirmation message HELLO for more than 40 seconds, OSOF will consider that the relationship establishment failed.


2WAY neighbor stage


FULL adjacency phase