1. 配置ip地址
R1:
R2:
R3:
R5:
R6:
R7:
3.全网可达
R2:
[r2]rip
[r2-rip-1]version 2
[r2-rip-1]network 192.168.3.0
[r2-rip-1]network 192.168.1.0
[r2-rip-1]network 2.0.0.0
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
[r2-GigabitEthernet0/0/0]int g 0/0/1
[r2-GigabitEthernet0/0/1]rip authentication-mode md5 usual cipher 123456
R3:
[r3]rip
[r3-rip-1]version 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.4.0
[r3-rip-1]network 3.0.0.0
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
[r3-GigabitEthernet0/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/1]rip authentication-mode md5 usual cipher 123456
R4:
[r4]rip
[r4-rip-1]version 2
[r4-rip-1]network 192.168.2.0
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.5.0
[r4-rip-1]network 192.168.6.0
[r4-rip-1]network 4.0.0.0
[r4-rip-1]quit
[r4]ip route-static 0.0.0.0 0 192.168.5.2
[r4]rip
[r4-rip-1]default-route originate
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]rip authentication-mode md5 usual cipher 123456
[r4-GigabitEthernet0/0/1]int g 0/0/2
[r4-GigabitEthernet0/0/2]rip authentication-mode md5 usual cipher 123456
[r4-GigabitEthernet0/0/2]int g 4/0/0
[r4-GigabitEthernet4/0/0]rip authentication-mode md5 usual cipher 123456
R5:
[r5]rip
[r5-rip-1]version 2
[r5-rip-1]network 192.168.5.0
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
R6:
[r6]rip
[r6-rip-1]version 1
[r6-rip-1]network 192.168.6.0
[r6-rip-1]network 192.168.7.0
[r6-rip-1]network 6.0.0.0
[r6-rip-1]quit
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]rip version 2
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
[r6-GigabitEthernet0/0/0]int g 0/0/1
[r6-GigabitEthernet0/0/1]rip authentication-mode md5 usual cipher 123456
R7:
[r7]rip
[r7-rip-1]version 1
[r7-rip-1]network 192.168.7.0
[r7-rip-1]network 7.0.0.0
[r7]int g 0/0/0
[r7-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
4.R3使用R2访问R1的环回
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r3-acl-basic-2000]q
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]rip metricin 2000 10
5. R1telnetR2的环回实际telnetR7上
R7:
[r7]aaa
[r7-aaa]local-user 111 privilege level 15 password cipher 123456
[r7-aaa]local-user 111 service-type telnet
[r7-aaa]q
[r7]user-interface vty 0 4
[r7-ui-vty0-4]authentication-mode aaa
R2:
[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]
配完之后因为R2找7.7.7.0/24的时候走的是两条路,我们只能往R3走,不能往R1上走,所以需要
将走R1上的开销值修改大一点,同理,在R4回的时候也有两条路,这里只能通过R3回到R2上才
行,所以也需要将R4到R1的开销值修改大一点。
R2:
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/0
[r2-GigabitEthernet0/0/0]rip metricin 2000 10
R4:
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.1.0 0
[r4-acl-basic-2000]q
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]rip metricin 2000 10
6. R6和R7不能学习到R1的环回
[r6]acl 2000
[r6-acl-basic-2000]rule deny source 172.16.0.0 0.0.255.255 抓取R1环回地址流量,不允许通过
[r6-acl-basic-2000]rule permit source any
[r6-acl-basic-2000]q
[r6]rip
[r6-rip-1]filter-policy 2000 import
7.对结果进行检测
R1:
R2:
R3:
R4:
R5:
R6:
R7: