博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
隔离公司各个部门--虚拟路由器(OSPF)
阅读量:6877 次
发布时间:2019-06-26

本文共 5729 字,大约阅读时间需要 19 分钟。

拓扑:

 

 

R4配置:

ip vrf retail

rd 1:1
!
ip vrf trading
rd 2:2
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface Loopback1
ip vrf forwarding trading
ip address 20.1.1.4 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
ip vrf forwarding retail
ip address 10.1.1.4 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
!
interface FastEthernet0/1.100
encapsulation dot1Q 100
ip vrf forwarding retail
ip address 192.168.14.4 255.255.255.0
!
interface FastEthernet0/1.200
encapsulation dot1Q 200
ip vrf forwarding trading
ip address 172.16.14.4 255.255.255.0
!
router ospf 100 vrf retail
log-adjacency-changes
network 10.1.1.0 0.0.0.255 area 0
network 192.168.14.0 0.0.0.255 area 0
!
router ospf 200 vrf trading
log-adjacency-changes
network 20.1.1.0 0.0.0.255 area 0
network 172.16.14.0 0.0.0.255 area 0

R5配置:

ip vrf retail

rd 1:1
!
ip vrf trading
rd 2:2
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface Loopback1
ip vrf forwarding trading
ip address 40.1.1.5 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.100
encapsulation dot1Q 100
ip vrf forwarding retail
ip address 192.168.35.5 255.255.255.0
!
interface FastEthernet0/0.200
encapsulation dot1Q 200
ip vrf forwarding trading
ip address 172.16.35.5 255.255.255.0
!
interface FastEthernet0/1
ip vrf forwarding retail
ip address 30.1.1.5 255.255.255.0
duplex auto
speed auto
!
router ospf 100 vrf retail
log-adjacency-changes
network 30.1.1.0 0.0.0.255 area 0
network 192.168.35.0 0.0.0.255 area 0
!
router ospf 200 vrf trading
log-adjacency-changes
network 40.1.1.0 0.0.0.255 area 0
network 172.16.35.0 0.0.0.255 area 0

R1配置:

ip vrf retail

rd 100:100
route-target export 100:100
route-target import 100:100
!
ip vrf trading
rd 100:200
route-target export 100:200
route-target import 100:200
!
mpls label range 100 199
mpls label protocol ldp
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 12.1.1.1 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
!
interface FastEthernet0/1.100
encapsulation dot1Q 100
ip vrf forwarding retail
ip address 192.168.14.1 255.255.255.0
!
interface FastEthernet0/1.200
encapsulation dot1Q 200
ip vrf forwarding trading
ip address 172.16.14.1 255.255.255.0
!
router ospf 110 vrf retail
log-adjacency-changes
redistribute bgp 100 subnets
network 192.168.14.0 0.0.0.255 area 0
!
router ospf 210 vrf trading
log-adjacency-changes
redistribute bgp 100 subnets
network 172.16.14.0 0.0.0.255 area 0
!
router ospf 100
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 12.1.1.0 0.0.0.255 area 0
!
router bgp 100
bgp router-id 1.1.1.1
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 update-source Loopback0
!
address-family ***v4
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 send-community extended
exit-address-family
!
address-family ipv4 vrf trading
redistribute ospf 210 vrf trading match internal external 1 external 2 nssa-external 1 nssa-external 2
no synchronization
exit-address-family
!
address-family ipv4 vrf retail
redistribute ospf 110 vrf retail match internal external 1 external 2 nssa-external 1 nssa-external 2
no synchronization
exit-address-family
!
mpls ldp router-id Loopback0

R2配置:

mpls label range 200 299

mpls label protocol ldp
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
ip address 23.1.1.2 255.255.255.0
duplex auto
speed auto
mpls ip
!
router ospf 100
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 12.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
!
mpls ldp router-id Loopback0

R3配置:

ip vrf retail

rd 100:100
route-target export 100:100
route-target import 100:100
!
ip vrf trading
rd 100:200
route-target export 100:200
route-target import 100:200
!
mpls label range 300 399
mpls label protocol ldp
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.100
encapsulation dot1Q 100
ip vrf forwarding retail
ip address 192.168.35.3 255.255.255.0
!
interface FastEthernet0/0.200
encapsulation dot1Q 200
ip vrf forwarding trading
ip address 172.16.35.3 255.255.255.0
!
interface FastEthernet0/1
ip address 23.1.1.3 255.255.255.0
duplex auto
speed auto
mpls ip
!
router ospf 110 vrf retail
log-adjacency-changes
redistribute bgp 100 subnets
network 192.168.35.0 0.0.0.255 area 0
!
router ospf 210 vrf trading
log-adjacency-changes
redistribute bgp 100 subnets
network 172.16.35.0 0.0.0.255 area 0
!
router ospf 100
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 23.1.1.0 0.0.0.255 area 0
!
router bgp 100
bgp router-id 3.3.3.3
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback0
!
address-family ***v4
neighbor 1.1.1.1 activate
neighbor 1.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf trading
redistribute ospf 210 vrf trading match internal external 1 external 2 nssa-external 1 nssa-external 2
no synchronization
exit-address-family
!
address-family ipv4 vrf retail
redistribute ospf 110 vrf retail match internal external 1 external 2 nssa-external 1 nssa-external 2
no synchronization
exit-address-family
!

mpls ldp router-id Loopback0

验证:

从上图可以看出并没有收到同一部门的路由,查看OSPF数据库

从上图可以看出路由已经放进了OSPF 的数据库,但是由于设置了down选项,OSPF检查忽略了这些路由。

解决办法:

禁用DOWN检查

验证:

 

转载地址:http://gwrfl.baihongyu.com/

你可能感兴趣的文章
VMware安装Oracle Enterprise Linux 5.8 x86_64
查看>>
JavaWeb应用开发使用jetty札记
查看>>
Kafka Broker常用配置详解
查看>>
5分钟实战获取1000条锚文本外链技巧
查看>>
网络营销策划技巧,90%的人都不懂的思维
查看>>
使用TFS
查看>>
如何利用业余时间快乐的赚钱
查看>>
站长福利:网站内容设置扫码打赏后才能看啦!
查看>>
如何快速有效的提高新站权重
查看>>
Cisco设备作为DHCP服务器的配置方法(下)
查看>>
戴尔Windows 8终端:办公、娱乐两不误
查看>>
一体化解决方案是一条正确的发展道路
查看>>
Java中final和static关键字总结
查看>>
Oracle11.2.0.4-Rac集群hang分析记录
查看>>
Objective-C中init函数实现的相关研究
查看>>
java中重载与重写的区别
查看>>
Powerdesigner数据库建模--概念模型--ER图
查看>>
Rss内容读取
查看>>
解决Xcode 代码颜色不显示
查看>>
java 的继承,深入理解
查看>>