1配置ip
设路由与pc有192.168.0.0/24网段
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.2 24
[r1-GigabitEthernet0/0/0]int s 4/0/0
[r1-Serial4/0/0]ip add 10.0.0.1 24
[r1-Serial4/0/0]q
[r1]ip route-static 0.0.0.0 0 10.0.0.2
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.2 24
[r2-GigabitEthernet0/0/0]int s 4/0/0
[r2-Serial4/0/0]ip add 15.0.0.1 24
[r2-Serial4/0/0]q
[r2]ip route-static 0.0.0.0 0 15.0.0.2
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.3.2 24
[r3-GigabitEthernet0/0/0]int s 4/0/0
[r3-Serial4/0/0]ip add 20.0.0.2 24
[r3-Serial4/0/0]q
[r3]ip route-static 0.0.0.0 0 20.0.0.1
[r4]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.4.2 24
[r4-GigabitEthernet0/0/1]ip add 25.0.0.2 24
[r4-GigabitEthernet0/0/1]q
[r4]ip route-static 0.0.0.0 0 25.0.0.1
[ISP]int s 3/0/0
[ISP-Serial3/0/0]ip add 10.0.0.2 24
[ISP-Serial3/0/0]int s 3/0/1
[ISP-Serial3/0/1]ip add 15.0.0.2 24
[ISP-Serial3/0/1]int s 4/0/0
[ISP-Serial4/0/0]ip add 20.0.0.1 24
[ISP-Serial4/0/0]int g 0/0/0
[ISP-GigabitEthernet0/0/0]ip add 25.0.0.1 24
[ISP-GigabitEthernet0/0/0]q
[ISP]int l 1
[ISP-LoopBack1]ip add 5.5.5.1 24
2.r1,r5之间认证PAP,r2,r5之间认证chap;r3和r5之间使用HDLC封装
[ISP]aaa
[ISP-aaa]local-user admin password cipher 8888
[ISP-aaa]local-user admin service-type ppp
[ISP-aaa]int s 3/0/0
[ISP-Serial3/0/0]ppp authentication-mode pap
[ISP-Serial3/0/0]ppp pap local-user admin password cipher 8888
[ISP]aaa
[ISP-aaa]local-user admin password cipher 8888
[ISP-aaa]local-user admin service-type ppp
[ISP-aaa]int s 3/0/1
[ISP-Serial3/0/1]ppp authentication-mode chap
[ISP-Serial3/0/1]int s 4/0/0
[ISP-Serial4/0/0]ppp chap user admin
[ISP-Serial4/0/0]ppp chap password cipher 8888
[ISP-Serial4/0/0]link-protocol hdlc
[r3-Serial4/0/0]link-protocol hdlc
3.配置MGRE
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.5.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 10.0.0.1
[r1-Tunnel0/0/0]nhrp network-id 10
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ip add 192.168.5.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source 15.0.0.1
[r2-Tunnel0/0/0]nhrp network-id 10
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 10.0.0.1 register
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 192.168.5.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 20.0.0.2
[r3-Tunnel0/0/0]nhrp network-id 10
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 10.0.0.1 register
4.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
[r1-Tunnel0/0/1]source 10.0.0.1
[r1-Tunnel0/0/1]destination 25.0.0.2
[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]ip add 192.168.6.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 25.0.0.2
[r4-Tunnel0/0/1]destination 10.0.0.1
5.基于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
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]undo rip split-horizon
[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.2.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