cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1579
Views
15
Helpful
12
Replies

BGP Route advertisement

MEDIAOS
Level 1
Level 1

IMG_5546.jpgSee attached diagram for details.

 

I want R2 to advertise only “10.100.254.1/32” to R3 using a route-map.

How do I do this?

 

 

R1/R2 are running OSPF

R2/R3 are running eBGP

44/r2 are running eBGP

 

=== R2 Config ===

 

interface Loopback0

ip address 10.100.1.1 255.255.255.255

 

router ospf 100

log-adjacency-changes

redistribute bgp 2 subnets

network 10.0.0.0 0.255.255.255 area 0

 

router bgp 2

no synchronization

bgp log-neighbor-changes

network 10.100.1.1 mask 255.255.255.255

network 68.0.0.0 mask 255.255.255.0

network 70.0.0.0 mask 255.255.255.0

aggregate-address 10.100.0.0 255.255.0.0 summary-only

neighbor 68.0.0.3 remote-as 3

neighbor 68.0.0.3 soft-reconfiguration inbound

neighbor 70.0.0.4 remote-as 4

neighbor 70.0.0.4 soft-reconfiguration inbound

no auto-summary

 

R2#sh ip bgp neighbors 68.0.0.3 advertised-routes

BGP table version is 12, local router ID is 10.100.1.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

*> 3.3.3.3/32       68.0.0.3                 0             0 3 i

*> 10.0.0.0         70.0.0.4                 0             0 4 i

*> 10.100.0.0/16    0.0.0.0                            32768 i

*> 68.0.0.0/24      0.0.0.0                  0         32768 i

*> 70.0.0.0/24      0.0.0.0                  0         32768 i

*> 172.16.0.0       70.0.0.4                 0             0 4 i

*> 192.168.0.0/16   70.0.0.4                 0             0 4 i

 

Total number of prefixes 7

 

 

 

R2#sh ip bgp

BGP table version is 12, local router ID is 10.100.1.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

*> 3.3.3.3/32       68.0.0.3                 0             0 3 i

*> 10.0.0.0         70.0.0.4                 0             0 4 i

*> 10.100.0.0/16    0.0.0.0                            32768 i

s> 10.100.1.1/32    0.0.0.0                  0         32768 i

*> 68.0.0.0/24      0.0.0.0                  0         32768 i

*> 70.0.0.0/24      0.0.0.0                  0         32768 i

*                   70.0.0.4                 0             0 4 i

*> 172.16.0.0       70.0.0.4                 0             0 4 i

*> 192.168.0.0/16   70.0.0.4                 0             0 4 i

 

 

 

 

 

=== R1 Config ===

 

interface Loopback0

ip address 10.100.254.1 255.255.255.255

 

router ospf 100

log-adjacency-changes

network 10.0.0.0 0.255.255.255 area 0

 

R1#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     68.0.0.0/24 is subnetted, 1 subnets

O E2    68.0.0.0 [110/1] via 10.100.100.2, 02:14:18, FastEthernet0/0

     70.0.0.0/24 is subnetted, 1 subnets

O E2    70.0.0.0 [110/1] via 10.100.100.2, 02:14:18, FastEthernet0/0

     3.0.0.0/32 is subnetted, 1 subnets

O E2    3.3.3.3 [110/1] via 10.100.100.2, 00:01:48, FastEthernet0/0

O E2 172.16.0.0/16 [110/1] via 10.100.100.2, 00:01:48, FastEthernet0/0

     10.0.0.0/8 is variably subnetted, 5 subnets, 4 masks

O E2    10.0.0.0/8 [110/1] via 10.100.100.2, 00:01:49, FastEthernet0/0

C       10.100.254.1/32 is directly connected, Loopback0

O       10.100.1.1/32 [110/11] via 10.100.100.2, 03:34:20, FastEthernet0/0

O E2    10.100.0.0/16 [110/1] via 10.100.100.2, 00:01:44, FastEthernet0/0

C       10.100.100.0/24 is directly connected, FastEthernet0/0

O E2 192.168.0.0/16 [110/1] via 10.100.100.2, 00:01:50, FastEthernet0/0

 

=== R4 Config ====

 

R4#sh run | sec router bgp

router bgp 4

no synchronization

bgp log-neighbor-changes

network 10.10.10.4 mask 255.255.255.255

network 70.0.0.0 mask 255.255.255.0

network 172.16.100.4 mask 255.255.255.255

network 192.168.0.0 mask 255.255.0.0

network 192.168.100.4 mask 255.255.255.255

aggregate-address 10.0.0.0 255.0.0.0 summary-only

aggregate-address 172.16.0.0 255.255.0.0 summary-only

aggregate-address 192.168.0.0 255.255.0.0 summary-only

neighbor 70.0.0.2 remote-as 2

no auto-summary

 

12 Replies 12

router bgp 2

no synchronization

bgp log-neighbor-changes

network 10.100.1.1 mask 255.255.255.255

network 68.0.0.0 mask 255.255.255.0<- this wrong * 

