例图:
要求:
1.如图连接,合理规划IP地址,所有路由器各自创建一个loopback接口
2.R1再创建三个接口IP地址为201.1.1.1/24、201.1.2.1/24、201.1.3.1/24
R5再创建三个接口IP地址为202.1.1.1/24、202.1.2.1/24、202.1.3.1/24
R7再创建三个接口IP地址为203.1.1.1/24、203.1.2.1/24、203.1.3.1/24
3.如图运行路由协议
R1 -R2 -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,
部署OSPF网络,MGRE修改为BMA网络类型
R1 - R2之间启用ppp pap单向认证,R3-R4之间启用ppp的chap双向认证
4.area 1 区域不得出现4.5类LSA
5.其他区域优先通过R3访问R1 三个环回接口
6.尽量减少路由条目数量
7.area 1 区域增加安全性
8.全网可达
实验过程:
1、配置IP地址及创建的环回接口
R1
[Huawei]sysname R1
[R1]int l 0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]int l 1
[R1-LoopBack1]ip add 201.1.1.1 24
[R1-LoopBack1]int l 2
[R1-LoopBack2]ip add 201.1.2.1 24
[R1-LoopBack2]int l 3
[R1-LoopBack3]ip add 201.1.3.1 24
[R1-LoopBack3]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 18.1.1.1 24
R2
[Huawei]sysname R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 82.1.1.2 24
[R2-GigabitEthernet0/0/0]int s 4/0/0
[R2-Serial4/0/0]ip add 24.1.1.1 24
[R2-Serial4/0/0]int l 0
[R2-LoopBack0]ip add 2.2.2.2 24
R3
[Huawei]sysname R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 83.1.1.2 24
[R3-GigabitEthernet0/0/0]int s 4/0/0
[R3-Serial4/0/0]ip add 34.1.1.1 24
[R3-Serial4/0/0]int l 0
[R3-LoopBack0]ip add 3.3.3.3 24
R4
[r4]sysname R4
[R4]int s 4/0/0
[R4-Serial4/0/0]ip add 24.1.1.2 24
[R4-Serial4/0/0]int s 4/0/1
[R4-Serial4/0/1]ip add 34.1.1.2 24
[R4-Serial4/0/1]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.1.1.1 24
[R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 46.1.1.1 24
[R4-GigabitEthernet0/0/1]int l 0
[R4-LoopBack0]ip add 4.4.4.4 24
R5
[Huawei]sysname R5
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 45.1.1.2 24
[R5-GigabitEthernet0/0/0]int l 0
[R5-LoopBack0]ip add 5.5.5.5 24
[R5-LoopBack0]int l 1
[R5-LoopBack1]ip add 202.1.1.1 24
[R5-LoopBack1]int l 2
[R5-LoopBack2]ip add 202.1.2.1 24
[R5-LoopBack2]int l 3
[R5-LoopBack3]ip add 202.1.3.1 24
R6
[Huawei]sysname R6
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 46.1.1.2 24
[R6-GigabitEthernet0/0/0]int g 0/0/1
[R6-GigabitEthernet0/0/1]ip add 67.1.1.1 24
[R6-GigabitEthernet0/0/1]int l 0
[R6-LoopBack0]ip add 6.6.6.6 24
R7
[Huawei]sysname R7
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]ip add 67.1.1.2 24
[R7-GigabitEthernet0/0/0]int l 0
[R7-LoopBack0]ip add 7.7.7.7 24
[R7-LoopBack0]int l 1
[R7-LoopBack1]ip add 203.1.1.1 24
[R7-LoopBack1]int l 2
[R7-LoopBack2]ip add 203.1.2.1 24
[R7-LoopBack2]int l 3
[R7-LoopBack3]ip add 203.1.3.1 24
R8
[Huawei]sysname R8
[R8]int g 0/0/0
[R8-GigabitEthernet0/0/0]ip add 18.1.1.2 24
[R8-GigabitEthernet0/0/0]int g 0/0/1
[R8-GigabitEthernet0/0/1]ip add 82.1.1.1 24
[R8-GigabitEthernet0/0/1]int g 0/0/2
[R8-GigabitEthernet0/0/2]ip add 83.1.1.1 24
[R8-GigabitEthernet0/0/2]int l 0
[R8-LoopBack0]ip add 8.8.8.8 24
2.1 运行路由协议,R1-R2 -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端,部署OSPF网络,MGRE修改为BMA网络类型。
在R1,R2,R3上写缺省,使三者互通
[R1]ip route-static 0.0.0.0 0 18.1.1.2
[R2]ip route-static 0.0.0.0 0 82.1.1.1
[R3]ip route-static 0.0.0.0 0 83.1.1.1
配置MGRE网络, 创建隧道
R1
[R1]int t0/0/0
[R1-Tunnel0/0/0]ip add 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 18.1.1.1
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]nhrp network-id 100
[R1-Tunnel0/0/0]ospf network-type broadcast
[R1-Tunnel0/0/0]ospf dr-priority 10
R2
[R2]int t0/0/0
[R2-Tunnel0/0/0]ip add 10.1.1.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source 82.1.1.2
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.1.1 18.1.1.1 register
[R2-Tunnel0/0/0]ospf network-type broadcast
[R2-Tunnel0/0/0]ospf dr-priority 0
R3
[R3]int t0/0/0
[R3-Tunnel0/0/0]ip add 10.1.1.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 83.1.1.2
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 10.1.1.1 18.1.1.1 register
[R3-Tunnel0/0/0]ospf network-type broadcast
[R3-Tunnel0/0/0]ospf dr-priority 0
部署OSPF网络:
[R1]ospf 100 rou 1.1.1.1
[R1-ospf-100]are 0
[R1-ospf-100-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]network 201.1.1.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]network 201.1.2.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]network 201.1.3.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[R2]ospf 100 rou 2.2.2.2
[R2-ospf-100]are 0
[R2-ospf-100-area-0.0.0.0]network 10.1.1.2 0.0.0.0
[R2-ospf-100]are 1
[R2-ospf-100-area-0.0.0.1]network 24.1.1.1 0.0.0.0
[R2-ospf-100-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[R3]ospf 100 rou 3.3.3.3
[R3-ospf-100]are 0
[R3-ospf-100-area-0.0.0.0]network 10.1.1.3 0.0.0.0
[R3-ospf-100]are 1
[R3-ospf-100-area-0.0.0.1]netwrrk 34.1.1.1 0.0.0.0
[R3-ospf-100-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[R4]ospf 100 rou 4.4.4.4
[R4-ospf-100]area 1
[R4-ospf-100-area-0.0.0.1]network 24.1.1.2 0.0.0.0
[R4-ospf-100-area-0.0.0.1]network 34.1.1.2 0.0.0.0
[R4-ospf-100-area-0.0.0.1]network 4.4.4.4 0.0.0.0
[R4-ospf-100-area-0.0.0.1]area 2
[R4-ospf-100-area-0.0.0.2]network 46.1.1.1 0.0.0.0
[R6]ospf 100 rou 6.6.6.6
[R6-ospf-100]are 2
[R6-ospf-100-area-0.0.0.2]net 6.6.6.6 0.0.0.0
[R6-ospf-100-area-0.0.0.2]net 46.1.1.2 0.0.0.0
配置RIP
[R4]rip 200
[R4-rip-200]version 2
[R4-rip-200]network 45.0.0.0
[R5]rip 200
[R5-rip-200]version 2
[R5-rip-200]network 202.1.1.0
[R5-rip-200]network 202.1.2.0
[R5-rip-200]network 202.1.3.0
[R5-rip-200]network 45.0.0.0
[R5-rip-200]network 5.0.0.0
[R6]rip 100
[R6-rip-100]version 2
[R6-rip-100]network 67.0.0.0
[R7]rip 100
[R7-rip-100]version 2
[R7-rip-100]network 203.1.1.0
[R7-rip-100]network 203.1.2.0
[R7-rip-100]network 203.1.3.0
[R7-rip-100]network 67.0.0.0
[R7-rip-100]network 7.0.0.0
2.2R1 - R2之间启用ppp pap单向认证,R3-R4之间启用ppp的chap双向认证
pap单向认证
[R2]aaa
[R2-aaa]local-user abc password cipher 123
[R2-aaa]local-user abc service-type ppp
[R2-aaa]int s4/0/0
[R2-Serial4/0/0]ppp authentication-mode pap
[r4]int s4/0/0
[r4-Serial4/0/0]ppp pap local-user abc password cipher 123
验证:
chap双向认证
[R3]aaa
[R3-aaa]local-user cba password cipher 123
Info: Add a new user.
[R3-aaa]local-user cba service-type ppp
[R3-aaa]int s4/0/0
[R3-Serial4/0/0]ppp authentication-mode chap
[R3-Serial4/0/0]ppp chap user bac
[R3-Serial4/0/0]ppp chap password cipher 321
[R4]int s4/0/1
[R4-Serial4/0/1]ppp chap user cba
[R4-Serial4/0/1]ppp chap password cipher 123
[R4]aaa
[R4-aaa]local-user bac password cipher 321
Info: Add a new user.
[R4-aaa]local-user bac service-type ppp
[R4-aaa]q
[R4]int s4/0/1
[R4-Serial4/0/1]ppp authentication-mode chap
验证:
4、area 1区域不得出现4.5类LSA
[R2-ospf-100-area-0.0.0.1]nssa
[R3-ospf-100-area-0.0.0.1]nssa
[R4-ospf-100-area-0.0.0.1]nssa
3、其他区域优先通过R3访问R1三个环回接口。在区域边界路由器做汇总时修改开销值,使得通过r2路由器的开销值大于通过r3的。
[R2-ospf-100-area-0.0.0.0] abr-summary 1.1.1.0 255.255.252.0 cost 10
[R2-ospf-100-area-0.0.0.0] abr-summary 201.1.0.0 255.255.252.0 cost 10
[R3-ospf-100-area-0.0.0.0] abr-summary 201.1.0.0 255.255.252.0 cost 5
采用Tunnel解决不规则区域
【R2】
[R2]int t 0/0/1
[R2-Tunnel0/0/1]ip address 100.1.1.1 24
[R2-Tunnel0/0/1]tunnel-protocol gre
[R2-Tunnel0/0/1]source 2.2.2.2
[R2-Tunnel0/0/1]description 4.4.4.4
[R2-Tunnel0/0/1]ospf enable 100 area 0
【R3】
[R3]int t0/0/1
[R3-Tunnel0/0/2]ip address 200.1.1.1 24
[R3-Tunnel0/0/2]tunnel-protocol gre
[R3-Tunnel0/0/2]source 3.3.3.3
[R3-Tunnel0/0/2]description 4.4.4.4
[R3-Tunnel0/0/2]ospf enable 100 area 0
【R4】
[R4]int t 0/0/0
[R4-Tunnel0/0/1]ip address 100.1.1.2 24
[R4-Tunnel0/0/1]tunnel-protocol gre
[R4-Tunnel0/0/1]source 4.4.4.4
[R4-Tunnel0/0/1]description 2.2.2.2
[R4-Tunnel0/0/1]ospf enable 100 area 0
[R4]int t0/0/1
[R4-Tunnel0/0/2]ip add 200.1.1.2 24
[R4-Tunnel0/0/2]tunnel-protocol gre
[R4-Tunnel0/0/2]source 4.4.4.4
[R4-Tunnel0/0/2]description 3.3.3.3
[R4-Tunnel0/0/2]ospf enable 100 area 0
重发布
[R4]ospf 100
[R4-ospf-100]import-route rip 200
[R4-ospf-100]asbr-summary 202.1.0.0 255.255.252.0
[R6]ospf 100
[R6-ospf-100]import-route rip 100
[R6-ospf-100]asbr-summary 203.1.0.0 255.255.252.0