此文档为学习记录,旨在探讨VRF实例之间如何建立EBGP邻居关系,仅供学习和参考。
拓扑

配置过程
1.创建VRF;
2.R1,R2所有接口均绑定至VRF;
3.通过ospf打通L1的路由;
4.R1,R2使用G0/0接口建立EBGP邻居关系,并宣告L2的路由;
R1:
ip vrf ISP
rd 1:1
route-target both 1:1
!
interface GigabitEthernet 0/0
ip vrf forwarding ISP
ip address 10.1.1.1 255.255.255.0
!
interface Loopback 1
ip vrf forwarding ISP
ip address 1.1.1.1 255.255.255.255
!
interface Loopback 2
ip vrf forwarding ISP
ip address 11.11.11.11 255.255.255.255
!
router bgp 65001
bgp router-id 1.1.1.1
bgp log-neighbor-changes
bgp graceful-restart restart-time 120
bgp graceful-restart stalepath-time 360
bgp graceful-restart
neighbor 10.1.1.2 remote-as 65002
neighbor 10.1.1.2 ebgp-multihop 255
neighbor 10.1.1.2 update-source GigabitEthernet 0/0
address-family ipv4
no neighbor 10.1.1.2 activate
exit-address-family
!
address-family ipv4 vrf ISP
network 11.11.11.11 mask 255.255.255.255
neighbor 10.1.1.2 remote-as 65002
neighbor 10.1.1.2 activate
exit-address-family
!
router ospf 101 vrf ISP
graceful-restart
area 0
network 1.1.1.1 0.0.0.0 area 0
network 10.1.1.1 0.0.0.0 area 0
!
R2:
ip vrf ISP
rd 1:1
route-target both 1:1
!
interface GigabitEthernet 0/0
ip vrf forwarding ISP
ip address 10.1.1.2 255.255.255.0
!
interface Loopback 1
ip vrf forwarding ISP
ip address 2.2.2.2 255.255.255.255
!
interface Loopback 2
ip vrf forwarding ISP
ip address 22.22.22.22 255.255.255.255
!
router bgp 65002
bgp router-id 2.2.2.2
bgp log-neighbor-changes
bgp graceful-restart restart-time 120
bgp graceful-restart stalepath-time 360
bgp graceful-restart
neighbor 10.1.1.1 remote-as 65001
neighbor 10.1.1.1 ebgp-multihop 255
neighbor 10.1.1.1 update-source GigabitEthernet 0/0
address-family ipv4
no neighbor 10.1.1.1 activate
exit-address-family
!
address-family ipv4 vrf ISP
network 22.22.22.22 mask 255.255.255.255
neighbor 10.1.1.1 remote-as 65001
neighbor 10.1.1.1 activate
exit-address-family
!
router ospf 101 vrf ISP
graceful-restart
network 2.2.2.2 0.0.0.0 area 0
network 10.1.1.2 0.0.0.0 area 0
查看效果
1.检查BGP邻居状态
show bgp ipv4 unicast vrf ISP sumary

2.查看路由表
show ip route vrf ISP bgp
成功学习到L2的路由信息

3.测试连通性
ping vrf ISP 11.11.11.11

▽往期推荐△
原文始发于微信公众号(青菜浪人):
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/308190.html