拓扑
正常情况下不会,R1不会宣告g1/0口进OSPF,R4不会宣告g1/0口进OSPF
R4上查看5.5.5.5的路由的下一跳为12.1.1.1,不可达,bgp路由不优化,不会发送给R6
需要在R1和R4上分别配置bgp的next-hop-self,R4上看5.5.5.5的下一跳为12.1.1.1
R2收到的是imp-null会把标签弹出,继续查看路由表,没有5.5.5.5 的路由,丢包
应该用R1和R4的lo0口建立iBGP邻居
配置
- R1、R2、R3、R4之间运行OSPF
- R1与R5运行EBGP
- R4与R6运行EBGP
- R1与R4运行IBGP
- R1、R2、R3、R4运行MPLS
R1#sh run
Building configuration...
Current configuration : 2282 bytes
!
! Last configuration change at 04:23:00 UTC Thu Apr 20 2023
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 100 199
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0/0
no ip address
shutdown
duplex auto
!
interface GigabitEthernet0/0
ip address 12.1.1.1 255.255.255.0
duplex full
speed 1000
media-type gbic
negotiation auto
mpls ip
!
interface GigabitEthernet1/0
ip address 15.1.1.1 255.255.255.0
negotiation auto
!
interface GigabitEthernet2/0
no ip address
shutdown
negotiation auto
!
interface GigabitEthernet3/0
no ip address
shutdown
negotiation auto
!
interface Serial4/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/7
no ip address
shutdown
serial restart-delay 0
!
!
router ospf 1
router-id 1.1.1.1
network 1.1.1.1 0.0.0.0 area 0
network 12.1.1.1 0.0.0.0 area 0
!
router bgp 1234
bgp router-id 1.1.1.1
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 1234
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 next-hop-self
neighbor 15.1.1.5 remote-as 500
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
mpls ldp router-id Loopback0
!
control-plane
!
!
!
mgcp profile default
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
transport input all
!
!
end
R2#sh run
Building configuration...
Current configuration : 2117 bytes
!
! Last configuration change at 07:26:53 UTC Mon Apr 17 2023
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 200 299
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Ethernet0/0
no ip address
shutdown
duplex auto
!
interface GigabitEthernet0/0
ip address 12.1.1.2 255.255.255.0
duplex full
speed 1000
media-type gbic
negotiation auto
mpls ip
!
interface GigabitEthernet1/0
ip address 23.1.1.2 255.255.255.0
negotiation auto
mpls ip
!
interface GigabitEthernet2/0
no ip address
shutdown
negotiation auto
!
interface GigabitEthernet3/0
no ip address
shutdown
negotiation auto
!
interface Serial4/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/7
no ip address
shutdown
serial restart-delay 0
!
!
router ospf 1
router-id 2.2.2.2
network 2.2.2.2 0.0.0.0 area 0
network 12.1.1.2 0.0.0.0 area 0
network 23.1.1.2 0.0.0.0 area 0
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
mpls ldp router-id Loopback0
!
control-plane
!
!
!
mgcp profile default
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
transport input all
!
!
end
R3#sh run
Building configuration...
Current configuration : 2117 bytes
!
! Last configuration change at 06:50:37 UTC Mon Apr 17 2023
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 300 399
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Ethernet0/0
no ip address
shutdown
duplex auto
!
interface GigabitEthernet0/0
ip address 23.1.1.3 255.255.255.0
duplex full
speed 1000
media-type gbic
negotiation auto
mpls ip
!
interface GigabitEthernet1/0
ip address 34.1.1.3 255.255.255.0
negotiation auto
mpls ip
!
interface GigabitEthernet2/0
no ip address
shutdown
negotiation auto
!
interface GigabitEthernet3/0
no ip address
shutdown
negotiation auto
!
interface Serial4/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/7
no ip address
shutdown
serial restart-delay 0
!
!
router ospf 1
router-id 3.3.3.3
network 3.3.3.3 0.0.0.0 area 0
network 23.1.1.3 0.0.0.0 area 0
network 34.1.1.3 0.0.0.0 area 0
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
mpls ldp router-id Loopback0
!
control-plane
!
!
!
mgcp profile default
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
transport input all
!
!
end
R4#sh run
Building configuration...
Current configuration : 2282 bytes
!
! Last configuration change at 03:33:30 UTC Tue Apr 18 2023
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 400 499
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0/0
no ip address
shutdown
duplex auto
!
interface GigabitEthernet0/0
ip address 34.1.1.4 255.255.255.0
duplex full
speed 1000
media-type gbic
negotiation auto
mpls ip
!
interface GigabitEthernet1/0
ip address 46.1.1.4 255.255.255.0
negotiation auto
!
interface GigabitEthernet2/0
no ip address
shutdown
negotiation auto
!
interface GigabitEthernet3/0
no ip address
shutdown
negotiation auto
!
interface Serial4/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/7
no ip address
shutdown
serial restart-delay 0
!
!
router ospf 1
router-id 4.4.4.4
network 4.4.4.4 0.0.0.0 area 0
network 34.1.1.4 0.0.0.0 area 0
!
router bgp 1234
bgp router-id 4.4.4.4
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 1234
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 46.1.1.6 remote-as 600
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
mpls ldp router-id Loopback0
!
control-plane
!
!
!
mgcp profile default
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
transport input all
!
!
end
R5#sh run
Building configuration...
Current configuration : 2074 bytes
!
! Last configuration change at 11:25:57 UTC Mon Apr 17 2023
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface Ethernet0/0
no ip address
shutdown
duplex auto
!
interface GigabitEthernet0/0
ip address 15.1.1.5 255.255.255.0
duplex full
speed 1000
media-type gbic
negotiation auto
!
interface GigabitEthernet1/0
no ip address
shutdown
negotiation auto
!
interface GigabitEthernet2/0
no ip address
shutdown
negotiation auto
!
interface GigabitEthernet3/0
no ip address
shutdown
negotiation auto
!
interface Serial4/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/7
no ip address
shutdown
serial restart-delay 0
!
!
router bgp 500
bgp router-id 5.5.5.5
bgp log-neighbor-changes
network 5.5.5.5 mask 255.255.255.255
neighbor 15.1.1.1 remote-as 1234
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
ip route 0.0.0.0 0.0.0.0 15.1.1.1
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
mgcp profile default
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
transport input all
!
!
end
R6#sh run
Building configuration...
Current configuration : 2011 bytes
!
! Last configuration change at 14:53:29 UTC Mon Apr 17 2023
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R6
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 6.6.6.6 255.255.255.255
!
interface Ethernet0/0
no ip address
shutdown
duplex auto
!
interface GigabitEthernet0/0
ip address 46.1.1.6 255.255.255.0
duplex full
speed 1000
media-type gbic
negotiation auto
mpls ip
!
interface GigabitEthernet1/0
no ip address
shutdown
negotiation auto
!
interface GigabitEthernet2/0
no ip address
shutdown
negotiation auto
!
interface GigabitEthernet3/0
no ip address
shutdown
negotiation auto
!
interface Serial4/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial4/7
no ip address
shutdown
serial restart-delay 0
!
!
router bgp 600
bgp router-id 6.6.6.6
bgp log-neighbor-changes
neighbor 46.1.1.4 remote-as 1234
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
mgcp profile default
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
transport input all
!
!
end