设为首页收藏本站language 语言切换
查看: 2701|回复: 4
收起左侧

[求助] 各位大佬,小弟想弱弱地问个关于bgp的问题。。

[复制链接]
发表于 2021-9-3 11:04:24 | 显示全部楼层 |阅读模式
小弟最近做了一个bgp的实验,碰到了一个问题想不通,想问下各位大佬。
实验拓扑如下:
在上图中,AS100内的IGP起ospf互联,都是全部宣告自己路由。R1与R2、R3、R4,还有R2与R3通过loopback口建立bgp邻居(下一跳什么的该弄的弄了),R1与R6,R4与R5、R5与R6之间通过直连路由建立bgp邻居,然后都只宣告loopback地址,现在问题来了:为啥R4、R5和R6没有R2、R3的loopback地址?而且我发现比如R5上有EBGP学来的R1的loopback地址,可是都是ping不通,这到底是为什么???
R1配置:
#
sysname R1
#
board add 0/2 4GET
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load flash:/portalpage.zip
#
drop illegal-mac alarm
#
ipv6
#
wlan ac-global carrier id other ac id 0
#
set cpu-usage threshold 80 restore 75
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
ospfv3 1
router-id 10.0.1.1
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ipv6 enable
ip address 10.0.12.1 255.255.255.0
ipv6 address 2000::1201/120
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet0/0/1
ipv6 enable
ip address 10.0.13.1 255.255.255.0
ipv6 address 2000::1301/120
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet2/0/0
ipv6 enable
ip address 10.0.14.1 255.255.255.0
ipv6 address 2000::1401/120
#
interface GigabitEthernet2/0/1
ipv6 enable
ip address 10.0.16.1 255.255.255.0
ipv6 address 2000::1601/120
#
interface GigabitEthernet2/0/2
#
interface GigabitEthernet2/0/3
#
interface NULL0
#
interface LoopBack0
ipv6 enable
ip address 10.0.1.1 255.255.255.255
ipv6 address 2000::1/128
ospfv3 1 area 0.0.0.0
#
bgp 100
router-id 10.0.1.1
peer 10.0.2.2 as-number 100
peer 10.0.2.2 connect-interface LoopBack0
peer 10.0.3.3 as-number 100
peer 10.0.3.3 connect-interface LoopBack0
peer 10.0.4.4 as-number 200
peer 10.0.4.4 ebgp-max-hop 2
peer 10.0.4.4 connect-interface LoopBack0
peer 10.0.16.6 as-number 400
peer 2000::2 as-number 100
peer 2000::2 connect-interface LoopBack0
peer 2000::3 as-number 100
peer 2000::3 connect-interface LoopBack0
peer 2000::4 as-number 200
peer 2000::4 ebgp-max-hop 2
peer 2000::4 connect-interface LoopBack0
peer 2000::1606 as-number 400
#
ipv4-family unicast
  undo synchronization
  network 10.0.1.1 255.255.255.255
  peer 10.0.2.2 enable
  peer 10.0.2.2 next-hop-local
  peer 10.0.3.3 enable
  peer 10.0.3.3 next-hop-local
  peer 10.0.4.4 enable
  peer 10.0.4.4 as-path-filter from-as-400 export
  peer 10.0.16.6 enable
  peer 10.0.16.6 as-path-filter from-as-200 export
#
ipv6-family unicast
  undo synchronization
  network 2000::1 128
  peer 2000::2 enable
  peer 2000::3 enable
  peer 2000::4 enable
  peer 2000::1606 enable
#
ospf 1
area 0.0.0.0
  network 10.0.1.1 0.0.0.0
  network 10.0.12.0 0.0.0.255
  network 10.0.13.0 0.0.0.255
#
route-policy r4-import permit node 10
if-match ipv6 address prefix-list r4-import
apply local-preference 150
#
route-policy r4-import permit node 20
#
ip as-path-filter from-as-400 deny _400_
ip as-path-filter from-as-400 permit .*
ip as-path-filter from-as-200 deny _200_
ip as-path-filter from-as-200 permit .*
#
ip route-static 10.0.4.4 255.255.255.255 10.0.14.4
#
ipv6 route-static 2000::4 128 2000::1404
#
ip ipv6-prefix r4-import index 10 permit 2000:0:0:51:: 64
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return


