经典企业网内部OSPF路由选路

实验:在这里插入图片描述
为了增加网络带宽以及网络流量的监控 ,本公司设置了俩台专门负责办公和业务的路由器。
要求:
1、全网可达
2、分部办公网络只能走办公路由器,分部业务网络智能走分部路由器。
3、路由器之间采取OSPF的方式进行联通

配置思路:首先我们想,流量要分开走,必须要上策略,前缀列表必须在重发布上完成,所以我们需要俩个进程。在办公路由器和业务路由器上进行重分布的配置。

配置:
R1:

interface LoopBack0
 ip address 10.1.1.1 255.255.255.0 
 ospf network-type broadcast
#
interface LoopBack1
 ip address 10.1.2.1 255.255.255.0 
 ospf network-type broadcast
 
 interface GigabitEthernet0/0/0
 ip address 10.1.12.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.13.1 255.255.255.0 
 
 ospf 1 router-id 1.1.1.1 
 area 0.0.0.0 
 network 0.0.0.0 255.255.255.255 

R2:

interface LoopBack0
 ip address 10.1.3.1 255.255.255.0 
 ospf network-type broadcast
#
interface LoopBack1
 ip address 10.1.4.1 255.255.255.0 
 ospf network-type broadcast
#
interface GigabitEthernet0/0/0
 ip address 10.1.12.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.24.1 255.255.255.0 
 
 ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
 network 0.0.0.0 255.255.255.255 

R3:

interface GigabitEthernet0/0/0
 ip address 10.1.13.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.34.1 255.255.255.0 
 ospf cost 5
#
interface GigabitEthernet0/0/2
 ip address 10.1.35.1 255.255.255.0 
#
interface GigabitEthernet3/0/0
 ip address 10.1.36.1 255.255.255.0 

ospf 1 router-id 3.3.3.3 
 import-route ospf 2 type 1 route-policy f2yw
 area 0.0.0.0 
  network 10.1.13.0 0.0.0.255 
  network 10.1.34.0 0.0.0.255 
#
ospf 2 router-id 3.3.3.3 
 import-route ospf 1 type 1 route-policy zyw
 area 0.0.0.1 
  network 10.1.35.0 0.0.0.255 
  network 10.1.36.0 0.0.0.255 

ip ip-prefix f2yw index 10 permit 10.2.2.0 24
ip ip-prefix zyw index 10 permit 10.1.2.0 24
ip ip-prefix zyw index 20 permit 10.1.4.0 24
ip ip-prefix f3yw index 10 permit 10.3.1.0 24

#
route-policy zyw permit node 10 
 if-match ip-prefix zyw 
 apply cost 5 
 apply cost-type type-1 
route-policy zyw permit node 20 
#
route-policy f2yw permit node 10 
 if-match ip-prefix f2yw 
 apply cost 5 
 apply cost-type type-1 
route-policy f2yw permit node 20 
#
route-policy f3yw permit node 10 
 if-match ip-prefix f3yw 
 apply cost 5 
 apply cost-type type-1 
route-policy f3yw permit node 20 

R4:

interface GigabitEthernet0/0/0
 ip address 10.1.24.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.34.2 255.255.255.0 
 ospf cost 5
#
interface GigabitEthernet0/0/2
 ip address 10.1.45.1 255.255.255.0 
#
interface GigabitEthernet4/0/0
 ip address 10.1.47.1 255.255.255.0 

ospf 1 router-id 4.4.4.4 
 import-route ospf 2 type 1 route-policy f2bg
 area 0.0.0.0 
  network 10.1.24.0 0.0.0.255 
  network 10.1.34.0 0.0.0.255 
#
ospf 2 router-id 4.4.4.4 
 import-route ospf 1 type 1 route-policy zbg
 area 0.0.0.0 
 area 0.0.0.1 
  network 10.1.45.0 0.0.0.255 
  network 10.1.47.0 0.0.0.255 

#
ip ip-prefix zbg index 10 permit 10.1.3.0 24
ip ip-prefix zbg index 20 permit 10.1.1.0 24
ip ip-prefix f2bg index 10 permit 10.2.2.0 24
ip ip-prefix f3bg index 10 permit 10.3.1.0 24

route-policy zbg permit node 10 
 if-match ip-prefix zbg 
 apply cost 5 
 apply cost-type type-1 
route-policy zbg permit node 20 
#
route-policy f2bg permit node 10 
 if-match ip-prefix f2bg 
 apply cost 5 
 apply cost-type type-1 
route-policy f2bg permit node 20 
#
route-policy f3bg permit node 10 
 if-match ip-prefix f3bg 
 apply cost 5 
 apply cost-type type-1 
route-policy f3bg permit node 20 

R5:

interface LoopBack0
 ip address 10.2.1.1 255.255.255.0 
 ospf network-type broadcast
#
interface LoopBack1
 ip address 10.2.2.1 255.255.255.0 
 ospf network-type broadcast

interface GigabitEthernet0/0/0
 ip address 10.1.35.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.45.2 255.255.255.0 
#
ospf 2 router-id 5.5.5.5 
 area 0.0.0.1 
  network 0.0.0.0 255.255.255.255 

R6:

interface LoopBack0
 ip address 10.3.1.1 255.255.255.0 
 ospf network-type broadcast
 #
interface GigabitEthernet0/0/0
 ip address 10.1.36.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.67.1 255.255.255.0 
#
 ospf 2 router-id 6.6.6.6 
 area 0.0.0.1 
 network 0.0.0.0 255.255.255.255 

R7:

interface LoopBack0
 ip address 10.3.2.1 255.255.255.0 
 ospf network-type broadcast
 #
interface GigabitEthernet0/0/0
 ip address 10.1.47.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.67.2 255.255.255.0 
 #
ospf 2 router-id 7.7.7.7 
 area 0.0.0.1 
  network 0.0.0.0 255.255.255.255 

配置完成我们测试 先看R5 R6 R7 的路由表:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
下一跳都没有问题我们在追踪一下流量
在R5上:
在这里插入图片描述
R6:
在这里插入图片描述
R7:
在这里插入图片描述
注:如果分部之间不相互通信的话 我们再起一个进程 来完成!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值