MGRE环境下的OSPF网络搭建

 题目要求

1. R6为ISP只能配置IP地址,R1-R5的环回为私有网段
2. R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点
3. 所有私有网段可以互相通讯,私有网段使用osPF完成

题目分析

1. IP划分,虚拟网段划分
2. R1/4/5为全连结构,每一个节点都为中心节点;R1/2/3为星型结构,R1为中心节点,R2/3为分支节点
3. 启用OSPF,虚拟接口更改接口类型,分支节点修改接口优先级为0

 实验配置

 IP划分

虚拟网段:
R1/4/5
192.168.7.0/24
R1/2/3
192.168.8.0/24

私网网段:
R1
192.168.1.0/24
R2
192.168.2.0/24
R3
192.168.3.0/24
R4
192.168.4.0/24
R5
192.168.5.0/24

骨干链路网段:
R1,R6
16.0.0.0/24
61.0.0.0/24

R2,R6
26.0.0.0/24

R3,R6
36.0.0.0/24

R4,R6
46.0.0.0/24

R5,R6
56.0.0.0/24

路由器配置内容

在进行R1/4/5的MGRE环境配置时,应先将其隧道接口关闭(进入接口输入 shutdown 命令),否则可能会出现注册不成功

R1配置:
配置IP地址
interface GigabitEthernet0/0/0
 ip address 16.0.0.1 255.255.255.0 
interface GigabitEthernet0/0/1
 ip address 61.0.0.1 255.255.255.0 

配置环回代表私网地址
interface LoopBack0
 ip address 192.168.1.1 255.255.255.0 

创建VPN隧道
interface Tunnel0/0/0
 ip address 192.168.7.1 255.255.255.0 
 tunnel-protocol gre p2mp
 source 16.0.0.1
interface Tunnel0/0/1
 ip address 192.168.8.1 255.255.255.0 
 tunnel-protocol gre p2mp
 source 61.0.0.1

修改隧道接口类型,Tunnel0/0/0和Tunnel0/0/1口都要修改
 ospf network-type broadcast

开启伪广播,两个Tunnel口都要开启
 nhrp entry multicast dynamic

向中心节点R4,R5注册
 nhrp entry 192.168.7.2 46.0.0.1 register
 nhrp entry 192.168.7.3 56.0.0.1 register


启用OSPF,配置RID,在区域0内宣告私网网段和虚拟网段
ospf 1 router-id 1.1.1.1 
 area 0.0.0.0 
  network 192.168.1.0 0.0.0.255 
  network 192.168.7.0 0.0.0.255 
  network 192.168.8.0 0.0.0.255 

配置缺省路由
ip route-static 0.0.0.0 0.0.0.0 16.0.0.2
ip route-static 0.0.0.0 0.0.0.0 61.0.0.2


R2配置:
IP地址
interface GigabitEthernet0/0/0
 ip address 26.0.0.1 255.255.255.0 

环回
interface LoopBack0
 ip address 192.168.2.1 255.255.255.0 

VPN隧道
interface Tunnel0/0/0
 ip address 192.168.8.2 255.255.255.0 
 tunnel-protocol gre p2mp
 source 26.0.0.1

修改隧道接口类型
 ospf network-type broadcast

修改隧道接口优先级
 ospf dr-priority 0


向中心节点R1注册
 nhrp entry 192.168.8.1 61.0.0.1 register

启用OSPF,配置RID,在区域0内宣告私网网段和虚拟网段
ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
  network 192.168.2.0 0.0.0.255 
  network 192.168.8.0 0.0.0.255 

配置缺省路由
ip route-static 0.0.0.0 0.0.0.0 26.0.0.2


R3配置:
IP地址
interface GigabitEthernet0/0/0
 ip address 36.0.0.1 255.255.255.0 

环回接口
interface LoopBack0
 ip address 192.168.3.1 255.255.255.0 

VPN隧道
interface Tunnel0/0/0
 ip address 192.168.8.3 255.255.255.0 
 tunnel-protocol gre p2mp
 source 36.0.0.1

修改隧道接口类型
 ospf network-type broadcast

修改隧道接口优先级
 ospf dr-priority 0


向中心节点R1注册
 nhrp entry 192.168.8.1 61.0.0.1 register

启用OSPF,配置RID,在区域0内宣告私网网段和虚拟网段
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 192.168.3.0 0.0.0.255 
  network 192.168.8.0 0.0.0.255 

配置缺省路由
ip route-static 0.0.0.0 0.0.0.0 36.0.0.2


R4配置:
#
interface GigabitEthernet0/0/0
 ip address 46.0.0.1 255.255.255.0 
#
interface LoopBack0
 ip address 192.168.4.1 255.255.255.0 
#
interface Tunnel0/0/0
 ip address 192.168.7.2 255.255.255.0 
 tunnel-protocol gre p2mp
 source 46.0.0.1
 ospf network-type broadcast
