【无标题】

1.规划各个网段的IP

 


R6配IP

 

 R1配IP

 

2.公网要先实现全网通,添加缺省路由


[r1]ip route-static 0.0.0.0 0 16.1.1.1
[r1]ip route-static 0.0.0.0 0 166.1.1.1
 
[r2]ip route-static 0.0.0.0 0 26.1.1.1
 
[r3]ip route-static 0.0.0.0 0 36.1.1.1
 
[r4]ip route-static 0.0.0.0 0 46.1.1.1
 
[r5]ip route-static 0.0.0.0 0 56.1.1.1

 

 


 二、R1/2/3为星型的拓扑结构(MGRE),R1为中心站点;给R1/2/3分配192.168.1.0网段,走的是16.1.1.0的链路
R1配置
[r1]int tu 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r1-Tunnel0/0/0]source 16.1.1.2
Aug  4 2023 19:02:20-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 

R2配置 
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ip add 192.168.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source GigabitEthernet 0/0/0
Aug  4 2023 19:04:40-08:00 r2 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r2-Tunnel0/0/0]nhrp entry 192.168.1.1 16.1.1.2 register

R3配置
 [r3]int tu0/0/0
[r3-Tunnel0/0/0]ip add 192.168.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 

[r3-Tunnel0/0/0]source GigabitEthernet 0/0/0
Aug  4 2023 19:03:54-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r3-Tunnel0/0/0]nhrp entry 192.168.1.1 16.1.1.2 register  

R1上查看映射MAP,有R2、R3的

 


 R2上查看MAP,先ping一下R3,就会自动补全MAP ,R3类似

 

 

 虚拟IP也可以互通

 

  三、R1/4/5为全连的MGRE结构;给R1/4/5分配192.168.2.0网段,走166.1.1.0的链路,都以各自为中心写源地址
查看R1的MAP

 


R4和R5的MAP

 

R1配置
[r1]interface Tunnel0/0/1
[r1-Tunnel0/0/1]ip address 192.168.2.1 255.255.255.0 
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 166.1.1.2
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r1-Tunnel0/0/1]nhrp network-id 66

 R4配置
[r4]interface Tunnel0/0/1
[r4-Tunnel0/0/1]ip address 192.168.2.4 255.255.255.0 
[r4-Tunnel0/0/1]tunnel-protocol gre p2mp
[r4-Tunnel0/0/1]source 46.1.1.2
[r4-Tunnel0/0/1]nhrp entry multicast dynamic
[r4-Tunnel0/0/1]nhrp network-id 66
[r4-Tunnel0/0/1]nhrp entry 192.168.2.1 166.1.1.2 register

R5配置
[r5]interface Tunnel0/0/1

[r5-Tunnel0/0/1]ip address 192.168.2.5 255.255.255.0 
[r5-Tunnel0/0/1]tunnel-protocol gre p2mp
[r5-Tunnel0/0/1]source 56.1.1.2
[r5-Tunnel0/0/1]nhrp network-id 66
[r5-Tunnel0/0/1]nhrp entry 192.168.2.1 166.1.1.2 register
[r5-Tunnel0/0/1]nhrp entry 192.168.2.4 46.1.1.2 register

R1/R2/R3配置:
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0 //宣告的时Tunnel接口的IP
[r1-Tunnel0/0/0]nhrp entry multicast dynamic //将R1的伪广播功能打开
[r1]int t0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast
 
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0 
[r2-ospf-1-area-0.0.0.0]network 192.168.1.2 0.0.0.0 
[r2]int t0/0/0
[r2-Tunnel0/0/0]ospf network-type broadcast
[r2-Tunnel0/0/0]ospf dr-priority 0
 
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0 
[r3-ospf-1-area-0.0.0.0]network 192.168.1.3 0.0.0.0 
[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf network-type broadcast
[r3-Tunnel0/0/0]ospf dr-priority 0
 

R1/4/5的配置
[r1-ospf-1-area-0.0.0.0]net 192.168.2.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]ospf network-type broadcast
 
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]are 0
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 192.168.2.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]ospf network-type broadcast
 
r5]ospf 1 router-id 5.5.5.5 
[r5-ospf-1]are 0
[r5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 192.168.2.5 0.0.0.0
[r5-ospf-1-area-0.0.0.0]ospf network-type broadcast
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值