1.给各个路由接口配置IP地址
[r1]int s4/0/0
[r1-Serial4/0/0]ip add 12.1.1.1 24
[r1-Serial4/0/0]q
[r1]int lo0
[r1-LoopBack0]ip add 1.1.1.1 24
[r2]int s4/0/1
[r2-Serial4/0/1]ip add 12.1.1.2 24
[r2-Serial4/0/1]int s4/0/0
[r2-Serial4/0/0]ip add 23.1.1.1 24
[r2-Serial4/0/0]int lo0
[r2-LoopBack0]ip add 2.2.2.2 24
[r3]int s4/0/1
[r3-Serial4/0/1]ip add 23.1.1.2 24
[r3-Serial4/0/1]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 34.1.1.1 24
[r3-GigabitEthernet0/0/0]int lo0
[r3-LoopBack0]ip add 3.3.3.3 24
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 34.1.1.2 24
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 45.1.1.1 24
[r4-GigabitEthernet0/0/1]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 46.1.1.1 24
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.1.1.2 24
[r5-GigabitEthernet0/0/0]int lo0
[r5-LoopBack0]ip add 5.5.5.5 24
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 46.1.1.2 24
[r6-GigabitEthernet0/0/0]int lo0
[r6-LoopBack0]ip add 6.6.6.6 24
2.R1-R2之间ppp的pap单向认证
主认证方
[r1]aaa
[r1-aaa]local-user hcip password cipher huawei
Info: Add a new user.
[r1-aaa]local-user hcip service-type ppp
[r1-aaa]q
[r1]int s4/0/0
[r1-Serial4/0/0]ppp authentication-mode pap
被认证方
[r2]int s4/0/0
[r2-Serial4/0/0]link-protocol ppp
[r2-Serial4/0/0]ppp pap local-user hcip password cipher huawei
3.R2-R3之间ppp的chap双向认证
[r2]aaa
[r2-aaa]local-user hcip password cipher huawei
Info: Add a new user.
[r2-aaa]local-user hcip service-type ppp
[r2-Serial4/0/0]link-protocol ppp
[r2-Serial4/0/0]ppp authentication-mode chap
[r3]int s4/0/1
[r3-Serial4/0/1]link-protocol ppp
[r3-Serial4/0/1]ppp chap user hcip
[r3-Serial4/0/1]ppp chap password cipher huawei
[r3]aaa
[r3-aaa]local-user hcie password cipher huawei
Info: Add a new user.
[r3-aaa]local-user hcie service-type ppp
[r3-aaa]int s4/0/1
[r3-Serial4/0/1]link-protocol ppp
[r3-Serial4/0/1]ppp authentication-mode chap
[r2-Serial4/0/0]link-protocol ppp
[r2-Serial4/0/0]ppp chap user hcie
[r2-Serial4/0/0]ppp chap password cipher huawei
4.r3-r5-r6之间使用MGRE,r3为hub端,r5 r6为spoke端;MGRE接口网络类型为BMA,spoke之间通信必须经过hub端
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 10.1.1.1 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 34.1.1.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r5]int t0/0/0
[r5-Tunnel0/0/0]ip add 10.1.1.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 45.1.1.2
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 10.1.1.1 34.1.1.1 register
[r6]int t0/0/0
[r6-Tunnel0/0/0]ip add 10.1.1.3 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source 46.1.1.2
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 10.1.1.1 34.1.1.1 register
5.启用ospf,修改r3 r5 r6接口类型为BMA
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 12.1.1.1 0.0.0.0
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 12.1.1.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 23.1.1.2 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r3-Tunnel0/0/0]ospf network-type broadcast
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 10.1.1.2 0.0.0.0
[r5-Tunnel0/0/0]ospf dr-priority 0
[r5-Tunnel0/0/0]ospf network-type broadcast
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 6.6.6.6 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 10.1.1.3 0.0.0.0
[r6-Tunnel0/0/0]ospf dr-priority 0
[r6-Tunnel0/0/0]ospf network-type broadcast