对各个路由器进行配置‘
R1
//对r1进行ip配置
[r1]interface g 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1-GigabitEthernet0/0/0]interface Serial 4/0/0
[r1-Serial]ip address 15.0.0.1 8
[r1-Serial]q
[r1]ip route-static 0.0.0.0 0 15.0.0.2 //对R1进行缺省路由
//对R1使用ppp的pap认证(被认证方)
[r1] interface Serial 4/0/0
[r1-Serial4/0/0]ppp pap local-user hhh password cipher 123456 //账号hhh 密码123456
//r1与r2之间的gre
[r1]interface Tunnel 0/0/1 //创建Tunnel接口
[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
//r1、r2、r3之间的mgre(r1为中心站点)
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.5.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.0.0.1
//rip
[r1]rip 1
[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
[r1-rip-1]undo summary
[r1-rip-1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
//nat
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1]interface s 4/0/0
[r1-Serial4/0/0]nat outbound 2000
R2
//对r2进行ip配置
[r2]interface g 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[r2-GigabitEthernet0/0/0]interface Serial 4/0/0
[r2-Serial4/0/0]ip address 25.0.0.1 8
[r2-Serial4/0/0]q
[r2]ip route-static 0.0.0.0 0 25.0.0.2 //对r2进行缺省路由
//对r2进行ppp的chap认证(被认证方)
[r2]interface s 4/0/0
[r2-Serial4/0/0]ppp chap user jjj password cipher 654321
//r1、r2、r3之间的MGRE(r1为中心站点)
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ip address 192.168.5.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source Serial 4/0/0
[r2-Tunnel0/0/0]
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
//rip
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.5.0
//nat
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]interface s 4/0/0
[r2-Serial4/0/0]nat outbound 2000
R3
//对r3进行IP配置
[r3]interface g 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[r3-GigabitEthernet0/0/0]interface Serial 4/0/0
[r3-Serial4/0/0]ip address 35.0.0.1 8
[r3-Serial4/0/0]q
[r3]ip route-static 0.0.0.0 0 35.0.0.2 //对r3进行缺省路由
//进行hdlc封装
[r3]interface s 4/0/0
[r3-Serial4/0/0]link-protocol hdlc
//r1、r2、r3之间的MGRE(r1为中心站点)
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 192.168.5.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 192.168.5.1 15.0.0.1 register
//rip
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.5.0
//nat
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]q
[r3]interface s 4/0/0
[r3-Serial4/0/0]nat outbound 2000
R4
//对r4进行ip配置
[r4]interface g 0/0/0
[r4-GigabitEthernet0/0/0]ip addresss 192.168.4.1 24
[r4-GigabitEthernet0/0/0]interface g 0/0/1
[r4-GigabitEthernet0/0/1]ip address 42.0.0.1 8
[r4-GigabitEthernet0/0/1]q
[r4]ip route-static 0.0.0.0 0 45.0.0.2 //对r4进行缺省路由
//r1与r4之间的gre
[R4]interface Tunnel 0/0/0 //创建Tunnel接口
[R4-Tunnel0/0/0]ip address 192.168.6.2 24
[R4-Tunnel0/0/0]tunnel-protocol gre
[R4-Tunnel0/0/0]source 45.0.0.1
[R4-Tunnel0/0/0]destination 15.0.0.1
//rip
[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 192.168.6.0
//nat
[R4]acl 2000
[R4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[R4]interface g 0/0/1
[R4-GigabitEthernet0/0/1]nat outbound 2000
ISP
//对ISP进行ip配置
[ISP]interface Serial 3/0/0
[ISP-Serial3/0/0]ip address 15.0.0.2 8
[ISP-Serial3/0/0]interface Serial 3/0/1
[ISP-Serial3/0/1]ip address 25.0.0.2 8
[ISP-Serial3/0/1]interface Serial 4/0/0
[ISP-Serial4/0/0]ip address 35.0.0.2 8
[ISP-Serial4/0/0]interface g 0/0/0
[ISP-GigabitEthernet0/0/0]ip address 45.0.0.2 8
[ISP-GigabitEthernet0/0/0]q
//创建一个环回接口
[ISP]interface LoopBack 0
[ISP]ip address 5.5.5.5 224
//对ISP进行ppp的pap认证(主认证方)
[ISP]aaa
[ISP-aaa]local-user hhh password cipher 123456
[ISP-aaa]local-user hhh service-type ppp
[ISP]interface s 3/0/0
[ISP-Serial3/0/0]ppp authentication-mode pap
//对ISP进行ppp的chap认证(主认证方)
[ISP]aaa
[ISP-aaa]local-user jjj password cipher 654321
[ISP-aaa]local-user jjj service-type ppp
[ISP]interface s 3/0/1
[ISP-Serial3/0/1]ppp authentication-mode chap
//进行hdlc封装
[ISP]interface s 4/0/0
[ISP-Serial4/0/0]link-protocol hdlc
验证