# BGP Prevent Transit AS

**URL:** https://forum.networklessons.com/t/bgp-prevent-transit-as/1026
**Category:** Lessons Discussion
**Created:** [December 26, 2016, 6:20pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026 "2016-12-26T18:20:04Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [December 26, 2016, 6:20pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/1 "2016-12-26T18:20:04Z")

</div>

This topic is to discuss the following lesson:

> **[BGP Prevent Transit AS](https://networklessons.com/bgp/bgp-prevent-transit-as)**
>
> This lesson explains four configuration methods to prevent an autonomous system (AS) from becoming a transit AS.

---

<div class="post-metadata">

### Author: ![gsacher](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/g/73ab20/32.png) [@gsacher](https://forum.networklessons.com/u/gsacher)
#### Post date: [February 8, 2014, 1:57am UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/3 "2014-02-08T01:57:47Z")

</div>

Many thanks for the lesson, it’s very easy to understand!

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [February 8, 2014, 6:43pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/4 "2014-02-08T18:43:50Z")

</div>

What about this method, Rene?

```
access-list 1 permit 1.1.1.0 0.0.0.255

route-map NO-EXPORT permit 10
  match ip address 1

neighbor 192.168.12.2 route-map NO-EXPORT out
neighbor 192.168.13.3 route-map NO-EXPORT out

```

Ofc we can use “match ip address prefix-list” as well. And my deepest respect for all what you do for us all.

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [March 10, 2014, 2:08pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/5 "2014-03-10T14:08:00Z")

</div>

An access-list will work as well, no problem at all 🙂

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [April 6, 2014, 8:48pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/6 "2014-04-06T20:48:34Z")

</div>

Nice!!! It cleared my questions!!! Thanks a ton!!!

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [April 14, 2014, 11:18am UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/7 "2014-04-14T11:18:07Z")

</div>

You are welcome Ulhas.

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [May 21, 2014, 1:56pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/8 "2014-05-21T13:56:57Z")

</div>

Hello Rene,

I have gone through many topics in this website and that cleared my idea as well but I don’t see any note regarding Multiple Spanning-Tree Protocol.  
If you share some labs/note for MSTP will be helpful for me to understand it better.

Thanks a lot.

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [May 22, 2014, 3:31pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/9 "2014-05-22T15:31:18Z")

</div>

Thanks a million Rene!! I really appreciate you sharing your knowledge, this really helped me out a lot.

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [May 23, 2014, 2:05pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/10 "2014-05-23T14:05:44Z")

</div>

You are welcome Marcus!

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [May 23, 2014, 2:49pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/11 "2014-05-23T14:49:03Z")

</div>

Hello Arijit,

I’m glad to hear that you like it. I’ll add some MST material in the future!

Rene

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [July 3, 2014, 4:07pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/12 "2014-07-03T16:07:41Z")

</div>

You have really cleared the air on some difficulties i was having.  
Really self explanatory.  
Thx Renee

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [August 27, 2014, 2:43pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/13 "2014-08-27T14:43:08Z")

</div>

This really helped me 🙂  
Thanks a lot Rene

---

<div class="post-metadata">

### Author: ![mauroaldair](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/m/7feea3/32.png) [@mauroaldair](https://forum.networklessons.com/u/mauroaldair)
#### Post date: [April 30, 2015, 9:45pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/14 "2015-04-30T21:45:18Z")

</div>

Nice and neat, i like it 🙂

---

<div class="post-metadata">

### Author: ![hamoodrehman87](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/h/50afbb/32.png) [@hamoodrehman87](https://forum.networklessons.com/u/hamoodrehman87)
#### Post date: [June 26, 2015, 12:07am UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/15 "2015-06-26T00:07:26Z")

</div>

Rene,

Nice and clear explanation of all the complex BGP terms.  
Great lesson to understand key features of BGP.

Thanks  
Hamood

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [June 26, 2015, 10:33am UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/16 "2015-06-26T10:33:21Z")

</div>

Thanks Hamood

---

<div class="post-metadata">

### Author: ![navn1](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/n/67e7ee/32.png) [@navn1](https://forum.networklessons.com/u/navn1)
#### Post date: [August 9, 2015, 11:31pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/17 "2015-08-09T23:31:04Z")

</div>

Hi,

I would appreciate if you can talk about how to advertise routes toward inside your network.

let say you have r1 and r2 are mutihome. R1 to isp1 and R2 to isp2 (getting bgp full table). Now let say you have R1 and R2 criss cross connected to nexus 7k inbound. I know you can run iBGP but that would be too many routes to your switches. What would be a good solution in this situation?

Thanks,  
Nav

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [August 10, 2015, 7:45pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/18 "2015-08-10T19:45:03Z")

</div>

Hi Nav,

If R1 and R2 are the only exit points for your network then a default route will do the job, no need to run iBGP on all your internal devices.

Rene

---

<div class="post-metadata">

### Author: ![ethel\_13mx](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/e/ce73a5/32.png) [@ethel\_13mx](https://forum.networklessons.com/u/ethel_13mx)
#### Post date: [January 30, 2016, 11:17pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/19 "2016-01-30T23:17:25Z")

</div>

Hello Rene,

Great job as always, it is possible if you publish the routers configurations? I would like to see how you did the configuration, this also helps me clearing the theory.

It’s just a question.

Thank you very much!!

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [February 1, 2016, 11:59am UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/20 "2016-02-01T11:59:03Z")

</div>

Hi Diana,

Do you mean the startup configurations?

In the most recent lessons I have been adding the final configurations, for example:

[MPLS Layer 3 VPN PE CE OSPF](https://networklessons.com/mpls/mpls-layer-3-vpn-pe-ce-ospf/)

Rene

---

<div class="post-metadata">

### Author: ![jmwalker24](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jmwalker24](https://forum.networklessons.com/u/jmwalker24)
#### Post date: [February 14, 2016, 12:54pm UTC](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026/21 "2016-02-14T12:54:45Z")

</div>

Rene – in your example of Filter-list with AS PATH access-list you wrote:

`R1(config)#ip as-path access-list 1 permit ^$`

Is the AS number of R1 suppose to go between the ^ and the $? In your example you didn’t specify an AS # - let’s just say R1 AS # is 4444. Should it look like this?

`R1(config)#ip as-path access-list 1 permit ^4444$`

[Next page](https://forum.networklessons.com/t/bgp-prevent-transit-as/1026.md?page=2)