#
向中心节点R1,R5注册
 nhrp entry 192.168.7.3 56.0.0.1 register
 nhrp entry 192.168.7.1 16.0.0.1 register
#
ospf 1 router-id 4.4.4.4 
 area 0.0.0.0 
  network 192.168.4.0 0.0.0.255 
  network 192.168.7.0 0.0.0.255 
#
ip route-static 0.0.0.0 0.0.0.0 46.0.0.2


R5配置:
#
interface GigabitEthernet0/0/0
 ip address 56.0.0.1 255.255.255.0 
#
interface LoopBack0
 ip address 192.168.5.1 255.255.255.0 
#
interface Tunnel0/0/0
 ip address 192.168.7.3 255.255.255.0 
 tunnel-protocol gre p2mp
 source 56.0.0.1
 ospf network-type broadcast
 nhrp entry 192.168.7.2 46.0.0.1 register
 nhrp entry 192.168.7.1 16.0.0.1 register
#
ospf 1 router-id 5.5.5.5 
 area 0.0.0.0 
  network 192.168.5.0 0.0.0.255 
  network 192.168.7.0 0.0.0.255 
#
ip route-static 0.0.0.0 0.0.0.0 56.0.0.2


R6配置:
只用配置IP地址
interface GigabitEthernet0/0/0
 ip address 16.0.0.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 61.0.0.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 26.0.0.2 255.255.255.0 
#
interface GigabitEthernet4/0/0
 ip address 36.0.0.2 255.255.255.0 
#
interface GigabitEthernet4/0/1
 ip address 46.0.0.2 255.255.255.0 
#
interface GigabitEthernet4/0/2
 ip address 56.0.0.2 255.255.255.0 



实验结果 

R1映射表

 R1邻居表

 R2映射表

R2邻居表

 R4映射表

R4邻居表

 R1 ping R2

 R1 ping R4

 R2 ping R3

 R2 ping R4

  R4 ping R5

### OSPF Point-to-Multipoint Configuration with MGRE Tunneling Explanation and Setup Guide #### Understanding the Basics of OSPF Point-to-Multipoint Networks In a point-to-multipoint network type within OSPF, routers do not elect Designated Routers (DRs) or Backup Designated Routers (BDRs). Neighbors are established directly between endpoints. The default Hello interval is set to 30 seconds while the Dead interval stands at 120 seconds[^1]. This configuration simplifies neighbor establishment but requires careful planning when integrating advanced features like Multi-Point GRE tunnels. #### Introduction to Multi-Point GRE Tunnels Multi-Point GRE (mGRE) allows multiple remote sites to connect through a single virtual interface on an endpoint device without requiring individual physical interfaces for each connection. mGRE can significantly reduce complexity in hub-and-spoke topologies by enabling dynamic tunnel creation based on IPsec policies or other criteria. #### Combining OSPF Point-to-Multipoint Network Type with mGRE When combining these two technologies: - **Hub Router**: Configured as both ends of all spokes' mGRE sessions. - **Spoke Routers**: Each configured individually pointing back towards the central hub router's public address over which they will establish their respective mGRE session(s). The combination leverages OSPF’s ability to form adjacencies easily across non-broadcast multi-access networks such as those created via mGRE tunnels. It also benefits from OSPF's inherent support for point-to-multipoint configurations where DR/BDR elections aren't necessary due to direct adjacency formation among participating nodes. #### Example Configuration Steps for Hub Router Using Huawei CLI Syntax Below demonstrates how one might configure this scenario using commands similar to what would be found in a typical enterprise-grade environment provided by vendors like Huawei. ```shell # Enter system view mode system-view # Create loopback interface used for establishing mGRE connections interface LoopBack0 ip address 192.168.1.1 255.255.255.255 # Configure real Ethernet port that connects outside world interface GigabitEthernet0/0/1 ip address dhcp # Define mGRE template tunnel-template gre multipoint name mgre-tpl source-interface LoopBack0 destination any # Apply mGRE settings onto actual tunnel interface interface Tunnel0 undo ip address tunnel-protocol gre multipoint apply tunnel-template mgre-tpl ospf enable area 0 ``` For spoke routers, replace `source-interface` command under `tunnel-template` section accordingly depending upon local addressing scheme; ensure consistency throughout entire deployment regarding naming conventions applied here too. #### Verification Commands After Setup Completion Once completed successfully, verify operation status utilizing following instructions available inside most modern networking gear including models produced by companies mentioned earlier: ```shell display ospf peer brief # Check current state of OSPF peers display ip routing-table # Review learned routes after convergence has occurred ping -a <Source_IP> <Destination_IP> # Test reachability between different segments involved ``` --related questions-- 1. How does changing OSPF hello/dead timers affect stability in large-scale deployments? 2. What considerations should administrators take into account before implementing mGRE solutions? 3. Can you explain more about configuring OSPF route-id specifically for devices running OSPF protocol? 4. In what scenarios could deploying OSPF stub areas improve performance compared against standard ones?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值