实验要求:
1、r5为ISP,只能进行ip地址配置:其所有接口配置为公有ip地址
2、r1与r5间使用PPP的PAP认证,r5为主认证方;r2与r5间使用PPP的chap认证,r5为主认证方;r3与r5间使用HDLC封装
3、r1/2/3构建一个MGRE环境,r1为中心站点;r1/4间为点到点GRE
4、整个私有网络基于RIP全网可达
5、所有PC其于环回私有地址为源ip时,可以正常访问r5环回。
实验拓扑图:
实验步骤:
r1与r5间使用PPP的PAP认证,r5为主认证方
[r5]aaa
[r5-aaa]local-user wyf password cipher 123456 #创建账号wyf密码123456
[r5-aaa]local-user wyf service-type ppp #设置账号用途
[r5-aaa]int s4/0/0
[r5-Serial4/0/0]ppp authentication-mode pap #r5对r1发起pap认证
[r5-Serial4/0/0]
[r1]display ip interface brief
[r5-Serial4/0/0]shutdown #关闭
[r5-Serial4/0/0]undo shutdown #重启
[r1]display ip interface brief #查看
[r1-Serial4/0/0]ppp pap local-user wyf password cipher 123456
[r1-Serial4/0/0]display ip interface brief
r2与r5间使用ppp的chap认证,r5为主认证方:
[r5-Serial3/0/0]int s3/0/1
[r5-Serial3/0/1]ppp authentication-mode chap
[r5-Serial3/0/1]ip add 25.1.1.2 24
[r2]ping 25.1.1.2
[r5-Serial3/0/1]shutdown
[r5-Serial3/0/1]undo shutdown
测试: [r2]ping 25.1.1.2
[r2-Serial4/0/0]display ip interface brief #查看
[r2]int s4/0/0
[r2-Serial4/0/0]ppp chap user wyf
[r2-Serial4/0/0]ppp chap password cipher 123456
[r2-Serial4/0/0]display ip interface brief
r3与r5间使用HDLC封装:
[r5]int s4/0/0
[r5-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
[r3]int s4/0/0
[r3-Serial4/0/0]link
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
[r3-Serial4/0/0]ping 35.1.1.2
r1,r2,r3构建一个MGRE环境,r1为中心站点;r1,r4间为点到点GRE
[r1]ip route-static 0.0.0.0 0 15.1.1.2 # r1缺省指向r5
[r1]int Tunnel0/0/0 #在r1上创建Tunnel接口
[r1-Tunnel0/0/0]ip add 10.1.1.1 24 #定义接口的ip地址
[r1-Tunnel0/0/0]tunnel-protocol gre #定义Tunnel的模式为普通GRE
[r1-Tunnel0/0/0]source 15.1.1.1 #定义源ip地址
[r1-Tunnel0/0/0]description 45.1.1.1 #定义目标ip地址
[r2]ip route-static 0.0.0.0 0 25.1.1.2 #r2缺省指向r5
[r3]ip route-static 0.0.0.0 0 35.1.1.2 # r3缺省指向r5
[r4]ip route-static 0.0.0.0 0 45.1.1.2 # r4缺省指向r5
[r4]int Tunnel 0/0/0
[r4-Tunnel0/0/0]ip add 10.0.0.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre
[r4-Tunnel0/0/0]source 45.1.1.1
[r4-Tunnel0/0/0]description 15.1.1.1
测试: [r4-Tunnel0/0/0]ping 10.1.1.1
r1,r2,r3构建一个MGRE环境,r1为中心站点:
[r1]int t
[r1]int Tunnel 0/0/1
[r1-Tunnel0/0/1]ip add 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 15.1.1.1
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r1-Tunnel0/0/1]nhrp network-id 100
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ip add 10.1.2.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.2.1 15.1.1.1 register #r2找r1注册ip
[r2-Tunnel0/0/0]nhrp network-id 100
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 10.1.2.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.2.1 15.1.1.1 register
[r3-Tunnel0/0/0]nhrp network-id 100
测试:[r1-Tunnel0/0/1]ping 10.1.2.2
[r1-Tunnel0/0/1]ping 10.1.2.3
[r1-Tunnel0/0/1]display nhrp peer all
整个私有网络基于RIP全网可达:
[r1]rip 1
[r1-rip-1]ver 2
[r1-rip-1]un summary
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0
[r2]rip 1
[r2-rip-1]ver 2
[r2-rip-1]un summary
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]un summary
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 10.0.0.0
[r4]rip 1
[r4-rip-1]ver 2
[r4-rip-1]un summary
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 10.0.0.0
[r1]display ip routing-table protocol rip
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]undo rip split-horizon #关闭水平分割
[r2]display ip routing-table protocol rip #查看
PC1:
5. 所有pc基于环回私有地址为源IP时,可以正常访问R5环回
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]int s 4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]int s 4/0/0
[r2-Serial4/0/0]nat outbound 2000
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]int s 4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]int s 4/0/0
[r4-Serial4/0/0]nat outbound 2000
这里整个实验就完成啦!