【无标题】

文章描述了一种通过配置OSPF路由协议、NHRP(NextHopResolutionProtocol)以及GRE(GenericRoutingEncapsulation)隧道来实现网络设备间的通信方法。配置包括设置默认路由、ACL、NAT和静态路由,以及在不同路由器上建立和配置隧道接口和VLink,以解决不连续子网问题并确保内网能访问外网。
摘要由CSDN通过智能技术生成

[r3]ip rou 0.0.0.0 0 34.1.1.2
[r3]ospf 100
[r3-ospf-100]default-route-advertise
[r3]acl 2000
[r3-acl-basic-2000]ru	
[r3-acl-basic-2000]rule p so an	
[r3-acl-basic-2000]rule p so any 
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]nat outbound 2000
[r6]int tu 0/0/0	
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r6-Tunnel0/0/0]so 172.16.1.1 	
[r6-Tunnel0/0/0]nhrp entry multicast dynamic 
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]ip ad 10.1.1.1 24

[r8]int tu 0/0/0	
[r8-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r8-Tunnel0/0/0]so 172.16.8.1	
[r8-Tunnel0/0/0]nhrp entry multicast dynamic 
[r8-Tunnel0/0/0]nhrp network-id 100
[r8-Tunnel0/0/0]ip ad 10.1.1.2 24

[r10]int tu 0/0/0	
[r10-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r10-Tunnel0/0/0]so 172.16.16.1	
[r10-Tunnel0/0/0]nhrp entry multicast dynamic 
[r10-Tunnel0/0/0]nhrp network-id 100
[r10-Tunnel0/0/0]ip ad 10.1.1.3 24

[r12]int tu 0/0/0	
[r12-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r12-Tunnel0/0/0]so 172.16.24.1	
[r12-Tunnel0/0/0]nhrp entry multicast dynamic 
[r12-Tunnel0/0/0]nhrp network-id 100
[r12-Tunnel0/0/0]ip ad 10.1.1.4 24
(配置Tunnel口然后配置ip

[r6-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0

[r8-ospf-1-area-0.0.0.0]network 10.1.1.2 0.0.0.0

[r10-ospf-1-area-0.0.0.0]network 10.1.1.3 0.0.0.0

[r12-ospf-1-area-0.0.0.0]network 10.1.1.4 0.0.0.0

(在各自的ospf中宣告Tunne的IP地址
[r6]ip route-static 172.16.16.0 21 172.16.1.2 
[r6]ip route-static 172.16.8.0 21 172.16.1.2
[r6]ip route-static 172.16.24.0 21 172.16.1.2

[r8]ip route-static 172.16.16.0 21 172.16.8.2
[r8]ip route-static 172.16.1.0 21 172.16.8.2
[r8]ip route-static 172.16.24.0 21 172.16.8.2

[r10]ip route-static 172.16.1.0 21 172.16.16.2 
[r10]ip route-static 172.16.8.0 21 172.16.16.2
[r10]ip route-static 172.16.24.0 21 172.16.16.2

[r12]ip route-static 172.16.1.0 21 172.16.24.2 
[r12]ip route-static 172.16.8.0 21 172.16.24.2
[r12]ip route-static 172.16.16.0 21 172.16.24.2

(在r6/r8r/10/r12写上去往其他三条路的静态
[r15-ospf-120]import-route ospf 110
[r15-ospf-120]q
[r15]ospf 110		
[r15-ospf-110]import-route ospf 120

双相重发布解决不连续子网

[r10]ospf 110
[r10-ospf-110]ar 2	
[r10-ospf-110-area-0.0.0.2]vlink-peer 11.11.11.11
[r11-ospf-110-area-0.0.0.2]vlink-peer 10.10.10.10

使用vlink解决远离骨干的非骨干区域

[r6]ip route-stati 0.0.0.0 0 46.1.1.1
[r6]ospf 110
[r6-ospf-110]default-route-advertise
[r6]acl 2000
[r6-acl-basic-2000]ru pe source any 
[r6-GigabitEthernet0/0/0]nat outbound 2000
[r6]int tu 0/0/1
[r6-Tunnel0/0/1]tunnel-protocol gre 
[r6-Tunnel0/0/1]source 46.1.1.2	
[r6-Tunnel0/0/1]description 34.1.1.1
[r6-Tunnel0/0/1]ip ad 11.1.1.2 24
[r6]ip rou 34.1.1.0 24 46.1.1.1
[r3]int tu0/0/1
[r3-Tunnel0/0/1]ip ad 11.1.1.1 24	
[r3-Tunnel0/0/1]tunnel-protocol gre 
[r3-Tunnel0/0/1]source 34.1.1.1 
[r3-Tunnel0/0/1]description 46.1.1.2

内网访问外网操作如上,然后宣告在各自的ospf的区域里面即可通讯

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值