实验内容:
实验要求:
1,R4为ISP,其上只能配置IP地址; R4与其他所有直连设备间均使用公有IP
2,R3-R5/6/7为MGRE环境, R3为中心站点
3,整个OSPF环境ip基于172.16.0.0/16划分
4,所有设备均可访向R4的环回
5,减少LSA的更新量,加快收敛,保障更新安全
6,全网可达
划分网段
首先基于172.16.0.0/16进行合理的子网划分
图中共6个网段,所以至少需要将其划分为8个子网,也就是网络位需要向主机位借3位
172.16.0.0/16 | 172.16.0.0/19 A0 | 172.16.0.0/25 p2p骨干 |
172.16.0.128/25 MA骨干 | 172.16.32.0/19 A1 | 172.16.64.0/19 A2 |
172.16.96.0/19 A3 | 172.16.128.0/19 A4 | 172.16.160.0/19 RIP |
172.16.160.0/20 | 172.16.176.0/20 | 172.16.192.0/19 |
172.16.224.0/19 |
具体实验操作步骤
R1:
[r1]int loop0
[r1-LoopBack0]ip addd 10.1.1.1 32
[r1-LoopBack0]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 10.1.123.1 24
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 10.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.1]network 10.1.123.0 0.0.0.255
[r1]ospf 1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]stub
R2:
[r2]int loop0
[r2-LoopBack0]ip add 10.1.2.1 32
[r2-LoopBack0]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 10.1.123.2 24
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 10.1.2.1 0.0.0.0
[r2-ospf-1-area-0.0.0.1]network 10.1.123.0 0.0.0.255
[r2]ospf 1
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]stub
R3:
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 10.1.123.3 24
[r3-GigabitEthernet0/0/0]int loop0
[r3-LoopBack0]ip add 10.0.3.1 32
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 200.1.34.1 24
[r3]ip route-static 0.0.0.0 0 200.1.34.2
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 10.0.30.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source g0/0/1
[r3-Tunnel0/0/0]nhrp network-id 1
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]nhrp authentication cipher 123
[r3-Tunnel0/0/0]gre key 123
[r3]ospf router-id 3.3.3.3
[r3-ospf-1-area-0.0.0.0]network 10.0.30.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 10.0.3.1 0.0.0.0
[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf network-type broadcast
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]stub no-summary
[r3-ospf-1-area-0.0.0.1]abr-summary 10.1.0.0 255.255.0.0
[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp
[r3-Tunnel0/0/0]nhrp redirect
R4:
[Huawei]sysname isp
[isp]int g0/0/0
[isp-GigabitEthernet0/0/0]ip add 200.1.34.2 24
[isp-GigabitEthernet0/0/0]int g0/0/1
[isp-GigabitEthernet0/0/1]ip add 200.1.45.2 24
[isp-GigabitEthernet0/0/1]int g0/0/2
[isp-GigabitEthernet0/0/2]ip add 200.1.46.2 24
[isp-GigabitEthernet0/0/2]int e4/0/0
[isp-Ethernet4/0/0]ip add 200.1.47.2 24
[isp-Ethernet4/0/0]q
[isp]int loop0
[isp-LoopBack0]ip add 8.8.8.8 24
[isp-LoopBack0]q
R5:
[r5]int loop0
[r5-LoopBack0]ip add 10.0.5.1 32
[r5-LoopBack0]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 200.1.45.1 24
[r5]ip route-static 0.0.0.0 0 200.1.45.2
[r5]int t0/0/0
[r5-Tunnel0/0/0]ip add 10.0.30.5 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source g0/0/0
[r5-Tunnel0/0/0]gre key 123
[r5-Tunnel0/0/0]nhrp network-id 1
[r5-Tunnel0/0/0]nhrp authentication cipher 123
[r5-Tunnel0/0/0]nhrp entry 10.0.30.3 200.1.34.1 register
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 10.0.5.1 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 10.0.30.0 0.0.0.255
[r5]int tun0/0/0
[r5-Tunnel0/0/0]ospf network-type broadcast
[r5-Tunnel0/0/0]ospf dr-priority 0
[r5]int t0/0/0
[r5-Tunnel0/0/0]ospf network-type p2mp
R6:
[r6]int loop0
[r6-LoopBack0]ip add 10.0.6.1 32
[r6-LoopBack0]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 200.1.46.1 24
[r6-GigabitEthernet0/0/0]int g0/0/1
[r6-GigabitEthernet0/0/1]ip add 10.2.116.6 24
[r6]ip route-static 0.0.0.0 0 200.1.46.2
[r6]int tun 0/0/0
[r6-Tunnel0/0/0]ip add 10.0.30.6 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source g0/0/0
[r6-Tunnel0/0/0]gre key 123
[r6-Tunnel0/0/0]nhrp authentication cipher 123
[r6-Tunnel0/0/0]nhrp network-id 1
[r6-Tunnel0/0/0]nhrp entry 10.0.30.3 200.1.34.1 register
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 10.0.6.1 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 10.0.30.0 0.0.0.255
[r6]int tun 0/0/0
[r6-Tunnel0/0/0]ospf network-type broadcast
[r6-Tunnel0/0/0]ospf dr-priority 0
[r6]ospf
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]nssa no-summary
[r6]int tun0/0/0
[r6-Tunnel0/0/0]ospf network-type p2mp
R7:
[r7]int lo0
[r7-LoopBack0]ip ad 10.0.7.1 32
[r7-LoopBack0]int g0/0/0
[r7-GigabitEthernet0/0/0]ip ad 10.3.78.7 24
[r7-GigabitEthernet0/0/0]int g0/0/1
[r7-GigabitEthernet0/0/1]ip ad 200.1.47.1 24
[r7]ip route-static 0.0.0.0 0 200.1.47.2
[r7]int tun 0/0/0
[r7-Tunnel0/0/0]ip ad 10.0.30.7 24
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]gre key 123
[r7-Tunnel0/0/0]nhrp authentication cipher 123
[r7-Tunnel0/0/0]nhrp network-id 1
[r7-Tunnel0/0/0]nhrp entry 10.0.30.3 200.1.34.1 register
[r7-Tunnel0/0/0]source g0/0/1
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]a 0
[r7-ospf-1-area-0.0.0.0]n
[r7-ospf-1-area-0.0.0.0]network 10.0.7.1 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 10.0.30.0 0.0.0.255
[r7]int tun 0/0/0
[r7-Tunnel0/0/0]ospf network-type broadcast
[r7-Tunnel0/0/0]ospf dr-priority 0
[r7]ospf 1
[r7-ospf-1]a 3
[r7-ospf-1-area-0.0.0.3]network 10.3.78.0 0.0.0.255
[r7]ospf 1
[r7-ospf-1]a 3
[r7-ospf-1-area-0.0.0.3]nssa
[r7-ospf-1-area-0.0.0.3]abr-summary 10.3.0.0 255.255.0.0
[r7]int tun0/0/0
[r7-Tunnel0/0/0]ospf network-type p2mp
R8:
[r8]int lo0
[r8-LoopBack0]ip ad 10.3.8.1 32
[r8-LoopBack0]int g0/0/0
[r8-GigabitEthernet0/0/0]ip ad 10.3.78.8 24
[r8-GigabitEthernet0/0/0]int g0/0/1
[r8-GigabitEthernet0/0/1]ip ad 10.3.89.8 24
[r8]ospf 1 router-id 8.8.8.8
[r8-ospf-1]
[r8-ospf-1]a 3
[r8-ospf-1-area-0.0.0.3]network 10.3.8.1 0.0.0.0
[r8-ospf-1-area-0.0.0.3]network 10.3.78.0 0.0.0.255
[r8-ospf-1-area-0.0.0.3]network 10.3.89.0 0.0.0.255
[r8]ospf
[r8-ospf-1]a 3
[r8-ospf-1-area-0.0.0.3]nssa
R9:
[r9]int lo0
[r9-LoopBack0]ip ad 10.4.9.1 32
[r9-LoopBack0]int g0/0/0
[r9-GigabitEthernet0/0/0]ip ad 10.3.89.9 24
[r9-GigabitEthernet0/0/0]int g0/0/1
[r9-GigabitEthernet0/0/1]ip ad 10.4.109.9 24
[r9]ospf 1 router-id 9.9.9.9
[r9-ospf-1]a 3
[r9-ospf-1-area-0.0.0.3]network 10.3.89.0 0.0.0.255
[r9-ospf-1-area-0.0.0.3]a 4
[r9-ospf-1-area-0.0.0.4]network 10.4.9.1 0.0.0.0
[r9-ospf-1-area-0.0.0.4]network 10.4.109.0 0.0.0.255
[r9-ospf-1-area-0.0.0.4]undo network 10.4.9.1 0.0.0.0
[r9-ospf-1-area-0.0.0.4]undo network 10.4.109.0 0.0.0.255
[r9-ospf-1-area-0.0.0.4]q
[r9-ospf-1]undo area 4
[r9]ospf 2 router-id 9.9.9.9
[r9-ospf-2]a 4
[r9-ospf-2-area-0.0.0.4]network 10.4.9.1 0.0.0.0
[r9-ospf-2-area-0.0.0.4]network 10.4.109.0 0.0.0.255
[r9-ospf-2-area-0.0.0.4]q
[r9-ospf-2]q
[r9]ospf 1
[r9-ospf-1]import-route ospf 2
[r9-ospf-1]q
[r9]ospf 2
[r9-ospf-2]import-route ospf 1
[r9]ospf
[r9-ospf-1]asbr-summary 10.4.0.0 255.255.0.0
[r9-ospf-1]q
[r9]ospf 2
[r9-ospf-2]default-route-advertise
R10:
[r10]int lo0
[r10-LoopBack0]ip ad 10.4.10.1 32
[r10-LoopBack0]int g0/0/0
[r10-GigabitEthernet0/0/0]ip ad 10.4.109.10 24
[r10]ospf 1 router-id 10.10.10.10
[r10-ospf-1]a 4
[r10-ospf-1-area-0.0.0.4]network 10.4.10.1 0.0.0.0
[r10-ospf-1-area-0.0.0.4]network 10.4.109.0 0.0.0.255
R11:
[r11]int lo0
[r11-LoopBack0]ip ad 10.2.11.1 32
[r11-LoopBack0]int g0/0/0
[r11-GigabitEthernet0/0/0]ip ad 10.2.116.11 24
[r11-GigabitEthernet0/0/0]int g0/0/1
[r11-GigabitEthernet0/0/1]ip ad 10.2.112.11 24
[r11]ospf 1 router-id 11.11.11.11
[r11-ospf-1]a 2
[r11-ospf-1-area-0.0.0.2]network 10.2.11.1 0.0.0.0
[r11-ospf-1-area-0.0.0.2]network 10.2.116.0 0.0.0.255
[r11-ospf-1-area-0.0.0.2]network 10.2.112.0 0.0.0.255
[r11]ospf
[r11-ospf-1]a 2
[r11-ospf-1-area-0.0.0.2]nssa no-summary
R12:
[r12]int lo0
[r12-LoopBack0]ip ad 10.8.1.1 32
[r12-LoopBack0]int lo1
[r12-LoopBack1]ip ad 10.8.2.2 32
[r12]ospf 1 router-id 12.12.12.12
[r12-ospf-1]a 2
[r12-ospf-1-area-0.0.0.2]network 10.2.112.0 0.0.0.255
[r12-ospf-1-area-0.0.0.2]network 10.2.12.1 0.0.0.0
[r12-ospf-1-area-0.0.0.2]int lo3
[r12-LoopBack3]ip ad 10.2.12.1 32
[r12-LoopBack3]q
[r12]rip
[r12-rip-1]version 2
[r12-rip-1]undo summary
[r12-rip-1]network 10.0.0.0
[r12-rip-1]q
[r12]ospf 1
[r12-ospf-1]import-route rip
[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]ip ad 10.2.112.12 24
[r12]ospf
[r12-ospf-1]a 2
[r12-ospf-1-area-0.0.0.2]nssa no-summary