RTB接口G1/0/1绑定vpn实例vrf1,接口G1/0/2绑定vpn实例vrf2,接口G1/0/3绑定vpn实例vrf3。RTB与RTA建立iBGP连接。
RTA无法从RTB学习到vrf1跟vrf2的路由。
RTB上通过BGP的方式将vrf1与vrf2的路由引入vrf3。关键配置如下:
ip vpn-instance vrf1
route-distinguisher 1:1
vpn-target 1:1 1:3 import-extcommunity
vpn-target 1:1 export-extcommunity
ip vpn-instance vrf2
route-distinguisher 1:2
vpn-target 1:2 1:3 import-extcommunity
vpn-target 1:2 export-extcommunity
ip vpn-instance vrf3
route-distinguisher 1:3
vpn-target 1:1 1:2 1:3 import-extcommunity
vpn-target 1:3 export-extcommunity
bgp 100
ip vpn-instance vrf1
#
address-family ipv4 unicast
import-route direct
ip vpn-instance vrf2
#
address-family ipv4 unicast
import-route direct
ip vpn-instance vrf3
peer 192.168.3.1 as-number 100
#
address-family ipv4 unicast
import-route direct
peer 192.168.3.1 enable
在RTA上查看路由,学习不到vrf1跟vrf2的路由
SWA上学习不到192.168.1.0和192.168.2.0网段的路由:
<SWA>dis ip routing-table
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface
192.168.3.0/24 Direct 0 0 192.168.3.1 GE1/0/1
192.168.3.0/32 Direct 0 0 192.168.3.1 GE1/0/1
192.168.3.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.3.255/32 Direct 0 0 192.168.3.1 GE1/0/1
在RTA上查看bgp路由信息
dis bgp routing-table ipv4
Total number of routes: 3
BGP local router ID is 2.2.2.2
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
a - additional-path
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
i 192.168.1.0 192.168.1.254 0 100 0 ?
i 192.168.2.0 192.168.2.254 0 100 0 ? //没有*说明没有生效
* >i 192.168.3.0 192.168.3.254 0 100 0 ?
这时候发现BGP路由中,192.168.1.0的下一跳地址是 192.168.1.254,和SWA不是直连网段的,而是SWB和SWC互联的网段。此时,需要用 peer 192.168.3.1 next-hop-local修改路由下一跳,使得路由变成直连下一跳地址。
此时查看SWA上的BGP路由表发现路由生效,也可以正常学习到192.168.1.0和192.16.2.0网段。
dis bgp routing-table ipv4
Total number of routes: 3
BGP local router ID is 2.2.2.2
Status codes: * - valid, > - best, d - dampened, h - history
s - suppressed, S - stale, i - internal, e - external
a - additional-path
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* >i 192.168.1.0 192.168.3.254 0 100 0 ?
* >i 192.168.2.0 192.168.3.254 0 100 0 ?
* >i 192.168.3.0 192.168.3.254 0 100 0 ?
dis ip routing-table
Destinations : 15 Routes : 15
Destination/Mask Proto Pre Cost NextHop Interface
192.168.1.0/24 BGP 255 0 192.168.3.254 GE1/0/1
192.168.2.0/24 BGP 255 0 192.168.3.254 GE1/0/1
192.168.3.0/24 Direct 0 0 192.168.3.1 GE1/0/1
192.168.3.0/32 Direct 0 0 192.168.3.1 GE1/0/1
192.168.3.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.3.255/32 Direct 0 0 192.168.3.1 GE1/0/1
1、增加peer 192.168.3.1 next-hop-local修改下一跳为直连下一跳。
ip vpn-instance vrf3
peer 192.168.3.1 as-number 100
#
address-family ipv4 unicast
import-route direct
peer 192.168.3.1 enable
peer 192.168.3.1 next-hop-local
2、如果规划RT属性及配置BGP比较繁琐,可以使用route-replicate的方式。RTB上关键配置如下。注意,一定要加advertise参数,只有增加advertise参数,通过route-replicate引入的路由才能继续发布出去。
ip vpn-instance vrf1
address-family ipv4
route-replicate from vpn-instance vrf3 protocol direct
ip vpn-instance vrf2
address-family ipv4
route-replicate from vpn-instance vrf3 protocol direct
ip vpn-instance vrf3
address-family ipv4
route-replicate from vpn-instance vrf1 protocol direct advertise
route-replicate from vpn-instance vrf2 protocol direct advertise
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作