r1:
//配接口IP
[r1-Serial4/0/0]ip add 12.1.1.1 24
//ppp使用pap认证
[r1]aaa
[r1-aaa]local-user qq password cipher 123
Info: Add a new user.
[r1-aaa]local-user qq service-type ppp
[r1-aaa]int s4/0/0
[r1-Serial4/0/0]ppp authentication-mode pap
//起ospf
[r1]ospf 1 router-id 91.1.1.1
Info: The configuration succeeded. You need to restart the OSPF process to valid
ate the new router ID.
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 12.1.1.1 0.0.0.0
r2:
//配IP
[r2]int s 4/0/0
[r2-Serial4/0/0]ip add 12.1.1.2 24
[r2-Serial4/0/0]int s4/0/1
[r2-Serial4/0/1]ip add 23.1.1.1 24
//与r1接口启动pap认证
[r2]int s4/0/0
[r2-Serial4/0/0]ppp pap local-user qq password cipher 123
//接口启动chap认证
[r2]aaa
[r2-aaa]local-user ww password cipher 123
Info: Add a new user.
[r2-aaa]local-user ww service-type ppp
[r2-aaa]int s4/0/1
[r2-Serial4/0/1]ppp authentication-mode chap
//启动ospf
[r2]ospf 1 router-id 92.1.1.1
[r2-ospf-1]area 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:
//配IP
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 34.1.1.1 24
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 23.1.1.2 24
//启动chap认证
[r3-Serial4/0/0]ppp chap password cipher 123
//配静态缺省
[r3]ip route-static 0.0.0.0 0 34.1.1.2
//起ospf
[r3]ospf 1 router-id 93.1.1.1
[r3-ospf-1]area 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 34.1.1.1 0.0.0.0
//创建tunnel 接口构建MGRE
[r3]int tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.1 24
.......
[r3-Tunnel0/0/0]dis this
[V200R003C00]
#
interface Tunnel0/0/0
ip address 10.1.1.1 255.255.255.0
tunnel-protocol gre p2mp
source 34.1.1.1
ospf network-type broadcast //修改网络接口为BMA
nhrp entry multicast dynamic
nhrp network-id 100
#
return
r4:
//配IP
[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]
[r4-GigabitEthernet0/0/1]int g0/0/02
[r4-GigabitEthernet0/0/2]ip add 46.1.1.1 24
//起ospf
[r4]ospf 1 router-id 94.1.1.1
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 34.1.1.2 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 45.1.1.1 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 46.1.1.1 0.0.0.0
r5:
//配IP
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.1.1.2 24
//配缺省
[r5]ip route-static 0.0.0.0 0 45.1.1.1
//起ospf
[r5]ospf 1 router-id 95.1.1.1
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 45.1.1.2 0.0.0.0
//创建tunnel 接口构建MGRE
[r5]int tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 10.1.1.2 24
[r5-Tunnel0/0/0]dis this
[V200R003C00]
#
interface Tunnel0/0/0
ip address 10.1.1.2 255.255.255.0
tunnel-protocol gre p2mp
source 45.1.1.2
ospf network-type broadcast //修改网络类型为BMA
ospf dr-priority 0 //放弃DR选举
nhrp network-id 100
nhrp entry 10.1.1.1 34.1.1.1 register
#
return
r6:
//配IP
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 46.1.1.2 24
//配缺省
[r6]ip route-static 0.0.0.0 0 46.1.1.1
//起ospf
[r6]ospf 1 router-id 96.1.1.1
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 46.1.1.2 0.0.0.0
//创建tunnel 接口构建MGRE
[r6]int tunnel 0/0/0
[r6-Tunnel0/0/0]ip address 10.1.1.3 24
[r6-Tunnel0/0/0]dis this
[V200R003C00]
#
interface Tunnel0/0/0
ip address 10.1.1.3 255.255.255.0
tunnel-protocol gre p2mp
source 46.1.1.2
ospf network-type broadcast //修改网络类型为BMA
ospf dr-priority 0 //放弃DR选举
nhrp network-id 100
nhrp entry 10.1.1.1 34.1.1.1 register
#
return
结果:
r3:
r5
r6