- 邻居按需发布路由
- 设备只希望接收自己需要的路由,ORF-(outbound route filters)出口路由器
- peer { group-name | ipv4-address } capability-advertise orf [ non-standard-compatible ] ip prefix { both | receive接收 | send 发送} [ standard-match 按照rfc标准 ] 一端为发送一端为接收
应用场景
当本端设备希望BGP邻居只发送它需要的路由,而BGP邻居又不愿意针对不同设备维护不同的出口策略时,可以运用BGP ORF特性。
实验环境
目的:仅仅允许1.1.2.1 /32的网段进入R2的路由表内
配置命令
R1
===============================================================
#
interface GigabitEthernet0/0/0
ip address 12.1.1.1 255.255.255.252
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface LoopBack1
ip address 1.1.2.1 255.255.255.255
#
interface LoopBack2
ip address 1.1.3.1 255.255.255.255
#
bgp 100
router-id 12.1.1.1
peer 12.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
network 1.1.1.1 255.255.255.255
network 1.1.2.1 255.255.255.255
network 1.1.3.1 255.255.255.255
peer 12.1.1.2 enable
peer 12.1.1.2 capability-advertise orf ip-prefix receive 配置被拒绝设备的orf使能接收
#
R2
=============================================================
#
interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.252
#
bgp 100
peer 12.1.1.1 as-number 100
#
ipv4-family unicast
undo synchronization
peer 12.1.1.1 enable
peer 12.1.1.1 ip-prefix 1 import
peer 12.1.1.1 capability-advertise orf ip-prefix send 使能orf发送端,也就是需要告诉对端需要拒绝的路由信息
#
ip ip-prefix 1 index 10 deny 1.1.2.1 32 //配置前缀列表抓取1.1.2.1 /32的路由
#
命令配置前
检查bgp邻居关系以及对端发送的路由信息
配置以后
【配置orf会导致BGP邻居断开,等待重新建立】
如果不想要断开的话,直接使用在前缀列表进行路由控制,不在设备上配置orf即可(是不是感觉orf很鸡肋-哈哈)