Hi dears,
In this topology, I'm tryin to import the BGP routes onto OSPF with VPN-instance. For this problem I will give you two device configurations in which you will be able to see that there are routes in BGP, but they don't import onto OSPF with the command 'import-route bgp type 2' and without the type.
I saw the Loopback5 from DI_PE_01_CAR that is directly imported to OSPF and not the routes from BGP.
<DI_PE_02_CAR>dis cu
#
sysname DI_PE_02_CAR
#
ip vpn-instance CLARO-01
ipv4-family
route-distinguisher 1:1
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
ip vpn-instance CLARO-02
ipv4-family
route-distinguisher 2:2
vpn-target 2:2 export-extcommunity
vpn-target 2:2 import-extcommunity
#
ip vpn-instance Gb
ipv4-family
route-distinguisher 2.2.2.2:3
vpn-target 3:3 export-extcommunity
vpn-target 3:3 import-extcommunity
#
ip vpn-instance Gi_DNS
ipv4-family
route-distinguisher 2.2.2.2:5
vpn-target 5:5 export-extcommunity
vpn-target 5:5 import-extcommunity
#
ip vpn-instance Gi_blackberry
ipv4-family
route-distinguisher 2.2.2.2:4
vpn-target 4:4 export-extcommunity
vpn-target 4:4 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
#
acl number 2000
rule 1 permit source 1.5.5.0 0.0.0.3
#
isis 1
is-level level-2
network-entity 10.0000.0000.0002.00
is-name DI_PE_02_CAR
import-route ospf 1 route-policy loo1
#
interface Ethernet0/0/0
#
interface Ethernet0/0/0.100
vlan-type dot1q 100
ip binding vpn-instance CLARO-01
ip address 10.2.26.1 255.255.255.252
ospf network-type p2p
#
interface Ethernet0/0/0.200
vlan-type dot1q 200
ip binding vpn-instance CLARO-02
ip address 10.2.26.5 255.255.255.252
ospf network-type p2p
#
interface Ethernet0/0/1
#
interface Ethernet0/0/1.150
vlan-type dot1q 150
ip binding vpn-instance Gb
ip address 1.2.20.1 255.255.255.252
ospf network-type p2p
#
interface Ethernet0/0/1.151
vlan-type dot1q 151
ip binding vpn-instance Gi_blackberry
ip address 1.2.20.5 255.255.255.252
ospf network-type p2p
#
interface Ethernet0/0/1.152
vlan-type dot1q 152
ip binding vpn-instance Gi_DNS
ip address 1.2.20.9 255.255.255.252
ospf network-type p2p
#
interface GigabitEthernet0/0/0
ip address 10.2.6.1 255.255.255.252
isis enable 1
isis circuit-type p2p
isis circuit-level level-2
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 10.2.4.1 255.255.255.252
isis enable 1
isis circuit-type p2p
isis circuit-level level-2
mpls
mpls ldp
#
interface GigabitEthernet0/0/2
ip address 10.2.12.1 255.255.255.252
ospf network-type p2p
mpls
mpls ldp
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/3.10
vlan-type dot1q 10
ip address 10.1.2.2 255.255.255.252
isis enable 1
isis circuit-type p2p
isis circuit-level level-2
mpls
mpls ldp
#
interface GigabitEthernet0/0/3.20
vlan-type dot1q 20
ip address 10.1.2.6 255.255.255.252
ospf network-type p2p
mpls
mpls ldp
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
isis enable 1
isis circuit-level level-2
#
interface LoopBack1
ip address 2.2.3.2 255.255.255.255
#
bgp 19114
peer 1.1.1.1 as-number 65116
peer 1.1.1.1 ebgp-max-hop 10
peer 1.1.1.1 connect-interface LoopBack0
peer 5.5.5.5 as-number 65116
peer 5.5.5.5 ebgp-max-hop 10
peer 5.5.5.5 connect-interface LoopBack0
peer 17.17.17.17 as-number 19114
peer 17.17.17.17 connect-interface LoopBack1
peer 18.18.18.18 as-number 19114
peer 18.18.18.18 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
undo peer 1.1.1.1 enable
undo peer 5.5.5.5 enable
undo peer 17.17.17.17 enable
undo peer 18.18.18.18 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
peer 5.5.5.5 enable
peer 17.17.17.17 enable
peer 18.18.18.18 enable
#
ipv4-family vpn-instance CLARO-01
network 10.2.26.0 255.255.255.252
import-route ospf 130
peer 10.2.26.2 as-number 65000
peer 10.2.26.2 fake-as 65116
#
ipv4-family vpn-instance CLARO-02
network 10.2.26.4 255.255.255.252
import-route ospf 140
peer 10.2.26.6 as-number 65000
peer 10.2.26.6 fake-as 65116
#
ipv4-family vpn-instance Gb
import-route ospf 150 med 1200
#
ipv4-family vpn-instance Gi_DNS
import-route ospf 152 med 1200
#
ipv4-family vpn-instance Gi_blackberry
import-route ospf 151 med 1200
#
ospf 1 router-id 2.2.3.2
import-route isis 1 route-policy loo0
advertise mpls-lsr-id
area 0.0.0.0
network 2.2.3.2 0.0.0.0
network 10.1.2.4 0.0.0.3
network 10.2.12.0 0.0.0.3
#
ospf 130 vpn-instance CLARO-01
area 0.0.0.0
network 10.2.26.0 0.0.0.3
#
ospf 140 vpn-instance CLARO-02
area 0.0.0.0
network 10.2.26.4 0.0.0.3
#
ospf 150 router-id 1.2.20.1 vpn-instance Gb
import-route bgp type 2
area 0.0.0.0
network 1.2.20.0 0.0.0.3
#
ospf 151 router-id 1.2.20.5 vpn-instance Gi_blackberry
import-route bgp type 2
area 0.0.0.0
network 1.2.20.4 0.0.0.3
#
ospf 152 router-id 1.2.20.9 vpn-instance Gi_DNS
import-route bgp type 2
area 0.0.0.0
network 1.2.20.8 0.0.0.3
#
return
<DI_PE_02_CAR>
<DI_PE_02_CAR>dis ip routing-table vpn-instance Gb
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Gb
Destinations : 16 Routes : 16
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/30 O_ASE 150 1 D 1.2.20.2 Ethernet0/0/1.1
50
1.1.19.0/30 OSPF 10 3 D 1.2.20.2 Ethernet0/0/1.1
50
1.2.20.0/30 Direct 0 0 D 1.2.20.1 Ethernet0/0/1.1
50
1.2.20.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/1.1
50
1.3.21.0/30 IBGP 255 1100 RD 8.8.8.8 GigabitEthernet
0/0/2
1.4.22.0/30 IBGP 255 1100 RD 8.8.8.8 GigabitEthernet
0/0/2
1.5.5.0/30 IBGP 255 1100 RD 9.9.9.9 GigabitEthernet
0/0/2
1.5.23.0/30 IBGP 255 1100 RD 9.9.9.9 GigabitEthernet
0/0/2
1.6.24.0/30 IBGP 255 1100 RD 9.9.9.9 GigabitEthernet
0/0/2
1.7.21.0/30 IBGP 255 1100 RD 8.8.8.8 GigabitEthernet
0/0/2
1.8.22.0/30 IBGP 255 1100 RD 8.8.8.8 GigabitEthernet
0/0/2
1.9.23.0/30 IBGP 255 1100 RD 9.9.9.9 GigabitEthernet
0/0/2
1.10.24.0/30 IBGP 255 1100 RD 9.9.9.9 GigabitEthernet
0/0/2
1.19.20.0/30 OSPF 10 2 D 1.2.20.2 Ethernet0/0/1.1
50
1.21.22.0/30 IBGP 255 1100 RD 8.8.8.8 GigabitEthernet
0/0/2
1.23.24.0/30 IBGP 255 1100 RD 9.9.9.9 GigabitEthernet
0/0/2
<DI_PE_02_CAR>
##############################################################################
<SITECAR02>dis cu
#
sysname SITECAR02
#
ip vpn-instance Gb
ipv4-family
route-distinguisher 20.20.20.20:3
vpn-target 3:3 export-extcommunity
vpn-target 3:3 import-extcommunity
#
ip vpn-instance Gi_DNS
ipv4-family
route-distinguisher 20.20.20.20:5
vpn-target 5:5 export-extcommunity
vpn-target 5:5 import-extcommunity
#
ip vpn-instance Gi_blackberry
ipv4-family
route-distinguisher 20.20.20.20:4
vpn-target 4:4 export-extcommunity
vpn-target 4:4 import-extcommunity
#ority 16
#
interface Ethernet0/0/0
#
interface Ethernet0/0/0.150
vlan-type dot1q 150
ip binding vpn-instance Gb
ip address 1.2.20.2 255.255.255.252
ospf network-type p2p
#
interface Ethernet0/0/0.151
vlan-type dot1q 151
ip binding vpn-instance Gi_blackberry
ip address 1.2.20.6 255.255.255.252
ospf network-type p2p
#
interface Ethernet0/0/0.152
vlan-type dot1q 152
ip binding vpn-instance Gi_DNS
ip address 1.2.20.10 255.255.255.252
ospf network-type p2p
#
interface GigabitEthernet0/0/0
#
interface GigabitEthernet0/0/0.150
vlan-type dot1q 150
ip binding vpn-instance Gb
ip address 1.19.20.2 255.255.255.252
ospf network-type p2p
#
interface GigabitEthernet0/0/0.151
vlan-type dot1q 151
ip binding vpn-instance Gi_blackberry
ip address 1.19.20.6 255.255.255.252
ospf network-type p2p
#
interface GigabitEthernet0/0/0.152
vlan-type dot1q 152
ip binding vpn-instance Gi_DNS
ip address 1.19.20.10 255.255.255.252
ospf network-type p2p
#
#
interface LoopBack0
ip address 20.20.20.20 255.255.255.255
#
ospf 150 router-id 1.2.20.2 vpn-instance Gb
area 0.0.0.0
network 1.2.20.0 0.0.0.3
network 1.19.20.0 0.0.0.3
#
ospf 151 router-id 1.2.20.6 vpn-instance Gi_blackberry
area 0.0.0.0
network 1.19.20.4 0.0.0.3
network 1.2.20.4 0.0.0.3
#
ospf 152 router-id 1.2.20.10 vpn-instance Gi_DNS
area 0.0.0.0
network 1.19.20.8 0.0.0.3
network 1.2.20.8 0.0.0.3
#
return
<SITECAR02>dis ip routing-table vpn-instance Gb
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Gb
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/30 O_ASE 150 1 D 1.19.20.1 GigabitEthernet
0/0/0.150
1.1.19.0/30 OSPF 10 2 D 1.19.20.1 GigabitEthernet
0/0/0.150
1.2.20.0/30 Direct 0 0 D 1.2.20.2 Ethernet0/0/0.1
50
1.2.20.2/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0.1
50
1.19.20.0/30 Direct 0 0 D 1.19.20.2 GigabitEthernet
0/0/0.150
1.19.20.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.150
<SITECAR02>

Thanks!