| HCNA-21 RIP路由协议基本配置 
 
 基本配置 <Huawei>system-view [Huawei]sysname r1[r1]interface GigabitEthernet 0/0/0
 [r1-GigabitEthernet0/0/0]ip address 172.16.10.1 24 [r1-GigabitEthernet0/0/0]quit [r1]interface LoopBack 0  //创建环回口 [r1-LoopBack0]ip address 192.168.1.100 32 [r1-LoopBack0]quit   <Huawei>system-view [Huawei]sysname r2 [r2]interface GigabitEthernet 0/0/0 [r2-GigabitEthernet0/0/0]ip address 172.16.10.2 24 [r2-GigabitEthernet0/0/0]quit [r2]interface LoopBack 0 [r2-LoopBack0]ip address 192.168.2.100 32 [r2-LoopBack0]quit 
   使用RIP v1搭建网络 [r1]rip  //创建RIP协议进程 默认进程号为1 [r1-rip-1]network 172.16.0.0  //宣告参与RIP的网段 [r1-rip-1]network 192.168.1.0 [r1-rip-1]quit   [r2]rip [r2-rip-1]network 172.16.0.0 [r2-rip-1]network 192.168.2.0 [r2-rip-1]quit   [r1]display ip routing-table  //查看IP路由表 Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public         Destinations : 9        Routes :9           Destination/Mask   Proto   Pre  Cost     Flags NextHop         Interface ……  192.168.1.100/32  Direct  0   0           D   127.0.0.1       LoopBack0     192.168.2.0/24  RIP    100  1           D  172.16.10.2     GigabitEthernet 0/0/0 255.255.255.255/32 Direct  0    0          D   127.0.0.1       InLoopBack0   [r2]display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public         Destinations : 9        Routes :9           Destination/Mask   Proto   Pre  Cost     Flags NextHop         Interface ……  172.16.10.255/32  Direct  0   0           D   127.0.0.1       GigabitEthernet 0/0/0     192.168.1.0/24  RIP    100  1           D  172.16.10.1     GigabitEthernet 0/0/0  192.168.2.100/32  Direct  0   0           D   127.0.0.1       LoopBack0 255.255.255.255/32 Direct  0    0          D   127.0.0.1       InLoopBack0   [r1]ping -a 192.168.1.100 192.168.2.100  //R1使用源目标IP Ping R2的环回口   PING192.168.2.100: 56  data bytes, pressCTRL_C to break     Reply from192.168.2.100: bytes=56 Sequence=1 ttl=255 time=150 ms     Reply from192.168.2.100: bytes=56 Sequence=2 ttl=255 time=10 ms     Reply from192.168.2.100: bytes=56 Sequence=3 ttl=255 time=30 ms     Reply from192.168.2.100: bytes=56 Sequence=4 ttl=255 time=10 ms     Reply from192.168.2.100: bytes=56 Sequence=5 ttl=255 time=30 ms     ---192.168.2.100 ping statistics ---     5 packet(s)transmitted     5packet(s) received     0.00%packet loss round-trip min/avg/max =10/46/150 ms   <r1>debugging rip 1  //查看RIP协议定期更新情况 <r1>terminal debugging  //开启RIP终端调试功能 <r1>terminal monitor  //终端监视 <r1>undo debugging all <r1>debugging rip 1 event  //查看路由器发出和接收的定期事件 
   使用RIP v2搭建网络 [r1]rip  [r1-rip-1]version 2 //版本V2 [r1-rip-1]quit   [r2]rip [r2-rip-1]version 2 [r2-rip-1]quit   [r1]display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public         Destinations : 9        Routes :9           Destination/Mask   Proto   Pre  Cost     Flags NextHop         Interface ……  172.16.10.255/32  Direct  0   0           D   127.0.0.1       GigabitEthernet 0/0/0  192.168.1.100/32  Direct  0   0           D   127.0.0.1       LoopBack0   192.168.2.100/32  RIP    100  1           D  172.16.10.2     GigabitEthernet 0/0/0 255.255.255.255/32 Direct  0    0          D   127.0.0.1       InLoopBack0   [r2]display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public         Destinations : 9        Routes : 9           Destination/Mask   Proto   Pre  Cost     Flags NextHop         Interface ……  172.16.10.255/32  Direct  0   0           D   127.0.0.1       GigabitEthernet 0/0/0   192.168.1.100/32  RIP    100  1           D  172.16.10.1     GigabitEthernet 0/0/0  192.168.2.100/32  Direct  0   0           D   127.0.0.1       LoopBack0 255.255.255.255/32 Direct  0    0          D   127.0.0.1       InLoopBack0   [r1]ping -a 192.168.1.100 192.168.2.100   PING192.168.2.100: 56  data bytes, pressCTRL_C to break     Reply from192.168.2.100: bytes=56 Sequence=1 ttl=255 time=20 ms     Reply from192.168.2.100: bytes=56 Sequence=2 ttl=255 time=20 ms     Reply from192.168.2.100: bytes=56 Sequence=3 ttl=255 time=20 ms     Reply from192.168.2.100: bytes=56 Sequence=4 ttl=255 time=30 ms     Reply from192.168.2.100: bytes=56 Sequence=5 ttl=255 time=20 ms     ---192.168.2.100 ping statistics ---     5packet(s) transmitted     5packet(s) received     0.00%packet loss round-trip min/avg/max =20/22/30 ms |