interface Loopback0
ip address 4.4.4.4 255.255.255.0
interface Serial0/0
ip address 24.1.1.4 255.255.255.0
interface Serial0/1
ip address 46.1.1.4 255.255.255.0
router eigrp 100
network 4.4.4.4 0.0.0.0
network 46.1.1.4 0.0.0.0
no auto-summary
!
router bgp 200
no synchronization
bgp log-neighbor-changes
neighbor 5.5.5.5 remote-as 200
neighbor 5.5.5.5 update-source Loopback0
neighbor 5.5.5.5 next-hop-self
neighbor 6.6.6.6 remote-as 200
neighbor 6.6.6.6 update-source Loopback0
neighbor 6.6.6.6 next-hop-self
neighbor 24.1.1.2 remote-as 100
neighbor 24.1.1.2 route-map localprf in
neighbor 24.1.1.2 route-map med out
no auto-summary
access-list 10 permit 1.1.1.0 0.0.0.255
access-list 20 permit 11.1.1.0 0.0.0.255
access-list 30 permit 6.6.6.0 0.0.0.255
access-list 40 permit 66.6.6.0 0.0.0.255
!
route-map localprf permit 10
match ip address 10
set local-preference 600
!
route-map localprf permit 20
match ip address 20
set local-preference 200
!
route-map localprf permit 30
!
route-map med permit 10
match ip address 30
set metric 100
!
route-map med permit 20
match ip address 40
set metric 300
!
route-map med permit 30
R2#show run | s ro
router ospf 100
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
router bgp 100
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 24.1.1.4 remote-as 200