cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2075
Views
10
Helpful
3
Replies
Eric Brander
Beginner

Redistribute only routes learned from specific BGP neighbor into OSPF (Nexus)

I want all BGP learned routes from a specific neighbor to be redistributed into OSPF. I do not want to pick the specific routes, I trust this neighbor, so I want all of what it advertises. Can a route-map specify all routes learned from a specific neighbor? I do not want any other BGP learned routes redistributed into OSPF.

TIA,

Eric

2 ACCEPTED SOLUTIONS

Accepted Solutions
Akash Agrawal
Cisco Employee

Hi,

 

I have not tried it but you can check if we can match community through route-map while redistributing BGP routes into OSPF. If it works you can set particular community on all routes, received from the trusted neighbor.

 

Regards,

Akash

View solution in original post

Sunil Bhadauria
Beginner

Yes , You can set community to all the ebgp routes being received by concerned neighbor using one route-map and then use this community to match desired prefixes under another route-map , this second route-map then further can be used while redistributing in OSPF .

 

Regards

Sunil Bhadauria

View solution in original post

3 REPLIES 3
Akash Agrawal
Cisco Employee

Hi,

 

I have not tried it but you can check if we can match community through route-map while redistributing BGP routes into OSPF. If it works you can set particular community on all routes, received from the trusted neighbor.

 

Regards,

Akash

 

Hello There

i was also looking for suggestions on the similar concept. I was trying to choose prefixes from only one neighbor and redist them to EIGRP.

I could successfully simulate that and it is just working as i need.

note:  Naming convention used here according to my convenience. 

 

Config:

ISP Router:

--------------


Building configuration...

Current configuration : 1725 bytes
!
upgrade fpd auto
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ISP
!
boot-start-marker
boot-end-marker
!
logging message-counter syslog
!
no aaa new-model
ip source-route
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
no ipv6 cef
!
multilink bundle-name authenticated
!
archive
 log config
  hidekeys

ip tcp synwait-time 5
!
interface Loopback100
 ip address 100.100.100.1 255.255.255.0
!
interface Loopback200
 ip address 200.200.200.1 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface GigabitEthernet1/0
 ip address 10.10.10.1 255.255.255.252
 negotiation auto
!
interface GigabitEthernet2/0
 ip address 20.20.20.1 255.255.255.252
 negotiation auto
!
router bgp 5678
 no synchronization
 bgp log-neighbor-changes
 network 100.100.100.0 mask 255.255.255.0
 network 200.200.200.0
 neighbor 10.10.10.2 remote-as 1234
 neighbor 10.10.10.2 route-map gi1/0 out
 neighbor 20.20.20.2 remote-as 1234
 neighbor 20.20.20.2 route-map gi2/0 out
 no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip prefix-list gi1/0 seq 5 permit 100.100.100.0/24 le 32
!
ip prefix-list gi2/0 seq 5 permit 200.200.200.0/24 le 32
!
route-map gi1/0 permit 10
 match ip address prefix-list gi1/0
!
route-map gi2/0 permit 10
 match ip address prefix-list gi2/0
!
control-plane
!
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
!
end

 

Edge-Switch-R1

------------------------


!
upgrade fpd auto
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Edge-Switch
!
boot-start-marker
boot-end-marker
!
logging message-counter syslog
no logging console
!
no aaa new-model
ip source-route
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
no ipv6 cef
!
multilink bundle-name authenticated
!
archive
 log config
  hidekeys

ip tcp synwait-time 5
!
interface FastEthernet0/0
 ip address 192.168.18.1 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface GigabitEthernet1/0
 ip address 10.10.10.2 255.255.255.252
 negotiation auto
!
interface GigabitEthernet2/0
 ip address 20.20.20.2 255.255.255.252
 negotiation auto
!
router eigrp 100
 redistribute bgp 1234 metric 100000 10000 255 255 1500 route-map bgp->eigrp
 network 192.168.18.0 0.0.0.3
 no auto-summary
!
router bgp 1234
 no synchronization
 bgp log-neighbor-changes
 redistribute eigrp 100
 neighbor 10.10.10.1 remote-as 5678
 neighbor 10.10.10.1 route-map community in
 neighbor 20.20.20.1 remote-as 5678
 no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 10:20
!
route-map bgp->eigrp permit 20
 match community 1 exact-match
!
route-map eigrp->bgp permit 20
!
route-map community permit 10
 set community 10:20
!
control-plane
!
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
!
end

 

INT-ASA (just the name, not really the ASA)

==========


version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname int-asa
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
!
!
ip cef
no ip domain lookup
!
ip tcp synwait-time 5

interface Loopback1
 ip address 111.111.111.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 192.168.18.2 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
!
router eigrp 100
 network 111.111.111.0 0.0.0.255
 network 192.168.18.0 0.0.0.3
 no auto-summary
!
no ip http server
no ip http secure-server
ip forward-protocol nd
!
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

 

Route table o/p from all the routers:

----------------

Edge-Switch#sh ip bgp
BGP table version is 7, local router ID is 192.168.18.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 100.100.100.0/24 10.10.10.1               0             0 5678 i
*> 111.111.111.0/24 192.168.18.2        156160         32768 ?
*> 192.168.18.0/30  0.0.0.0                  0         32768 ?
*> 200.200.200.0    20.20.20.1               0             0 5678 i

 

Gateway of last resort is not set

B    200.200.200.0/24 [20/0] via 20.20.20.1, 00:15:40
     100.0.0.0/24 is subnetted, 1 subnets
B       100.100.100.0 [20/0] via 10.10.10.1, 00:15:57
     20.0.0.0/30 is subnetted, 1 subnets
C       20.20.20.0 is directly connected, GigabitEthernet2/0
     111.0.0.0/24 is subnetted, 1 subnets
D       111.111.111.0 [90/156160] via 192.168.18.2, 00:16:20, FastEthernet0/0
     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, GigabitEthernet1/0
     192.168.18.0/30 is subnetted, 1 subnets
C       192.168.18.0 is directly connected, FastEthernet0/0

 

ISP#sh ip bgp
BGP table version is 7, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 100.100.100.0/24 0.0.0.0                  0         32768 i
*  111.111.111.0/24 20.20.20.2          156160             0 1234 ?
*>                  10.10.10.2          156160             0 1234 ?
*  192.168.18.0/30  20.20.20.2               0             0 1234 ?
*>                  10.10.10.2               0             0 1234 ?
*> 200.200.200.0    0.0.0.0                  0         32768 i

 

 

int-asa#sh ip route
 

Gateway of last resort is not set

     100.0.0.0/24 is subnetted, 1 subnets
D EX    100.100.100.0
           [170/2588160] via 192.168.18.1, 00:15:50, FastEthernet0/0
     111.0.0.0/24 is subnetted, 1 subnets

C       111.111.111.0 is directly connected, Loopback1
     192.168.18.0/30 is subnetted, 1 subnets
C       192.168.18.0 is directly connected, FastEthernet0/0

Sunil Bhadauria
Beginner

Yes , You can set community to all the ebgp routes being received by concerned neighbor using one route-map and then use this community to match desired prefixes under another route-map , this second route-map then further can be used while redistributing in OSPF .

 

Regards

Sunil Bhadauria