一,实验要求
需求: R1-R2-R3-R4-R5运行RIPV2,R6-R7运行RIPV1
1,使用合理IP地址规划网络,各自创建环回接口
2, R1创建环回172.16.1.1/24 172.16.2.1/24 172.16.3.1/24
3,要求R3使用:2访问R1环回
4,减少路由条目数量,增加路由传递安全性
5, R5创建一一个环回模拟运营商,不能宣告
6, R1 telnet R2环回实际teInet到R7上
7, R6-R7路由器不能学习到达R1环回路由
8,全网可达
二,实验步骤
R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 1.0.0.1 24
[R1]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip add 4.0.0.1 24
[R1-GigabitEthernet0/0/1]int l0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]int l 1
[R1-LoopBack1]ip add 172.16.1.1 24
[R1]int l2
[R1-LoopBack2]ip add 172.16.2.1 24
[R1-LoopBack2]int l 3
[R1-LoopBack3]ip add 172.16.3.1 24
R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 1.0.0.2 24
[R2-GigabitEthernet0/0/0]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 2.0.0.1 24
[R2-GigabitEthernet0/0/1]q
[R2]int l 0
[R2-LoopBack0]ip add 2.2.2.2 24
R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 3.0.0.1 24
[R3-GigabitEthernet0/0/0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 2.0.0.2 24
[R3-GigabitEthernet0/0/1]q
[R3]int l 0
[R3-LoopBack0]ip add 3.3.3.3 24
R4
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]
[R4-GigabitEthernet0/0/0]ip add 4.0.0.2 24
[R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 3.0.0.2 24
[R4-GigabitEthernet0/0/1]
[R4-GigabitEthernet0/0/1]q
[R4]int l0
[R4-LoopBack0]q
[R4]int g 0/0/2
[R4-GigabitEthernet0/0/2]ip add 5.0.0.1 24
[R4-GigabitEthernet0/0/2]int g 4/0/0
[R4-GigabitEthernet4/0/0]ip add 6.0.0.1 24
[R4-GigabitEthernet4/0/0]
[R4-GigabitEthernet4/0/0]q
[R4]int l0
[R4-LoopBack0]ip add 4.4.4.4 24
R5
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 5.0.0.2 24
[R5-GigabitEthernet0/0/0]q
[R5]int l0
[R5-LoopBack0]ip add 5.5.5.5 24
R6
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 6.0.0.2 24
[R6-GigabitEthernet0/0/0]int g 0/0/1
[R6-GigabitEthernet0/0/1]ip add 7.0.0.1 24
[R6-GigabitEthernet0/0/1]q
[R6]int l0
[R6-LoopBack0]ip add 6.6.6.6 24
R7
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]ip add 7.0.0.2 24
[R7-GigabitEthernet0/0/0]q
[R7]int l0
[R7-LoopBack0]ip add 7.7.7.7 24
第2步,配置路由
R1
[R1]rip 1
[R1-rip-1]v 2
[R1-rip-1]net
[R1-rip-1]network 1.0.0.0
[R1-rip-1]network 4.0.0.0
[R1-rip-1]network 172.0.0.0
R2
[R2]rip 1
[R2-rip-1]
[R2-rip-1]v 2
[R2-rip-1]net
[R2-rip-1]network 1.0.0.0
[R2-rip-1]network 2.0.0.0
R3
[R3]rip 1
[R3-rip-1]v 2
[R3-rip-1]net
[R3-rip-1]network 2.0.0.0
[R3-rip-1]network 3.0.0.0
R4
[R4]rip 1
[R4-rip-1]v 2
[R4-rip-1]net
[R4-rip-1]network 4.0.0.0
[R4-rip-1]network 3.0.0.0
[R4-rip-1]network 5.0.0.0
[R4-rip-1]network 6.0.0.0
R5
[R5]rip 1
[R5-rip-1]v 2
[R5-rip-1]net
[R5-rip-1]network 5.0.0.0
R6
[R6]rip 1
[R6-rip-1]v 1
[R6-rip-1]net
[R6-rip-1]network 6.0.0.0
[R6-rip-1]network 7.0.0.0
R7
[R7]rip 1
[R7-rip-1]v 1
[R7-rip-1]net
[R7-rip-1]network 7.0.0.0
第3步:R3使用R2访问R1环回(先进行汇总)
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]rip sun
[R1-GigabitEthernet0/0/0]rip sum
[R1-GigabitEthernet0/0/0]rip summary-address 172.16.0.0 255.255.252.0
[R1-GigabitEthernet0/0/0]int g 0/0/1
[R1-GigabitEthernet0/0/1]rip summary-address 172.16.0.0 255.255.252.0
[R1-GigabitEthernet0/0/1]
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3-acl-basic-2000]rule permit source 1.1.1.0 0
[R3-acl-basic-2000]int g 0/0/0
[R3-GigabitEthernet0/0/0]rip metricout 2000 10
[R3-GigabitEthernet0/0/0]q
----接口之间做认证口令----
认证时标准(usual)与口令(123456)需一致
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]rip auth
[R1-GigabitEthernet0/0/0]rip authentication-mode md5 usual cip
[R1-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
[R1-GigabitEthernet0/0/0]q
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]rip auth
[R2-GigabitEthernet0/0/0]rip authentication-mode md5 us
[R2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cip
[R2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3-acl-basic-2000]rule permit source 1.1.1.0 0
[R3-acl-basic-2000]int g 0/0/0
[R3-GigabitEthernet0/0/0]rip metricout 2000 10
[R3-GigabitEthernet0/0/0]q
第4步:R4上配置缺省路由指向R5
[R4]ip route-static 0.0.0.0 0 5.0.0.2
[R4]rip 1
[R4-rip-1]default-route originate
[R1]ping 5.5.5.5
PING 5.5.5.5: 56 data bytes, press CTRL_C to break
Request time out
Reply from 5.5.5.5: bytes=56 Sequence=2 ttl=254 time=40 ms
Reply from 5.5.5.5: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 5.5.5.5: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 5.5.5.5: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 5.5.5.5 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 20/30/40 ms
第5步:在R6的0/0/0端口添加rip version 2
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]rip ver
[R6-GigabitEthernet0/0/0]rip version 2
[R6-GigabitEthernet0/0/0]q
第6步:在R7上创建 telnet
[R7]aaa
[R7-aaa]local-user admin privilege level 15 password cipher 123456
[R7-aaa]local-user admin service-type telnet
[R7]user-interface vty 0 4
[R7-ui-vty0-4]authentication-mode aaa --- 选择认证模式aaa
[R7-ui-vty0-4]
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]nat server protocol tcp global interface loopback 0 23
inside 7.7.7.7 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
[R2-GigabitEthernet0/0/0]q
因为负载均衡的缘故,所以将去和回的另一条道路开销值增大。
[R2]acl 2000
[R2-acl-basic-2000]rule permit source 7.0.0.0 0
[R2-acl-basic-2000]q
[R2]int g 0/0/1
[R2-GigabitEthernet0/0/1]rip metricin 2000 5
[R4]acl 2000
[R4-acl-basic-2000]rule per
[R4-acl-basic-2000]rule permit sou
[R4-acl-basic-2000]rule permit source 1.0.0.0 0
[R4-acl-basic-2000]q
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]rip met
[R4-GigabitEthernet0/0/0]rip metricin 2000 10
最后一步:路由过滤 --- R6-R7路由器不能学习到达R1环回路由
[R6]acl 2000
[R6-acl-basic-2000]rule deny source 1.1.1.0 0
[R6-acl-basic-2000]rule deny source 172.16.0.0 0.0.255.255
[R6-acl-basic-2000]rule permit source any
[R6-acl-basic-2000]q
[R6]rip 1
[R6-rip-1]filter-policy 2000 import
[R6-rip-1]q