R1 --- hostname R1 interface Loopback0 ip address 1.1.1.1 255.255.255.255 ip ospf 1 area 1 ! interface FastEthernet0/0 description R2 Fa0/0 ip address 10.1.12.1 255.255.255.0 ip ospf 1 area 1 !
R2 --- hostname R2 ip vrf A rd 1:1 route-target export 1:1 route-target import 1:1 interface Loopback0 ip address 2.2.2.2 255.255.255.255 ip ospf 1 area 0 ! interface FastEthernet0/0 description R1 Fa0/0 ip vrf forwarding A ip address 10.1.12.2 255.255.255.0 ip ospf 2 area 1 speed 100 full-duplex ! interface FastEthernet0/1 description R3 Fa0/1 ip address 10.1.23.2 255.255.255.0 ip ospf 1 area 0 mpls ip ! interface Loopback23 description SHAMLink Interface ip vrf forwarding A ip address 23.23.23.2 255.255.255.255 ! router ospf 2 vrf A log-adjacency-changes redistribute bgp 23 subnets ! router ospf 1 log-adjacency-changes ! router ospf 2 vrf A log-adjacency-changes area 1 sham-link 23.23.23.2 23.23.23.3 redistribute bgp 23 subnets ! router bgp 23 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor 3.3.3.3 remote-as 23 neighbor 3.3.3.3 update-source Loopback0 ! address-family vpnv4 neighbor 3.3.3.3 activate neighbor 3.3.3.3 send-community extended exit-address-family ! address-family ipv4 vrf A redistribute ospf 2 vrf A no synchronization network 23.23.23.2 mask 255.255.255.255 exit-address-family !
R3 --- hostname R3 ip vrf A rd 1:1 route-target export 1:1 route-target import 1:1 interface Loopback0 ip address 3.3.3.3 255.255.255.255 ip ospf 1 area 0 ! interface FastEthernet0/0 description R4 Fa0/0 ip vrf forwarding A ip address 10.1.34.3 255.255.255.0 ip ospf 3 area 1 speed 100 full-duplex ! interface FastEthernet0/1 description R2 Fa0/1 ip address 10.1.23.3 255.255.255.0 ip ospf 1 area 0 mpls ip ! interface Loopback23 description SHAMLink Interface ip vrf forwarding A ip address 23.23.23.3 255.255.255.255 ! router ospf 1 log-adjacency-changes ! router ospf 3 vrf A log-adjacency-changes area 1 sham-link 23.23.23.3 23.23.23.2 redistribute bgp 23 subnets ! router bgp 23 no bgp default ipv4-unicast bgp log-neighbor-changes neighbor 2.2.2.2 remote-as 23 neighbor 2.2.2.2 update-source Loopback0 ! address-family vpnv4 neighbor 2.2.2.2 activate neighbor 2.2.2.2 send-community extended exit-address-family ! address-family ipv4 vrf A redistribute ospf 3 vrf A no synchronization network 23.23.23.3 mask 255.255.255.255 exit-address-family !
R4 --- hostname R4 interface Loopback0 ip address 4.4.4.4 255.255.255.255 ip ospf 1 area 1 ! interface FastEthernet0/0 description R3 Fa0/0 ip address 10.1.34.4 255.255.255.0 ip ospf 1 area 1 !
R1>sh ip route | b Gateway Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 4.0.0.0/32 is subnetted, 1 subnets O 4.4.4.4 [110/4] via 10.1.12.2, 00:00:39, FastEthernet0/0 23.0.0.0/32 is subnetted, 2 subnets O E2 23.23.23.3 [110/1] via 10.1.12.2, 00:02:55, FastEthernet0/0 O E2 23.23.23.2 [110/1] via 10.1.12.2, 00:03:54, FastEthernet0/0 10.0.0.0/24 is subnetted, 2 subnets C 10.1.12.0 is directly connected, FastEthernet0/0 O 10.1.34.0 [110/3] via 10.1.12.2, 00:00:39, FastEthernet0/0
R4>sh ip route | b Gateway Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets O 1.1.1.1 [110/4] via 10.1.34.3, 00:00:49, FastEthernet0/0 4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4 is directly connected, Loopback0 23.0.0.0/32 is subnetted, 2 subnets O E2 23.23.23.3 [110/1] via 10.1.34.3, 00:03:06, FastEthernet0/0 O E2 23.23.23.2 [110/1] via 10.1.34.3, 00:04:01, FastEthernet0/0 10.0.0.0/24 is subnetted, 2 subnets O 10.1.12.0 [110/3] via 10.1.34.3, 00:00:49, FastEthernet0/0 C 10.1.34.0 is directly connected, FastEthernet0/0
The E2 routes appear because they are the loopbacks used for the shamlinks and a redistributed from BGP into OSPF - you could remove them from appearing to the CEs by using a route-map when doing the redistribution
Comments
Yes they can
Here's a relatively simple test I just did using this topology
R1(CE)===R2(PE)===R3(PE)===R4(PE)
R3#sh ver | i IOS
Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version 12.4(15)T14, RELEASE SOFTWARE (fc2)
R1
---
hostname R1
interface Loopback0
ip address 1.1.1.1 255.255.255.255
ip ospf 1 area 1
!
interface FastEthernet0/0
description R2 Fa0/0
ip address 10.1.12.1 255.255.255.0
ip ospf 1 area 1
!
R2
---
hostname R2
ip vrf A
rd 1:1
route-target export 1:1
route-target import 1:1
interface Loopback0
ip address 2.2.2.2 255.255.255.255
ip ospf 1 area 0
!
interface FastEthernet0/0
description R1 Fa0/0
ip vrf forwarding A
ip address 10.1.12.2 255.255.255.0
ip ospf 2 area 1
speed 100
full-duplex
!
interface FastEthernet0/1
description R3 Fa0/1
ip address 10.1.23.2 255.255.255.0
ip ospf 1 area 0
mpls ip
!
interface Loopback23
description SHAMLink Interface
ip vrf forwarding A
ip address 23.23.23.2 255.255.255.255
!
router ospf 2 vrf A
log-adjacency-changes
redistribute bgp 23 subnets
!
router ospf 1
log-adjacency-changes
!
router ospf 2 vrf A
log-adjacency-changes
area 1 sham-link 23.23.23.2 23.23.23.3
redistribute bgp 23 subnets
!
router bgp 23
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 23
neighbor 3.3.3.3 update-source Loopback0
!
address-family vpnv4
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 send-community extended
exit-address-family
!
address-family ipv4 vrf A
redistribute ospf 2 vrf A
no synchronization
network 23.23.23.2 mask 255.255.255.255
exit-address-family
!
R3
---
hostname R3
ip vrf A
rd 1:1
route-target export 1:1
route-target import 1:1
interface Loopback0
ip address 3.3.3.3 255.255.255.255
ip ospf 1 area 0
!
interface FastEthernet0/0
description R4 Fa0/0
ip vrf forwarding A
ip address 10.1.34.3 255.255.255.0
ip ospf 3 area 1
speed 100
full-duplex
!
interface FastEthernet0/1
description R2 Fa0/1
ip address 10.1.23.3 255.255.255.0
ip ospf 1 area 0
mpls ip
!
interface Loopback23
description SHAMLink Interface
ip vrf forwarding A
ip address 23.23.23.3 255.255.255.255
!
router ospf 1
log-adjacency-changes
!
router ospf 3 vrf A
log-adjacency-changes
area 1 sham-link 23.23.23.3 23.23.23.2
redistribute bgp 23 subnets
!
router bgp 23
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 23
neighbor 2.2.2.2 update-source Loopback0
!
address-family vpnv4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
exit-address-family
!
address-family ipv4 vrf A
redistribute ospf 3 vrf A
no synchronization
network 23.23.23.3 mask 255.255.255.255
exit-address-family
!
R4
---
hostname R4
interface Loopback0
ip address 4.4.4.4 255.255.255.255
ip ospf 1 area 1
!
interface FastEthernet0/0
description R3 Fa0/0
ip address 10.1.34.4 255.255.255.0
ip ospf 1 area 1
!
R1>sh ip route | b Gateway
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/4] via 10.1.12.2, 00:00:39, FastEthernet0/0
23.0.0.0/32 is subnetted, 2 subnets
O E2 23.23.23.3 [110/1] via 10.1.12.2, 00:02:55, FastEthernet0/0
O E2 23.23.23.2 [110/1] via 10.1.12.2, 00:03:54, FastEthernet0/0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.12.0 is directly connected, FastEthernet0/0
O 10.1.34.0 [110/3] via 10.1.12.2, 00:00:39, FastEthernet0/0
R4>sh ip route | b Gateway
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/4] via 10.1.34.3, 00:00:49, FastEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
23.0.0.0/32 is subnetted, 2 subnets
O E2 23.23.23.3 [110/1] via 10.1.34.3, 00:03:06, FastEthernet0/0
O E2 23.23.23.2 [110/1] via 10.1.34.3, 00:04:01, FastEthernet0/0
10.0.0.0/24 is subnetted, 2 subnets
O 10.1.12.0 [110/3] via 10.1.34.3, 00:00:49, FastEthernet0/0
C 10.1.34.0 is directly connected, FastEthernet0/0
The E2 routes appear because they are the loopbacks used for the shamlinks and a redistributed from BGP into OSPF - you could remove them from appearing to the CEs by using a route-map when doing the redistribution