配置 BGP 协议

system-view bgp 65001 # 开启 BGP 进程,设定 AS 号为 65001 quit

配置 BGP 路由

interface GigabitEthernet 0/0/1 # 进入 GigabitEthernet 0/0/1 接口 ip address 192.168.1.1 255.255.255.0 # 配置接口 IP 地址 quit

配置 BGP 邻居

bgp 65001 peer 192.168.1.2 as-number 65002 # 设定邻居 IP 地址和 AS 号 peer 192.168.1.2 connect-interface GigabitEthernet 0/0/1 # 设定邻居连接的接口 peer 192.168.1.2 description Neighbor-1 # 设定邻居描述 peer 192.168.1.2 route-policy export export-policy # 设定导出路由的策略 peer 192.168.1.2 route-policy import import-policy # 设定导入路由的策略 quit

配置 BGP 策略

ip ip-prefix prefix1 permit 192.168.1.0 24 # 定义 IP 前缀 route-policy export-policy permit node 10 # 定义导出路由策略 if-match ip-address prefix1 # 匹配前缀 apply community 65001:1 # 应用社区属性 quit route-policy import-policy permit node 10 # 定义导入路由策略 if-match community 65002:1 # 匹配社区属性 apply ip-address next-hop 192.168.1.2 # 应用下一跳地址 quit

配置 BGP 属性

bgp 65001 network 192.168.1.0 mask 255.255.255.0 route-policy export-policy # 发布路由 qui


原文地址: https://www.cveoy.top/t/topic/doru 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录