In the following topology I have a multi-point redistribution from BGP <-> OSPF and I have recently encountered a routing loop.
After further reading I have understood the problematic routers were ISP-2 and ISP-3 and that I need to tag the routes and deny as needed so the loop won't occur, however, after trying it out I understood BGP does not support tags (% "OSPF_TO_BGP" used as redistribute ospf into bgp route-map, set tag not supported
).
Looking into the topic I was told I could achieve the same thing with BGP communities but I have no clue as to how I should implement this.
I'll appreciate any help.
NOTE: Images, traces and configurations added below
RB-5#trace 10.1.22.2
Type escape sequence to abort.
Tracing the route to 10.1.22.2
VRF info: (vrf in name/id, vrf out name/id)
1 172.16.52.2 11 msec 9 msec 6 msec
2 172.16.65.1 [AS 65200] 9 msec 13 msec 7 msec
3 10.1.11.2 [AS 65200] 9 msec 21 msec 20 msec
4 10.1.31.1 [AS 65200] 29 msec 18 msec 15 msec
5 10.0.32.2 [AS 65200] 17 msec 20 msec 10 msec
6 10.0.42.1 [AS 65200] 18 msec 25 msec 13 msec
7 172.16.34.2 [AS 65100] 21 msec 32 msec 18 msec
8 172.16.32.2 [AS 65100] 13 msec 12 msec 14 msec
9 172.16.65.1 [AS 65200] 15 msec 31 msec 16 msec
10 10.1.11.2 [AS 65200] 15 msec 18 msec 16 msec
11 10.1.31.1 [AS 65200] 18 msec 28 msec 24 msec
12 10.0.32.2 [AS 65200] 22 msec 24 msec 13 msec
13 10.0.42.1 [AS 65200] 22 msec 24 msec 22 msec
14 172.16.34.2 [AS 65100] 34 msec 22 msec 16 msec
15 172.16.32.2 [AS 65100] 20 msec 18 msec 17 msec
16 172.16.65.1 [AS 65200] 41 msec 33 msec 26 msec
17 10.1.11.2 [AS 65200] 20 msec 25 msec 28 msec
18 10.1.31.1 [AS 65200] 31 msec 34 msec 28 msec
19 10.0.32.2 [AS 65200] 21 msec 32 msec 24 msec
20 10.0.42.1 [AS 65200] 26 msec 30 msec 31 msec
21 172.16.34.2 [AS 65100] 37 msec 45 msec 44 msec
22 172.16.32.2 [AS 65100] 12 msec 29 msec 36 msec
23 172.16.65.1 [AS 65200] 24 msec 38 msec 33 msec
24 10.1.11.2 [AS 65200] 31 msec 34 msec 32 msec
25 10.1.31.1 [AS 65200] 68 msec 59 msec 63 msec
26 10.0.32.2 [AS 65200] 42 msec 45 msec 35 msec
27 10.0.42.1 [AS 65200] 28 msec 51 msec 30 msec
28 172.16.34.2 [AS 65100] 45 msec 32 msec 48 msec
29 172.16.32.2 [AS 65100] 41 msec 37 msec 41 msec
30 172.16.65.1 [AS 65200] 39 msec 47 msec 39 msec
ISP-2 Config:
ISP-2(config)#do show run
Building configuration...
Current configuration : 2854 bytes
!
! Last configuration change at 08:07:38 UTC Thu Jul 29 2021
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname ISP-2
!
boot-start-marker
boot-end-marker
!
!
logging discriminator EXCESS severity drops 6 msg-body drops EXCESSCOLL
logging buffered 50000
logging console discriminator EXCESS
!
no aaa new-model
!
!
!
!
!
no ip icmp rate-limit unreachable
!
!
!
no ip domain-lookup
ip cef
no ipv6 cef
!
!
!
spanning-tree mode rapid-pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
no switchport
ip address 172.16.12.2 255.255.255.252
duplex auto
!
interface Ethernet0/1
no switchport
ip address 172.16.52.2 255.255.255.252
duplex auto
!
interface Ethernet0/2
no switchport
ip address 172.16.32.2 255.255.255.252
duplex auto
!
interface Ethernet0/3
no switchport
ip address 172.16.210.1 255.255.255.252
duplex auto
!
interface Ethernet1/0
shutdown
!
interface Ethernet1/1
shutdown
!
interface Ethernet1/2
shutdown
!
interface Ethernet1/3
shutdown
!
interface Ethernet2/0
shutdown
!
interface Ethernet2/1
shutdown
!
interface Ethernet2/2
shutdown
!
interface Ethernet2/3
shutdown
!
interface Ethernet3/0
shutdown
!
interface Ethernet3/1
shutdown
!
interface Ethernet3/2
shutdown
!
interface Ethernet3/3
no switchport
ip address 172.16.65.2 255.255.255.252
duplex auto
!
interface Vlan1
no ip address
shutdown
!
router ospf 101
redistribute bgp 65200 metric 1 metric-type 1 subnets route-map BGP_TO_OSPF
network 172.16.65.0 0.0.0.3 area 1
!
router bgp 65200
bgp router-id 2.0.0.2
bgp log-neighbor-changes
neighbor 172.16.12.1 remote-as 15000
neighbor 172.16.32.1 remote-as 65100
neighbor 172.16.52.1 remote-as 25000
neighbor 172.16.210.2 remote-as 65300
!
address-family ipv4
network 172.16.12.0 mask 255.255.255.252
network 172.16.32.0 mask 255.255.255.252
network 172.16.52.0 mask 255.255.255.252
network 172.16.65.0 mask 255.255.255.252
network 172.16.210.0 mask 255.255.255.252
redistribute ospf 101 match internal external 1 external 2 route-map OSPF_TO_BGP
neighbor 172.16.12.1 activate
neighbor 172.16.32.1 activate
neighbor 172.16.52.1 activate
neighbor 172.16.210.2 activate
exit-address-family
!
ip forward-protocol nd
!
ip bgp-community new-format
!
no ip http server
no ip http secure-server
!
!
!
route-map BGP_TO_OSPF deny 10
match tag 111
!
route-map BGP_TO_OSPF permit 20
set tag 222
!
route-map OSPF_TO_BGP deny 10
match tag 222
!
route-map OSPF_TO_BGP permit 20
set tag 111
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end