BGP as prepend for specific host

Answered Question
Aug 26th, 2009

I have network that I am sending route about to my BGP peer. Is it possible to have route for one IP to have as path prepended. For example how can I get my peer to see this

- path for my network is AS 5

- but path for one host from my network is 5 5

I have this problem too.
0 votes
Correct Answer by milan.kulik about 4 years 7 months ago

Hi,

let's say you've got 10.10.10.0/24 connected to your router interface fa0 and you want to advertise your host 10.10.10.100 with as-prepend 5 to your BGP neighbor x.x.x.x.

So to fulfil the task 1), you might try to add

ip route 10.10.10.100 255.255.255.255 fa0

to your config.

This should bring the host route to your routing table.

To finish your config, you can add

router bgp 5

network 10.10.10.100 mask 255.255.255.255

neighbor x.x.x.x route-map advertise-to-xxxx out

ip prefix-list my-host seq 5 permit 10.10.10.100/32

route-map advertise-to-xxxx permit 10

match ip address prefix-list my-host

set as-path prepend 5

route-map advertise-to-xxxx permit 20

I hope this should work.

BR,

Milan

  • 1
  • 2
  • 3
  • 4
  • 5
Average Rating: 5 (1 ratings)
milan.kulik Wed, 08/26/2009 - 03:25

Hi,

you would need to

1) get the host route to your routing table (configure a static route to your host, e.g.)

2) advertise this host route to your BGP peer with as-prepend (by a route-map, e.g.)

But some peers are filtering the length of BGP prefixes received - permitting /24 or /19 as the maximum prefix length, e.g.

BR,

Milan

draganskundric Wed, 08/26/2009 - 03:43

well .... this subnet is directly connected to this router and I am NATing some internal private IP hosts to this subnet, so how can I do what you ae proposing in 1)?

2) what is the default BGP seting for this? I am testing this in LAB and it is not working

Correct Answer
milan.kulik Wed, 08/26/2009 - 11:49

Hi,

let's say you've got 10.10.10.0/24 connected to your router interface fa0 and you want to advertise your host 10.10.10.100 with as-prepend 5 to your BGP neighbor x.x.x.x.

So to fulfil the task 1), you might try to add

ip route 10.10.10.100 255.255.255.255 fa0

to your config.

This should bring the host route to your routing table.

To finish your config, you can add

router bgp 5

network 10.10.10.100 mask 255.255.255.255

neighbor x.x.x.x route-map advertise-to-xxxx out

ip prefix-list my-host seq 5 permit 10.10.10.100/32

route-map advertise-to-xxxx permit 10

match ip address prefix-list my-host

set as-path prepend 5

route-map advertise-to-xxxx permit 20

I hope this should work.

BR,

Milan

draganskundric Thu, 08/27/2009 - 01:37

ok, this static route helps and especially this route-map advertise-to-xxxx permit 20 entry :-)))

thanks for the help and have a nice day

Actions

Login or Register to take actions

This Discussion

Posted August 26, 2009 at 2:24 AM
Stats:
Replies:4 Avg. Rating:5
Views:732 Votes:0
Shares:0
Tags: No tags.

Discussions Leaderboard