1.R1和R5间使用ppp的pap认证,R5为主认证方。
对R5进行配置:
[ISP]aaa
[ISP-aaa]local-user R1 password cipher 123456
Info: Add a new user.
[ISP-aaa]local-user R1 service-type ppp
[ISP]interface s 3/0/0
[ISP-Serial3/0/0]link-protocol ppp
[ISP-Serial3/0/0]ppp authentication-mode pap
对R1进行配置:
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]ppp pap local-user R1 password cipher 123456
2.R2和R5之间使用ppp的chap认证,R5为主认证方
对R5进行配置:
[ISP]aaa
[ISP-aaa]local-user R2 password cipher 123456
Info: Add a new user.
[ISP-aaa]local-user R2 service-type ppp
[ISP]interface Serial 3/0/1
[ISP-Serial3/0/1]ppp authentication-mode chap
对R2进行配置:
[r2-Serial4/0/0]ppp chap user R2
[r2-Serial4/0/0]ppp chap password cipher 123456
3.R3与R5之间使用HDLC封装
对R5进行配置:
[ISP-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
对R3进行配置:
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
4.R1/R2/R3构建一个MGRE环境,R1为中心站点
(1).必须在边界路由器上配置缺省指向ISP设备,以保证公网IP之间的连通性
[r1]ip route-static 0.0.0.0 0 15.0.0.2
[r2]ip route-static 0.0.0.0 0 25.0.0.2
[r3]ip route-static 0.0.0.0 0 35.0.0.2
[R4]ip route-static 0.0.0.0 0 45.0.0.2
(2).创建隧道接口,隧道接口配置ip地址
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.5.1 24
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ip address 192.168.5.2 24
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 192.168.5.3 24
(3).定义隧道封装协议
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
(4).定义封装原ip
[r1-Tunnel0/0/0]source 15.0.0.1
[r2-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]source Serial 4/0/0
(5).创建nhrp域
[r1-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp network-id 100
(6).告诉分支中心是谁,以及怎么把汇报信息发给中心
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
(7).查看R1的nhrp表
5.R1,R4间为点到点的GRE
对R4进行配置:
[R4]interface Tunnel 0/0/1
[R4-Tunnel0/0/1]ip address 192.168.6.2 24
[R4-Tunnel0/0/1]tunnel-protocol gre
[R4-Tunnel0/0/1]source 45.0.0.1
[R4-Tunnel0/0/1]destination 15.0.0.1
对R1进行配置:
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 192.168.6.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.0.0.1
[r1-Tunnel0/0/1]destination 45.0.0.1
6.整个私有网络基于rip全网可达
(1).对R1、R2、R3、R4配置rip协议:
[r1]rip
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.5.0(主类宣告)
[r1-rip-1]network 192.168.6.0(主类宣告)
[r2]rip
[r2-rip-1]version 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.5.0
[r3]rip
[r3-rip-1]version 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.5.0
[R4]rip
[R4-rip-1]version 2
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 192.168.6.0
(2).在R1开启伪广播,并进行水平分割(R1为中心站点)
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]undo rip split-horizon
7.测试pc端是否可达
用pc1 ping pc3
用pc2 ping pc1
用pc4 ping pc1
用pc1 ping pc4