1.合理规划ip地址,启用ospf单区域
2.R1——R2之间启用PPP的pap单向认证
3.R2——R3之间启用ppp的chap双向认证
4.R3——R5——R6之间使用MGRE,R3为hub端,R5 R6为spoke端;
要求MGRE接口网络类型为BMA,spoke之间通信必须为hub端
5.全网可达
R1:
undo t m
system-view
sysname R1
user-interface console 0
idle-timeout 00
int Serial 4/0/0
ip address 12.1.1.1 24
ppp authentication-mode pap
aaa
local-user huawei password cipher 123
local-user huawei service-type ppp
ospf 100 router-id 91.1.1.1
area 0
network 12.1.1.1 0.0.0.0
R2:
undo t m
sys
sys R2
user-interface c0
idle-timeout 00
int ser4/0/1
ip add 12.1.1.2 24
ppp pap local-user huawei password cipher 123
int ser4/0/0
ip add 23.1.1.1 24
ppp authentication-mode chap
ppp chap user R2
ppp chap password cipher 123456
aaa
local-user R3 password cipher 123456
local-user R3 service-type ppp
ospf 100 router-id 92.1.1.1
area 0
network 12.1.1.2 0.0.0.0
network 23.1.1.1 0.0.0.0
R3:
undo t m
sys
sys R3
user-interface c0
idle-timeout 00
ip route-static 0.0.0.0 0 34.1.1.2/*缺省*/
int ser4/0/1
ip add 23.1.1.2 24
ppp chap user R3
ppp chap password cipher 123456
ppp authentication-mode chap
int g0/0/0
ip add 34.1.1.1 24
aaa
local-user R2 password cipher 123456
local-user R2 service-type pp
int Tunnel 0/0/3
ip add 10.1.1.1 24
tunnel-protocol gre p2mp
source 34.1.1.1
ospf network-type broadcast
ospf dr-priority 255
nhrp entry multicast dynamic
nhrp network-id 100
ospf 100 router-id 93.1.1.1
area 0
network 23.1.1.2 0.0.0.0
network 10.1.1.1 0.0.0.0
R4:
undo t m
sys
sys R4
user-interface c0
idle-timeout 00
int g0/0/0
ip add 34.1.1.2 24
int g0/0/1
ip add 45.1.1.1 24
int g0/0/2
ip add 46.1.1.1 24
R5:
undo t m
sys
sys R5
user-interface c0
idle-timeout 00
ip route-static 0.0.0.0 0 45.1.1.1/*缺省*/
int g0/0/1
ip add 45.1.1.2 24
int Tunnel 0/0/5
ip add 10.1.1.2 24
tunnel-protocol gre p2mp
source 45.1.1.2
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 10.1.1.1 34.1.1.1 register
ospf 100 router-id 95.1.1.1
area 0
network 10.1.1.2 0.0.0.0
R6:
undo t m
sys
sys R6
user-interface c0
idle-timeout 00
ip route-static 0.0.0.0 0 46.1.1.1/*缺省*/
int g0/0/2
ip add 46.1.1.2 24
int tu0/0/6
ip add 10.1.1.3 24
tunnel-protocol gre p2mp
source 46.1.1.2
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 10.1.1.1 34.1.1.1 register
ospf 100 router-id 96.1.1.1
area 0
network 10.1.1.3 0.0.0.0
在tun0/0/1 关闭水平分割
hub端 rip关闭水平分割:undo rip split-horizon
问题:R1无法ping10.1.2 等
解决:source要用实际地址不是tunnel地址
问题:nhrp建立不了邻居
解决:要写指向ISP的缺省路由,很重要
如果用ospf通告,则要把在tunnel接口的mgre原类型p2p改为p2mp
华为无法改为nbma,若改为bma则要控制dr位置和映射
(mgre不是典型的hub-spoke,所以不要映射)
(要开启伪广播,p2mp不需要)
int tun0/0/1
ospf dr-priority 255/修改dr优先级
结果: