题目要求如下:
根据题目设计及出拓扑:
首先分析题目:
1.R5为isp,R1和R5之间为ppp的pap认证;
2.R2和R5之间为ppp的chap认证;
3.R3和R5之间为hdlc;
4.R1,R2,R3之间为mgre,且R1为中心;
5.R1和R4之间为GRE;
6.pc间的路由用rip;
7.R1,R2,R3,R4设置NAT。
一.给路由器间的接口(公网)配置ip地址,R5有个环回(5.5.5.5/24)
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]ip address 15.1.1.1 24
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]ip address 25.1.1.1 24
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ip address 35.1.1.1 24
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip address 45.1.1.1 24
[isp]interface Serial 4/0/0
[isp-Serial4/0/0]ip address 15.1.1.2 24
[isp]interface Serial 4/0/1
[isp-Serial4/0/1]ip address 25.1.1.2 24
[isp]interface Serial 3/0/0
[isp-Serial3/0/0]ip address 35.1.1.2 24
[isp]interface GigabitEthernet 0/0/0
[isp-GigabitEthernet0/0/0]ip address 45.1.1.2 24
[isp]interface LoopBack 0
[isp-LoopBack0]ip address 5.5.5.5 24
二.配置R1和R5之间ppp的pap认证
[isp]aaa
[isp-aaa]local-user cisco password cipher redhat
Info: Add a new user.
[isp-aaa]local-user cisco service-type ppp
[isp-aaa]quit
[isp]interface Serial 4/0/0
[isp-Serial4/0/0]ppp authentication-mode pap
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]ppp pap local-user cisco password cipher redhat
三.设置R2和R5之间ppp的chap认证
[isp]aaa
[isp-aaa]local-user cisco2 password cipher redhat
[isp-aaa]local-user cisco2 service-type ppp
[isp-aaa]quit
[isp]interface Serial 4/0/1
[isp-Serial4/0/1]ppp authentication-mode chap
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]ppp chap password cipher redhat
四.R3和R5之间设置为hdlc
[isp]interface Serial 3/0/0
[isp-Serial3/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
五.R1,R2,R3,R4到isp的缺省路由
[r1]ip route-static 0.0.0.0 0 15.1.1.2
[r2]ip route-static 0.0.0.0 0 25.1.1.2
[r3]ip route-static 0.0.0.0 0 35.1.1.2
[r4]ip route-static 0.0.0.0 0 45.1.1.2
六.将R1,R2,R3之间设置为mgre,且R1为中心
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.1.1.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic //将r1设置为中心
[r1-Tunnel0/0/0]nhrp network-id 100
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ip address 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source Serial 4/0/0
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register //注册
[r2-Tunnel0/0/0]nhrp network-id 100
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register //注册
[r3-Tunnel0/0/0]nhrp network-id 100
七.将R1和R4之间设置为GRE
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.1.1.1
[r1-Tunnel0/0/1]destination 45.1.1.1
[r4]interface Tunnel 0/0/1
[r4-Tunnel0/0/1]ip address 10.1.2.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.1.1.1
[r4-Tunnel0/0/1]description 15.1.1.1
8.给私有网络配置RIP
(1)给路由器和pc端口配置ip地址,并手动给四台pc填写ip地址,子网掩码,网关。
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.16.1.1 24
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.16.2.1 24
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.16.3.1 24
[r4]interface GigabitEthernet 0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.16.4.1 24
然后手动给pc配置地址。
(2)pc获取地址之后就是RIP了。(r1是mgre的中心,需要给其接口关闭rip,使其他路由器可以从它这里学到rip)
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]undo summary
[r1-rip-1]network 192.16.1.0
[r1-rip-1]network 10.0.0.0
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon //关闭tunnel接口的rip
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]undo summary
[r2-rip-1]network 192.16.2.0
[r2-rip-1]network 10.0.0.0
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]undo summary
[r3-rip-1]network 192.16.3.0
[r3-rip-1]network 10.0.0.0
[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]undo summary
[r4-rip-1]network 192.16.4.0
[r4-rip-1]network 10.0.0.0
九.给路由器开启NAT设置
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.16.1.0 0.0.0.255
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.16.2.0 0.0.0.255
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]nat outbound 2000
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.16.3.0 0.0.0.255
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.16.4.0 0.0.0.255
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000
到这里我们就做完了,我们可以测试一下,用pc1来ping isp,看是否可以上网。
可以上网。
然后测试pc1和其他pc是否可以ping通。我们用pc2试试。
这里我们pc2 ping pc1可以通。说明我们已经完成了。