一、实验要求
1.R4为ISP,所连接的所有物理接口为公有网段,任意指定IP即可。
2.R1-2-3 构建一个星型结构的MGRE结构,其中R1为中心点,假设R1的公有IP为固定地址。
3.R1-5-6 构建另一个全连网状的MGRE网络,其中R1/5均为中心区域。
4.使用OSPF实现整个私有网络的互通,同时所有PC可以正常访问R4的环回。
二、实验拓扑
三、实验步骤
r1:
一、配置IP地址
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]ip address 14.1.1.1 24
[r1]interface GigabitEthernet 0/0/2
[r1-GigabitEthernet0/0/2]ip address 14.1.2.1 24
二、写缺省路由
[r1]ip route-static 0.0.0.0 0 14.1.1.2
[r1]ip route-static 0.0.0.0 0 14.1.2.2
三、构建1-2-3MGRE隧道
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 14.1.2.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
四、构建1-5-6MGRE隧道
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 100.1.1.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 14.1.1.1
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r1-Tunnel0/0/1]nhrp network-id 100
五、ACL + NAT使得私网均可以访问到ISP的环回4.4.4.4
[r1]acl 2000
[r1-acl-basic-2000]rule 1 permit source any
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]nat outbound 2000
[r1]interface GigabitEthernet 0/0/2
[r1-GigabitEthernet0/0/2]nat outbound 2000
六、启动OSPF宣告私网以及PC端IP地址
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[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 10.1.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 100.1.1.0 0.0.0.255
七、将隧道OSPF点到点类型改为点对多
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ospf network-type p2mp
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ospf network-type p2mp
r2:
一、配置IP地址
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 24.1.1.1 24
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.2.1 24
二、写缺省路由
[r2]ip route-static 0.0.0.0 0 24.1.1.2
三、构建MGRE隧道
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ip add
[r2-Tunnel0/0/0]ip address 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 14.1.2.1 register
[r2-Tunnel0/0/0]nhrp network-id 100
四、ACL + NAT使得私网均可以访问到ISP的环回4.4.4.4
[r2]acl 2000
[r2-acl-basic-2000]rule 1 permit source any
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]nat outbound 2000
五、启动OSPF宣告私网以及PC端IP地址
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
六、将隧道OSPF点到点类型改为点对多
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ospf network-type p2mp
r3:
一、配置IP地址
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 34.1.1.1 24
[r3]interface GigabitEthernet 0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.3.1 24
二、写缺省路由
[r3]ip route-static 0.0.0.0 0 34.1.1.2
三、构建MGRE隧道
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add
[r3-Tunnel0/0/0]ip address 10.1.1.3 24
[r3-Tunnel0/0/0]tu
[r3-Tunnel0/0/0]tunnel-protocol g
[r3-Tunnel0/0/0]tunnel-protocol gre p
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 14.1.2.1 register
[r3-Tunnel0/0/0]nhrp network-id 100
四、ACL + NAT使得私网均可以访问到ISP的环回4.4.4.4
[r3]acl 2000
[r3-acl-basic-2000]rule 1 permit source any
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]nat outbound 2000
五、启动OSPF宣告私网以及PC端IP地址
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
六、将隧道OSPF点到点类型改为点对多
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp
ISP-AR4:
一、配置IP地址
[ISP]interface GigabitEthernet 0/0/0
[ISP-GigabitEthernet0/0/0]ip address 14.1.1.2 24
[ISP]interface GigabitEthernet 0/0/1
[ISP-GigabitEthernet0/0/1]ip address 14.1.2.2 24
[ISP]interface GigabitEthernet 0/0/2
[ISP-GigabitEthernet0/0/2]ip address 24.1.1.2 24
[ISP]interface GigabitEthernet 4/0/0
[ISP-GigabitEthernet4/0/0]ip address 45.1.1.2 24
[ISP]interface GigabitEthernet 4/0/1
[ISP-GigabitEthernet4/0/1]ip address 46.1.1.2 24
[ISP]interface GigabitEthernet 4/0/2
[ISP-GigabitEthernet4/0/2]ip address 34.1.1.2 24
[ISP]interface LoopBack 0
[ISP-LoopBack0]ip address 4.4.4.4 24
r5:
一、配置IP地址
[r5]interface GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]ip address 45.1.1.1 24
[r5]interface GigabitEthernet 0/0/1
[r5-GigabitEthernet0/0/1]ip address 192.168.4.1 24
二、写缺省路由
[r5]ip route-static 0.0.0.0 0 45.1.1.2
三、构建MGRE隧道
[r5]interface Tunnel 0/0/1
[r5-Tunnel0/0/1]ip address 100.1.1.2 24
[r5-Tunnel0/0/1]tunnel-protocol gre p2mp
[r5-Tunnel0/0/1]source 45.1.1.1
[r5-Tunnel0/0/1]nhrp entry multicast dynamic
[r5-Tunnel0/0/1]nhrp network-id 100
四、ACL + NAT使得私网均可以访问到ISP的环回4.4.4.4
[r5]acl 2000
[r5-acl-basic-2000]rule 1 permit source any
[r5]interface GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]nat outbound 2000
五、启动OSPF宣告私网以及PC端IP地址
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 100.1.1.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
六、将隧道OSPF点到点类型改为点对多
[r5]interface Tunnel 0/0/1
[r5-Tunnel0/0/1]ospf network-type p2mp
r6:
一、配置IP地址
[r6]interface GigabitEthernet 0/0/0
[r6-GigabitEthernet0/0/0]ip address 46.1.1.1 24
[r6]interface GigabitEthernet 0/0/1
[r6-GigabitEthernet0/0/1]ip address 192.168.5.1 24
二、写缺省路由
[r6]ip route-static 0.0.0.0 0 46.1.1.2
三、构建MGRE隧道
[r6]interface Tunnel 0/0/1
[r6-Tunnel0/0/1]ip address 100.1.1.3 24
[r6-Tunnel0/0/1]tunnel-protocol gre p2mp
[r6-Tunnel0/0/1]source GigabitEthernet 0/0/0
[r6-Tunnel0/0/1]nhrp entry 100.1.1.1 14.1.1.1 register
[r6-Tunnel0/0/1]nhrp entry 100.1.1.2 45.1.1.1 register
[r6-Tunnel0/0/1]nhrp network-id 100
四、ACL + NAT使得私网均可以访问到ISP的环回4.4.4.4
[r6]acl 2000
[r6-acl-basic-2000]rule 1 permit source any
[r6]interface GigabitEthernet 0/0/0
[r6-GigabitEthernet0/0/0]nat outbound 2000
五、启动OSPF宣告私网以及PC端IP地址
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 100.1.1.0 0.0.0.255
[r6-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
六、将隧道OSPF点到点类型改为点对多
[r6]interface Tunnel 0/0/1
[r6-Tunnel0/0/1]ospf network-type p2mp
四、测试网络的连通性
PC1 pingISP的环回和PC5
PC5 ping ISP上的环回和 PC2