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获取路由,所以互相访问,并且可访问R2的环回
IP 配置
R1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]int s 4/0/0
[r1-Serial4/0/0]ip address 12.1.1.1 24
R2
[r2]int s 4/0/0
[r2-Serial4/0/0]ip address 12.1.1.2 24
[r2]int s 4/0/1
[r2-Serial4/0/1]ip address 23.1.1.2 24
[r2]int s 3/0/0
[r2-Serial3/0/0]ip address 34.1.1.2 24
[r2]int l 0
[r2-LoopBack0]ip address 5.5.5.5 24
R3
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[r3]int s 4/0/0
[r3-Serial4/0/0]ip address 23.1.1.1 24
R4
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[r4]int s 4/0/0
[r4-Serial4/0/0]ip address 24.1.1.1 24
缺省
[r1]ip route-static 0.0.0.0 0 12.1.1.2
[r3]ip route-static 0.0.0.0 0 23.1.1.2
[r4]ip route-static 0.0.0.0 0 24.1.1.2
NAT
R1R3R4相同
[r1]acl 2000
[r1-acl-basic-2000]rule 1 permit source any
[r1]int s 4/0/0
[r1-Serial4/0/0]nat outbound 2000
R2-R3之间为ppp封装,pap认证,R2为主认证方
r2]aaa
[r2-aaa]local-user huawei password cipher huawei
Info: Add a new user.
[r2-aaa]local-user huawei service-type ppp
[r2-aaa]int s 4/0/1
[r2-Serial4/0/1]ppp authentication-mode pap
[r2]int s 3/0/0
[r2-Serial3/0/0]ppp authentication-mode chap
[r3]int s 4/0/0
[r3-Serial4/0/0]ppp pap local-user huawei password cipher huawei
R2-R4之间为PPP封装,chap认证,R2为主认证方
r2]aaa
[r2-aaa]local-user huawei password cipher huawei
Info: Add a new user.
[r2-aaa]local-user huawei service-type ppp
[r2]int s 3/0/0
[r2-Serial3/0/0]ppp authentication-mode chap
[r4]int s 4/0/0
[r4-Serial4/0/0]ppp chap user huawei
[r4-Serial4/0/0]ppp chap password cipher huawei
HDLC封装
[r1]int s 4/0/0
[r1-Serial4/0/0]link-protocol hdlc
[r2]int s 4/0/0
[r2-Serial4/0/0]link-protocol hdlc
R1、R2、R3构建MGRE环境,仅R1 IP地址固定
中心
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 12.1.1.1
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]undo rip split-horizon
分支
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]s s4/0/0
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[r3-Tunnel0/0/0]nhrp network-id 100
r4]int t 0/0/0
[r4-Tunnel0/0/0]ip address 10.1.1.4 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]s s4/0/0
[r4-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[r4-Tunnel0/0/0]nhrp network-id 100
RIP全网通
[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]int t 0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r3]rip
[r3-rip-1]version 2
[r3-rip-1]network 192.168.2.0
[r3-rip-1]network 10.0.0.0
[r4]rip
[r4-rip-1]version 2
[r4-rip-1]network 192.168.3.0
[r4-rip-1]network 10.0.0.0
ping