# How to limit as that are advertised to one neigbour BGP

**URL:** <https://forum.networklessons.com/t/how-to-limit-as-that-are-advertised-to-one-neigbour-bgp/53553>\
**Category:** BGP\
**Created:** [November 14, 2024, 11:49am UTC](https://forum.networklessons.com/t/how-to-limit-as-that-are-advertised-to-one-neigbour-bgp/53553 "2024-11-14T11:49:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.konieczna](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@m.konieczna](https://forum.networklessons.com/u/m.konieczna)\
**Post date:** [November 14, 2024, 11:49am UTC](https://forum.networklessons.com/t/how-to-limit-as-that-are-advertised-to-one-neigbour-bgp/53553/1 "2024-11-14T11:49:47Z")

</div>

Hi,

In BGP configuration i want to advertise routes with one AS to FW.  
`*> 10.0.0.0/24 10.10.1.1 0 0 0 65001 65101 65111 65150?`  
Do someone know how to do it?

Regards

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [November 16, 2024, 6:10am UTC](https://forum.networklessons.com/t/how-to-limit-as-that-are-advertised-to-one-neigbour-bgp/53553/2 "2024-11-16T06:10:56Z")

</div>

Hello Maja

It depends on exactly what you want to do. Do you want this route to be shared with its neighbors and to have some ASes removed from the AS path so that only one AS will remain? That means that you want to replace the 65001 65101 65111 65150 AS path with something else, correct? If this is the case, it’s not something that is commonly done and it is not quite straightforward. There are ways to do it, but it is difficult for good reason… to allow BGP to remain stable. You can prepend certain AS numbers using a route map and the `set as-path` command, but changing the actual AS path directly is more difficult. IF this is what you want to do, let me know so I can shed some more light on it…

However, it is more likely that you want to advertise only routes that have a single AS in their AS Path, correct? If that is the case, you can use AS path filtering that will only allow particular AS Paths to be advertised, and others not to be advertised. Take a look at this lesson for more information:

> **[BGP AS Path Filter Example](https://networklessons.com/bgp/bgp-as-path-filter-example)**
>
> This lesson explains how to use regular expressions and to create AS PATH access-list filters on Cisco IOS Routers.

One last thing. Because your ASes are private ASes in the range of 64512 to 65534, you can use the Remove Private AS Numbers feature to have them all removed. Then you could add whatever AS numbers you like using the AS path prepending feature. This resolves your particular scenario, but would not work if your ASes were public. For more info about the remove private AS feature, take a look at:

> **[BGP Remove Private AS](https://networklessons.com/bgp/bgp-remove-private-as)**
>
> This lesson explains how to remove the BGP private AS numbers from the AS path when you advertise something to your BPG neighbors.

I hope this has been helpful!

Laz