network 70.0.0.0 mask 255.255.255.0<- this wrong *

aggregate-address 10.100.0.0 255.255.0.0 summary-only

neighbor 68.0.0.3 remote-as 3

neighbor 68.0.0.3 soft-reconfiguration inbound

neighbor 70.0.0.4 remote-as 4

neighbor 70.0.0.4 soft-reconfiguration inbound

no auto-summary

wrong since these NET is connect two BGP peer then network will unstable because it learn net connect two BGP through BGP, remove this 

for commend you need for advertise 
route-map OUT permit 10
match ip add 10
!
ip access-list 10 
permit ip host 10.100.254.1
!
router bgp 2
neighbor R3 route-map OUT out 

It did not work - See config and output below:

 

==== BEFORE I HAD THE CONFIG ===

 

R2#sh ip bgp neighbors 68.0.0.3 advertised-routes

BGP table version is 12, local router ID is 10.100.1.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

*> 3.3.3.3/32       68.0.0.3                 0             0 3 i

*> 10.0.0.0         70.0.0.4                 0             0 4 i

*> 10.100.0.0/16    0.0.0.0                            32768 i

*> 68.0.0.0/24      0.0.0.0                  0         32768 i

*> 70.0.0.0/24      0.0.0.0                  0         32768 i

*> 172.16.0.0       70.0.0.4                 0             0 4 i

*> 192.168.0.0/16   70.0.0.4                 0             0 4 i

 

Total number of prefixes 7

 

==== AFTER I ADD THE CONFIG =====

 

R2#sh ip bgp neighbors 68.0.0.3 advertised-routes

 

Total number of prefixes 0

 

 

==== CONFIG ADDED ====

 

R2#sh run | sec router bgp

router bgp 2

no synchronization

bgp log-neighbor-changes

network 10.100.1.1 mask 255.255.255.255

aggregate-address 10.100.0.0 255.255.0.0 summary-only

redistribute ospf 100

neighbor 68.0.0.3 remote-as 3

neighbor 68.0.0.3 soft-reconfiguration inbound

neighbor 68.0.0.3 route-map OUT out

neighbor 70.0.0.4 remote-as 4

neighbor 70.0.0.4 soft-reconfiguration inbound

no auto-summary

 

access-list 10 permit 10.100.254.1

!         

route-map OUT permit 10

match ip address 10

10.100.254.1/32 or 10.100.1.1/32??

I dont see 10.100.254.1/32 connect or learn in R2 so how R2 advertise non connect non learn via other routing protocol prefix to R3.

If you want add static route to null0 then use under bgp network command and finally use same command it previously mention.

10.100.254.1/32  is learned from R1 via OSPF.

OK learn from OSPF then you need under BGP R2 
redistribute ospf x subnet 

this make R2 redistribute the prefix from OSPF into BGP 
then the route-map will filter prefix and only 10.100.254.1/32  will advertise.

Harold Ritter
Spotlight
Spotlight

Hi @MEDIAOS ,

 

You need to add an extra network statement for 10.100.254.1/32 under BGP in R2, but you also need to remove the aggregate-address statement if you want the more specific routes to be advertised to R3.

 

router bgp 2

network 10.100.254.1 mask 255.255.255.255

no aggregate-address 10.100.0.0 255.255.0.0 summary-only

 

Regards,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)

paul.driver
Level 1
Level 1

Hello


@MEDIAOS wrote:

I want R2 to advertise only “10.100.254.1/32” to R3 using a route-map.


R2
Remove all aggregates AND soft-reconfiguration inbound from the bgp stanza and then you could add the following

route-map LOOPBACK
match interface loopback 0

router bgp 2
redistributed connected route-map LOOPBACK 

Hello

@MEDIAOS wrote:

I want R2 to advertise only “10.100.254.1/32” to R3 using a route-map.

R2
Remove all aggregates AND soft-reconfiguration inbound from the bgp stanza and then you could add the following

route-map LOOPBACK
match interface loopback 0

router bgp 2
redistributed connected route-map LOOPBACK 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

emurray
Level 1
Level 1

On R2

 

router bgp 65511
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 neighbor 68.0.0.2 remote-as 65509
 neighbor 70.0.0.2 remote-as 65510
 !
 address-family ipv4
  redistribute ospf 1
  neighbor 68.0.0.2 activate
  neighbor 68.0.0.2 route-map ToR3 out
  neighbor 70.0.0.2 activate
 exit-address-family
!

ip prefix-list FILTERTOR3 seq 5 permit 10.100.254.1/32
ip prefix-list FILTERTOR3 seq 10 deny 0.0.0.0/0 le 32
ipv6 ioam timestamp
!
route-map ToR3 permit 10
 match ip address prefix-list FILTERTOR3

On R3

 

Screenshot 2022-06-07 192443.jpg

Redistrubte opsf do the job,

Great man.

Hello
I see the host prefix originates from R1 so my original suggestion would not work- but i see you have advertised it with a prefix-list and route-map- so all good!


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

emurray
Level 1
Level 1

Did you test my proposed solution?