实验拓扑
实验要求
1.R3环回为3.3.3.0/24
2.其他基于192.168.1.0/24划分
3.R1/2 均存在两个环回
4.整个网络运行RIPV2,但不能直接宣告R3的环回
5.全网可达,保障更新安全,减少路由条目数量,避免出现环路
实验内容
地址划分的结果为:
首先就开始配地址
R1
[Huawei]sys r1
[r1]int lo0
[r1-LoopBack0]ip add 192.168.1.65 27
[r1-LoopBack0]int lo1
[r1-LoopBack1]ip add 192.168.1.97 27
[r1-LoopBack1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 27
R2
[Huawei]sys r2
[r2]int lo0
[r2-LoopBack0]ip add 192.168.1.129 27
[r2-LoopBack0]int lo1
[r2-LoopBack1]ip add 192.168.1.161 27
[r2-LoopBack1]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 27
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.33 27
R3
[Huawei]sys r3
[r3]int lo0
[r3-LoopBack0]ip add 3.3.3.3 24
[r3-LoopBack0]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.34 27
测试ping直连
[r1]ping 192.168.1.2
PING 192.168.1.2: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.2: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 192.168.1.2: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 192.168.1.2: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 192.168.1.2: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 192.168.1.2: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/24/40 ms
直连是通的
然后就是路由了,起RIP协议
R1
[r1]rip 1
[r1-rip-1]ver
[r1-rip-1]vers
[r1-rip-1]version 2
[r1-rip-1]net
[r1-rip-1]network 192.168.1.0
R2
[r2]rip 1
[r2-rip-1]vers
[r2-rip-1]version 2
[r2-rip-1]netw
[r2-rip-1]network 192.168.1.0
R3
[r3]rip 1
[r3-rip-1]vers
[r3-rip-1]version 2
[r3-rip-1]net
[r3-rip-1]network 192.168.1.0
测试
用R1pingR3的g0/0/0口的ip地址
[r1]ping 192.168.1.34
PING 192.168.1.34: 56 data bytes, press CTRL_C to break
Request time out
Reply from 192.168.1.34: bytes=56 Sequence=2 ttl=254 time=40 ms
Reply from 192.168.1.34: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 192.168.1.34: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 192.168.1.34: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 192.168.1.34 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 30/32/40 ms
由于不能宣告R3的环回,则需要在R1/2上写到R3的缺省
R1
[r1]ip route-static 0.0.0.0 0 192.168.1.2
R2
[r2]ip route-static 0.0.0.0 0 192.168.1.34
用R1pingR3的环回
[r1]ping 3.3.3.3
PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=40 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=30 ms
发现是可以通的,这样就实现了全网可达了
因为在R1,R2上的环回是汇总的,我们在需要在R1/2上写空接口防环路由
在R2上
[r2]ip route-static 192.168.1.128 26 null 0
R1
[r1]ip route-static 192.168.1.64 26 null 0
大家可以自己简单的测试
实验结束