Topology diagram
In the network shown in the figure, we will deploy RIPV2 on each router, so that each network segment in the network can communicate with each other.
R1 configuration
<Huawei>system-view
[Huawei]sysname R1
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.1 30
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 172.16.1.254 24
//创建rip进程
[R1]rip 1
//版本选2
[R1-rip-1]version 2
//宣告进rip
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 172.16.0.0
R2 configuration
<Huawei>system-view
[Huawei]sysname R2
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.1.2 30
[R2-GigabitEthernet0/0/1]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 192.168.1.5 30
//创建rip进程
[R2]rip 1
//版本选2
[R2-rip-1]version 2
//宣告进rip
[R2-rip-1]network 192.168.1.0
R3 configuration
<Huawei>system-view
[Huawei]sysname R3
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.6 30
[R3-GigabitEthernet0/0/1]int g0/0/2
[R3-GigabitEthernet0/0/2]ip add 172.16.31.254 24
//创建rip进程
[R3]rip 1
//版本选2
[R3-rip-1]version 2
//宣告进rip
[R3-rip-1]network 192.168.1.0
[R3-rip-1]network 172.16.0.0
Use the display rip 1 interface command to view which interfaces of the device have RIP activated. Take R1 as an example: the
router stores all the routes discovered through RIP in the RIP database. Use the display rip 1 database command to view the database of RIP process 1. , Take R1 as an example:
From the above output, it can be seen that R1 found the directly connected network segments 172.16.1.0/24 and 192.168.10/30. Because of this, the two network segments are directly connected to the local interface, so their metric values Both are 0. In addition, R1 also learns routes 172.16.31.0/24 and 192.168.1.4/30 through RIP. The metric values of these two routes are 2 hops and 1 hop respectively.
Now, the three routers already know the routes to each segment of the network, and the RIP routes learned by R1 are as follows:
The RIP routes learned by R2 are as follows:
The RIP routing learned by R3 is as follows:
In this way, the intercommunication of various network segments of the entire network is realized.