如上图所示先配置IP(配IP比较简单就不写了)
给除R5外的所有路由器配缺省路由
[R1]IP route-static 0.0.0.0 0 15.1.1.1
[R2]IP route-static 0.0.0.0 0 15.1.2.1
[R3]IP route-static 0.0.0.0 0 15.1.3.1
[R4]IP route-static 0.0.0.0 0 15.1.4.1
R1和R5间使用ppp的pap认证,R5为主认证方
R5
[r5]aaa
[r5-aaa]local-user wangdaye password cipher wdy12345 privilege level 15
[r5-aaa]local-user wangdaye service-type ppp
[r5-aaa]q
[r5]int s4/0/1
[r5-Serial4/0/1]ppp authentication-mode pap
R1
[r1-Serial4/0/0]ppp pap local-user wangdaye password cipher wdy12345
在R1上的[r1-Serial4/0/0]接口上使用shutdown和undo shutdown命令,有两个up就是已经成功了
R2与R5之间使用ppp的CHAP认证,R5为主认证方
R5
[r5]aaa
[r5-aaa]local-user admin password cipher 123456 privilege level 15
[r5-aaa]q
[r5]int s3/0/1
[r5-Serial3/0/1]ppp authentication-mode chap
R2
[r2]int s4/0/0
[r2-Serial4/0/0]ppp chap user admin
[r2-Serial4/0/0]ppp chap password cipher 123456
R3与R5之间使用HDLC封装
R5
[r5-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
R1、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE
在R1上配
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]ip add 10.1.1.1 24
[r1-Tunnel0/0/0]source 15.1.1.2
Oct 21 2023 23:36:37-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
在R2上配
[r2-Tunnel0/0/0]ip add 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]nhrp entry Serial 4/0/0
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.2 register
在R3上配置
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]ip add 10.1.1.3 24
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.2 register
R1、R4间为点到点的GRE
R1
[r1]int Tunnel 0/0/1
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]ip add 10.1.2.1 24
[r1-Tunnel0/0/1]source 15.1.1.2
[r1-Tunnel0/0/1]destination 45.1.1.2
R4
[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]ip add 10.1.2.2 24
[r4-Tunnel0/0/1]source 45.1.1.2
[r4-Tunnel0/0/1]description 15.1.1.2
使用rip使私网全网可达(因为路由器设备死机了这里就只给思路)
在1-4路由器上使用rip 1 version 2
将tunnel接口的IP和私网IP宣告
使所有pc能访问5.5.5.5
在每个路由器上做nat
R1
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 15.1.1.0 0.255.255.255
[r1-acl-basic-2000]q
[r1]int s4/0/0
[r1-Serial4/0/0]nat outbound 2000
其余路由器和R1配置一样