对R1
[r1]int l0
[r1-LoopBack0]ip add 1.1.1.1 24
[r1-LoopBack0]int l1
[r1-LoopBack1]ip add 172.16.1.1 24
[r1-LoopBack1]int l2
[r1-LoopBack2]ip add 172.16.2.1 24
[r1-LoopBack2]int l3
[r1-LoopBack3]ip add 172.16.3.1 24
[r1-LoopBack3]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[r1-GigabitEthernet0/0/0]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 14.0.0.1 24
?对R2
[r2]int l0
[r2-LoopBack0]ip add 2.2.2.2 24
[r2-LoopBack0]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[r2-GigabitEthernet0/0/0]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add 23.0.0.1 24
对R3
[r3]int l0
[r3-LoopBack0]ip add 3.3.3.3 24
[r3-LoopBack0]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 23.0.0.2 24?
[r3-GigabitEthernet0/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 34.0.0.2 24
对R4
[r4]int l0
[r4-LoopBack0]ip add 4.4.4.4 24
[r4-LoopBack0]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 14.0.0.2 24
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip add 34.0.0.1 24
[r4-GigabitEthernet0/0/1]int g 0/0/2
[r4-GigabitEthernet0/0/2]ip add 45.0.0.1 24
[r4-GigabitEthernet0/0/2]int g 4/0/0
[r4-GigabitEthernet4/0/0]ip add 46.0.0.1 24
对R5
[r5]int l0
[r5-LoopBack0]ip add 5.5.5.5 24
[r5-LoopBack0]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.0.0.2 24
对R6
[r6]int l0
[r6-LoopBack0]ip add 6.6.6.6 24
[r6-LoopBack0]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip add 46.0.0.2 24
[r6-GigabitEthernet0/0/0]int g 0/0/1
[r6-GigabitEthernet0/0/1]ip add 67.0.0.1 24
对R7
[r7]int l0
[r7-LoopBack0]ip add 7.7.7.7 24
[r7-LoopBack0]int g 0/0/0
[r7-GigabitEthernet0/0/0]ip add 67.0.0.2 24
宣告
对R1宣告
[r1]rip
[r1-rip-1]version 2
[r1-rip-1]network 1.0.0.0
[r1-rip-1]network 172.16.0.0
[r1-rip-1]network 12.0.0.0
[r1-rip-1]network 14.0.0.0
对R2宣告
[r2]rip
[r2-rip-1]version 2
[r2-rip-1]network 2.0.0.0
[r2-rip-1]network 12.0.0.0
[r2-rip-1]network 23.0.0.0
对R3宣告
[r3]rip
[r3-rip-1]version 2
[r3-rip-1]network 3.0.0.0
[r3-rip-1]network 23.0.0.0
[r3-rip-1]network 34.0.0.0
对R4宣告
[r4]rip
[r4-rip-1]version 2
[r4-rip-1]network 34.0.0.0
[r4-rip-1]network 14.0.0.0
[r4-rip-1]network 45.0.0.0
[r4-rip-1]network 46.0.0.0
[r4-rip-1]network 4.0.0.0
对R5宣告
[r5]rip
[r5-rip-1]version 2
[r5-rip-1]network 45.0.0.0
[r5-rip-1]network 5.0.0.0
对R6宣告
[r6]rip
[r6-rip-1]version 1
[r6-rip-1]network 6.0.0.0
[r6-rip-1]network 46.0.0.0
[r6-rip-1]network 67.0.0.0
对R7宣告
[r7]rip
[r7-rip-1]version 1
[r7-rip-1]network 7.0.0.0
[r7-rip-1]network 67.0.0.0
R1环回汇总
[r1]int g 0/0/0
[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
R3接口设置ACL和COST值
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0
[r3-acl-basic-2000]rule permit source 1.1.1.0 0
[r3-acl-basic-2000]int g 0/0/1
[r3-GigabitEthernet0/0/1]rip metricin 2000 10
加密认证
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
R5创建环回,充当ISP,不能宣告
[r5]int l1
[r5-LoopBack1]ip add 10.0.0.1 24
R4配置缺省路由
[r4]ip route-static 0.0.0.0 0 45.0.0.2
[r4]rip
[r4-rip-1]default-route originate
R6配置RIPV2
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]rip version 2
R7上创建用户并开启telnet服务
[r7]aaa
[r7-aaa]local-user bai privilege level 15 password cipher 123456
[r7-aaa]local-user bai service-type telnet
[r7]user-interface vty 0 4
[r7-ui-vty0-4]authentication-mode aaa
R2上设置nat
[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
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 7.0.0.0 0
[r2-acl-basic-2000]int g 0/0/0
[r2-GigabitEthernet0/0/0]rip metricin 2000 5
R4增大COST值
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 12.0.0.0 0
[r4-acl-basic-2000]int g 0/0/0
[r4-GigabitEthernet0/0/0]rip metricin 2000 10
telnet R2 环回登录到R7
?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]rip
[r6-rip-1]filter-policy 2000 import
?
至此,这个实验就完成了
|