cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3307
Views
5
Helpful
4
Replies

BGP as prepend for specific host

draganskundric
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

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

View solution in original post

4 Replies 4

milan.kulik
Level 10
Level 10

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

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

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

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card