项目背景
规划与配置接口 IP地址
AR1:
[AR1-GigabitEthernet0/0/0]ip address 20.0.1.1 24
[AR1-GigabitEthernet0/0/1]ip address 10.0.1.1 24
AR2:
[AR2-GigabitEthernet0/0/0]ip address 20.0.1.2 24
[AR2-GigabitEthernet0/0/1]ip address 20.0.2.1 24
AR3
[AR3-GigabitEthernet0/0/0]ip address 20.0.2.2 24
[AR3-GigabitEthernet0/0/1]ip address 10.0.2.1 24
配置loopback 地址
LoopBack0 192.168.1.1/24 up up(s)
LoopBack1 192.168.2.1/24 up up(s)
LoopBack2 192.168.3.1/24 up up(s)
各设备配置 RIP 宣告
AR1:
network 20.0.0.0
network 10.0.0.0
AR2:
network 20.0.0.0
network 10.0.0.0
AR3:
network 20.0.0.0
network 10.0.0.0
在各设备开启V2 版本,默认是 版本1
[AR1-rip-2]version 2
在各设备上查看RIP 路由表项,检查是否学习到了。
dis ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.2.0/24 RIP 100 2 D 20.0.1.2 GigabitEthernet 0/0/0
20.0.2.0/24 RIP 100 1 D 20.0.1.2 GigabitEthernet 0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
PC1 PING PC2测试连通性
PC>ping 10.0.1.2
Ping 10.0.1.2: 32 data bytes, Press Ctrl_C to break
From 10.0.1.2: bytes=32 seq=1 ttl=125 time=15 ms
From 10.0.1.2: bytes=32 seq=2 ttl=125 time=32 ms
From 10.0.1.2: bytes=32 seq=3 ttl=125 time=31 ms
From 10.0.1.2: bytes=32 seq=4 ttl=125 time=16 ms
From 10.0.1.2: bytes=32 seq=5 ttl=125 time=31 ms
--- 10.0.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/25/32 ms
在AR1 RIP视图引入loopback 地址
[AR1]rip 2
[AR1-rip-2]import-route direct
各设备查看RIP路由表后,发现引入后路由表条目比较多,下面在AR1 接口上做手动聚合
[AR1-GigabitEthernet0/0/0]rip summary-address 192.168.0.0 255.255.252.0
在AR2查看路由表,手工聚合成功
[AR2]dis ip routing-table protocol rip
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.1.0/24 RIP 100 1 D 20.0.1.1 GigabitEthernet 0/0/0
10.0.2.0/24 RIP 100 1 D 20.0.2.2 GigabitEthernet 0/0/1
192.168.0.0/22 RIP 100 1 D 20.0.1.1 GigabitEthernet 0/0/0
在AR1出口加开销值
[AR1-GigabitEthernet0/0/0]rip metricout 5
//如果需要配置入口则配置命令为:metricin//
查看AR2 路由表,发现开销发生变化
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.1.0/24 RIP 100 5 D 20.0.1.1 GigabitEthernet0/0/0
10.0.2.0/24 RIP 100 1 D 20.0.2.2 GigabitEthernet0/0/1
192.168.0.0/22 RIP 100 5 D 20.0.1.1 GigabitEthernet0/0/0
在AR1上更改优先级
[AR1]rip 2
[AR1-rip-2]preference 10
查表验证,本地RIP 优先级已经改变
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.2.0/24 RIP 10 7 D 20.0.1.2 GigabitEthernet0/0/0
20.0.2.0/24 RIP 10 6 D 20.0.1.2 GigabitEthernet0/0/0
在AR2上做认证
[Huawei-GigabitEthernet0/0/1]rip authentication-mode simple huawei
等待一会,在AR3上查看路由表,发现没有学习到RIP 路由。
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.2.0/24 Direct 0 0 D 10.0.2.1 GigabitEthernet 0/0/1
10.0.2.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
10.0.2.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
20.0.2.0/24 Direct 0 0 D 20.0.2.2 GigabitEthernet0/0/0
20.0.2.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
20.0.2.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/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
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
在对端设备配置相同命令,即可学习到RIP 路由。
抑制RIP报文在接口上的发送
[AR1-rip-2]silent-interface g0/0/1 //静默接口 只接受 不发送报文