目录
1.实验要求
1.R6为ISP,所连接的所有物理接口为公有网段,任意指定ip即可
2.R1-4-5星型结构的MGRE结构,其中R1为中心点,假设R1的公有ip为固定地址
3.R1-2-3 构建另一个全连网状的MGRE网络,其中R1为中心区域;
4.使用osPF实现整个私有网络的互通,同时所有pc可以正常访问R6的环回
2.实验步骤
1.配置IP地址
按照下图所示配置IP地址
2.配置缺省路由
[r1]ip route-static 0.0.0.0 0 16.1.1.6
[r1]ip route-static 0.0.0.0 0 61.1.1.6
[r2]ip route-static 0.0.0.0 0 26.1.1.6
[r3]ip route-static 0.0.0.0 0 36.1.1.6
[r4]ip route-static 0.0.0.0 0 46.1.1.6
[r1]ip route-static 0.0.0.0 0 56.1.1.6
3.配置NAT
[r1]acl 2000
[r1-acl-basic-2000]rule 1 permit source any
[r1-acl-basic-2000]q
[r1]inter s4/0/0
[r1-GigabitEthernet0/0/0]nat outbound 2000
在r2r3r4r5上进行相同配置
4.配置MGRE
1.r1-4-5的配置
r1
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]source 16.1.1.1
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry 10.1.1.5 56.1.1.5 register
[r1-Tunnel0/0/0]nhrp entry 10.1.1.4 46.1.1.4 register
r4
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]ip address 10.1.1.4 24
[r4-Tunnel0/0/0]source 46.1.1.4
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.1 register
[r4-Tunnel0/0/0]nhrp entry 10.1.1.5 56.1.1.5 register
r5
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]ip address 10.1.1.5 24
[r5-Tunnel0/0/0]source 56.1.1.5
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.1 register
[r5-Tunnel0/0/0]nhrp entry 10.1.1.4 46.1.1.4 register
2.r1-2-3的配置
r1
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]ip address 20.1.1.1 24
[r1-Tunnel0/0/1]source 61.1.1.1
[r1-Tunnel0/0/1]nhrp network-id 101
[r1-Tunnel0/0/1]nhrp entry 20.1.1.2 26.1.1.5 register
[r1-Tunnel0/0/1]nhrp entry 20.1.1.3 36.1.1.4 register
r2
[r2]int Tunnel 0/0/1
[r2-Tunnel0/0/1]tunnel-protocol gre p2mp
[r2-Tunnel0/0/1]ip address 20.1.1.2 24
[r2-Tunnel0/0/1]source g0/0/0
[r2-Tunnel0/0/1]nhrp entry 20.1.1.1 61.1.1.1 register
[r2-Tunnel0/0/1]nhrp network-id 101
r3
[r3]int Tunnel 0/0/1
[r3-Tunnel0/0/1]tunnel-protocol gre p2mp
[r3-Tunnel0/0/1]ip address 20.1.1.3 24
[r3-Tunnel0/0/1]source g0/0/0
[r3-Tunnel0/0/1]nhrp entry 20.1.1.1 61.1.1.1 register
[r3-Tunnel0/0/1]nhrp network-id 101
5.配置OSPF
r1
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ospf network-type broadcast
r2
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[r2]interface Tunnel 0/0/1
[r2-Tunnel0/0/1]ospf network-type broadcast
r3
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[r3]interface Tunnel 0/0/1
[r3-Tunnel0/0/1]ospf network-type broadcast
r4
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]q
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ospf network-type broadcast
r5
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]q
[r5]int Tunnel 0/0/0
[r5-Tunnel0/0/0]ospf network-type broadcast
6.关闭水平分割
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
7.把r2r3的dr优先级改为0
[r2-Tunnel0/0/1]ospf dr-priority 0
3.测试
r1
r2
r3
r4
r5