一、实验拓扑图
二、配置
1.
R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址
R1侧为15.1.1.1,对应R5为15.1.1.2
R2侧为25.1.1.2,对应R5为25.1.1.1
R3侧为35.1.1.2,对应R5为35.1.1.1
R4侧为45.1.1.2,对应R5为45.1.1.1
另一端:
R1 侧为 192.168.1.1,PC1 为 192.168.1.2
R2 侧为 192.168.2.1,PC3 为 192.168.2.2
R3 侧为 192.168.3.1,PC4 为 192.168.3.2
R4 侧为 192.168.4.1,PC2 为 192.168.4.2
2.
R1和R5间使用PPP的PAP认证,R5为主认证方;
R2与R5之间使用ppp的CHAP认证,R5为主认证方;
R3与R5之间使用HDLC封装;
R1-R5
[R5]aaa[R5-aaa]local-user aaa password cipher aaa123[R5-aaa]local-user aaa service-type ppp[R5]int Serial 2/0/0 [R5-Serial2/0/0]ppp authentication-mode pap
[R1]interface Serial 2/0/0[R1-Serial2/0/0]ppp pap local-user aaa password cipher aaa123[R1-Serial2/0/0]ppp authentication-mode pap[R1-Serial2/0/0]undo shutdown
R2-R5
[R5]aaa[R5-aaa]local-user bbb password cipher bbb123[R5-aaa]local-user bbb service-type ppp[R5]int Serial 2/0/1 [R5-Serial2/0/1]ppp authentication-mode chap
[R2]interface Serial 2/0/1[R2-Serial2/0/1]ppp pap local-user bbb password cipher bbb123[R2-Serial2/0/1]ppp authentication-mode chap[R2-Serial2/0/1]undo shutdown
R3-R5
[R5]aaa[R5-aaa]local-user ccc password cipher ccc123[R5-aaa]local-user ccc service-type ppp[R5]int Serial 1/0/0 [R5-Serial1/0/0]ppp authentication-mode chap[R5-Serial1/0/0]link-protocol hdlc
[R3]interface Serial 1/0/0[R3-Serial1/0/0]ppp pap local-user ccc password cipher ccc123[R3-Serial1/0/0]ppp authentication-mode chap[R3-Serial1/0/0]undo shutdown
3.
R1、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE
[R1]int Tunnel 0/0/1[R1-Tunnel0/0/1]ip add 192.168.6.1 24[R1-Tunnel0/0/1]tunnel-protocol gre p2mp[R1-Tunnel0/0/1]source 15.1.1.1[R1-Tunnel0/0/1]nhrp network-id 100
[R2]int Tunnel 0/0/1[R2-Tunnel0/0/1]ip add 192.168.6.2 24[R2-Tunnel0/0/1]tunnel-protocol gre p2mp[R2-Tunnel0/0/1]source 25.1.1.2[R2-Tunnel0/0/1]q[R2]int Tunnel 0/0/1[R2-Tunnel0/0/1]nhrp network-id 100[R2-Tunnel0/0/1]nhrp entry 192.168.6.1 15.1.1.1 register
[R3]int Tunnel 0/0/1[R3-Tunnel0/0/1]ip add 192.168.6.3 24[R3-Tunnel0/0/1]tunnel-protocol gre p2mp[R3-Tunnel0/0/1]source 35.1.1.2[R3-Tunnel0/0/1]q[R3]int Tunnel 0/0/1[R3-Tunnel0/0/1]nhrp network-id 100[R3-Tunnel0/0/1]nhrp entry 192.168.6.1 15.1.1.1 register
4.
整个私有网络基本RIP全网可达
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.1
R3:ip route-static 0.0.0.0 0 35.1.1.1
R4:ip route-static 0.0.0.0 0 45.1.1.1
(互相ping通即可)