R2配置(R3相同):
#
sysname R2
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load flash:/portalpage.zip
#
drop illegal-mac alarm
#
ipv6
#
wlan ac-global carrier id other ac id 0
#
set cpu-usage threshold 80 restore 75
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
ospfv3 1
router-id 10.0.2.2
#
firewall zone Local
priority 15
#
interface Vlanif1
ipv6 enable
ipv6 address 2000:0:0:21::1/64
#
interface GigabitEthernet0/0/0
ipv6 enable
ip address 10.0.12.2 255.255.255.0
ipv6 address 2000::1202/120
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet0/0/1
ipv6 enable
ip address 10.0.23.2 255.255.255.0
ipv6 address 2000::2302/120
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ipv6 enable
ip address 10.0.2.2 255.255.255.255
ipv6 address 2000::2/128
ospfv3 1 area 0.0.0.0
#
bgp 100
peer 10.0.1.1 as-number 100
peer 10.0.1.1 connect-interface LoopBack0
peer 10.0.3.3 as-number 100
peer 10.0.3.3 connect-interface LoopBack0
peer 2000::1 as-number 100
peer 2000::1 connect-interface LoopBack0
peer 2000::3 as-number 100
peer 2000::3 connect-interface LoopBack0
#
ipv4-family unicast
  undo synchronization
  network 10.0.2.2 255.255.255.255
  peer 10.0.1.1 enable
  peer 10.0.3.3 enable
#
ipv6-family unicast
  undo synchronization
  network 2000::2 128
  peer 2000::1 enable
  peer 2000::3 enable
#
ospf 1
area 0.0.0.0
  network 10.0.2.2 0.0.0.0
  network 10.0.12.0 0.0.0.255
  network 10.0.23.0 0.0.0.255
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return


R4配置(R5、6相似):
#
sysname R4
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load flash:/portalpage.zip
#
drop illegal-mac alarm
#
ipv6
#
wlan ac-global carrier id other ac id 0
#
set cpu-usage threshold 80 restore 75
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface Vlanif1
ip address 10.1.4.1 255.255.255.0
#
interface GigabitEthernet0/0/0
ipv6 enable
ip address 10.0.14.4 255.255.255.0
ipv6 address 2000::1404/120
#
interface GigabitEthernet0/0/1
ipv6 enable
ip address 10.0.45.4 255.255.255.0
ipv6 address 2000::4504/120
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ipv6 enable
ip address 10.0.4.4 255.255.255.255
ipv6 address 2000::4/128
#
bgp 200
router-id 10.0.4.4
peer 10.0.1.1 as-number 100
peer 10.0.1.1 ebgp-max-hop 2
peer 10.0.1.1 connect-interface LoopBack0
peer 10.0.45.5 as-number 300
peer 2000::1 as-number 100
peer 2000::1 ebgp-max-hop 2
peer 2000::1 connect-interface LoopBack0
peer 2000::4505 as-number 300
#
ipv4-family unicast
  undo synchronization
  network 10.0.4.4 255.255.255.255
  peer 10.0.1.1 enable
  peer 10.0.45.5 enable
#
ipv6-family unicast
  undo synchronization
  network 2000::4 128
  peer 2000::1 enable
  peer 2000::4505 enable
#
ip route-static 10.0.1.1 255.255.255.255 10.0.14.1
#
ipv6 route-static 2000::1 128 2000::1401
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return


R1bgp路由表:


R2、R4的(其他类似)



 楼主| 发表于 2021-9-3 11:09:14 | 显示全部楼层
未命名1630638175.png 未命名1630638279.png 未命名1630638290.png 未命名1630638299.png
沙发 2021-9-3 11:09:14 回复 收起回复
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-9-3 11:10:11 | 显示全部楼层
图片在第二栏,不太懂这个操作
板凳 2021-9-3 11:10:11 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2021-9-18 22:07:33 | 显示全部楼层
为你的敬业精神先顶一个
地板 2021-9-18 22:07:33 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-5-21 03:47 , Processed in 1.277806 second(s), 27 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表