一、实验拓扑及实验需求
二、实验操作
1、合理配置IP
2、进行ppp封装
R2和R3之间进行ppp认证
对主认证方R2:
[isp]aaa
[isp-aaa]local-user a password cipher 123456//账户为a,密码为123456
[isp-aaa]local-user a service-type ppp
[isp-aaa]q
[isp]int s3/0/1
[isp-Serial3/0/1]ppp authentication-mode pap
对R3:
[r3-Serial4/0/0]ppp pap local-user a password cipher 123456
运行结果:
R2和R4之间进行chap认证
对主认证方R2:
[isp]aaa
[isp-aaa]local-user a password cipher 123456
[isp-aaa]local-user a service-type ppp
[isp-aaa]q
[isp]int s4/0/0
[isp-Serial4/0/0]ppp authentication-mode chap
对R4:
[r4]int s4/0/1
[r4-Serial4/0/1]ppp chap password cipher 123456
运行结果:
3、构建MGRE环境
R1上配置:
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.4.1 24 //在r1上创建地址为192.168.4.1的接口
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp //定义该隧道为多点gre隧道且为多对多
[r1-Tunnel0/0/0]source 14.1.1.1 //该隧道加封装的报头源ip地址
[r1-Tunnel0/0/0]nhrp entry multicast dynamic //本地成为NHRP服务端
[r1-Tunnel0/0/0]nhrp network-id 99 //NHRP的工作编号,该网段所有设备必须在同一id
R2上配置:
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ip add 192.168.4.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source s4/0/0
[r2-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 register
[r2-Tunnel0/0/0]nhrp network-id 99
R3上配置:
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 192.168.4.2 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source s4/0/1
[r3-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 register
[r3-Tunnel0/0/0]nhrp network-id 99
运行结果:
4、RIP获取路由
[r1]rip
[r1-rip-1]vers 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.4.0
[r2]rip
[r2-rip-1]vers 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.4.0
[r3]rip
[r3-rip-1]vers 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.4.0
关闭R1的水平分割
[r1-Tunnel0/0/0]undo rip split-horizon
运行结果
5、使PC机可以访问ISP环回
在边界路由器接口上进行nat配置
对R1为例:
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1]int s4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r1-Serial4/0/0]q
运行结果: