一、实验要求
1.R2为ISP,其上只能配置IP地址
2.R1-R2之间为HDLC封装
3.R2-R3之间为PPP封装,pap认证,R2为主认证方
4.R2-R4之间为PPP封装,chap认证,R2为主认证方
5.R1、R2、R3构建MGRE环境,仅R1 IP 地址固定
6.内网使用RIP获取路由,所有PC可以相互访问,并且可访问R2的环回
二、实验过程
r1
[r1]int GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]ip address 2.2.2.1 24
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]link-protocol hdlc
[r1]ip route-static 0.0.0.0 0 2.2.2.2
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 255.255.255.0
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 2.2.2.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon
r2
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]ip address 2.2.2.2 24
[r2-Serial4/0/0]int s4/0/1
[r2-Serial4/0/1]ip address 2.2.3.2 24
[r2-Serial4/0/1]int s3/0/0
[r2-Serial3/0/0]ip address 2.2.1.2 24
[r2]int LoopBack 0
[r2-LoopBack0]ip address 12.1.1.1 24
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]link-protocol hdlc
[r2]aaa
[r2-aaa]local-user haha service-type ppp
[r2]interface Serial 4/0/1
[r2-Serial4/0/1]ppp authentication-mode pap
[r2]aaa
[r2-aaa]local-user xixi privilege level 15 password cipher 123456
[r2-aaa]local-user xixi service-type ppp
[r2]int Serial 3/0/0
[r2-Serial3/0/0]ppp authentication-mode chap
r3
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ip address 2.2.3.1 24
[r3]int GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ppp authentication-mode pap
[r3]ip route-static 0.0.0.0 0 2.2.3.2
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r3-acl-basic-2000]q
[r3]int Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.2 255.255.255.0
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 2.2.2.1 register
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 192.168.2.0
[r3-rip-1]network 10.0.0.0
r4
[r4]interface Serial 4/0/0
[r4-Serial4/0/0]ip address 2.2.1.1 24
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip ad
[r4-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[r4]interface Serial 4/0/0
[r4-Serial4/0/0]ppp chap password cipher 123456
[r4-Serial4/0/0]ppp chap user xixi
[r4]ip route-static 0.0.0.0 0 2.2.1.2
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r4]int Serial 4/0/0
[r4-Serial4/0/0]nat outbound 2000
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 10.1.1.3 255.255.255.0
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source Serial 4/0/0
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry 10.1.1.1 2.2.2.1 register
[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]network 192.168.3.0
[r4-rip-1]network 10.0.0.0
三.ping
pc1 ping pc2
pc3 ping pc2