Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Basic Question about BGP AS Path Prepending

Below is the config I have setup in my lab and it works great with allowing me to influence which path inbound traffic takes to my network.  The only question I have is this.....  

 

I am prepending the AS with "1 1 1"  which are just random numbers i chose.  Do I have to use legitimate AS numbers when prepending or can I just pick random numbers?  Also, would i have to discuss this with my ISP?

Config Below:

 

 

interface FastEthernet0/0
 ip address 1.1.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 67.67.25.10 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 67.67.25.1
 standby 1 priority 99
!
router bgp 5500
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 network 67.67.25.0 mask 255.255.255.0
 neighbor 1.1.1.2 remote-as 3000
 neighbor 1.1.1.2 route-map PREPEND out
 neighbor 67.67.65.11 remote-as 5500
 no auto-summary
!         
i
!         !         
route-map PREPEND permit 10
 set as-path prepend 1 1 1

3 REPLIES
New Member

 You always need to prepend

 

You always need to prepend with your own AS multiple times. No you cannot use random AS numbers, as this could really confuse the world wide routing table.  Also those 'random' AS numbers might be valid AS that belong to someone else.

Its always best that you discuss with your ISP. Some AS have other mechanism more advanced like Level3 and Localpref, via communities.

New Member

Okay so what I am hearing you

Okay so what I am hearing you say is that if my assigned AS is 5500, then my config should look like this:

 

router bgp 5500
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 network 67.67.25.0 mask 255.255.255.0
 neighbor 1.1.1.2 remote-as 3000
 neighbor 1.1.1.2 route-map PREPEND out
 neighbor 67.67.65.11 remote-as 5500
 no auto-summary
!         
i
!         !         
route-map PREPEND permit 10
 set as-path prepend 5500 5500 5500

 

Correct?

Hall of Fame Super Silver

Hello Joshua,this last

Hello Joshua,

this last configuration of AS path prepending using your own AS number is correct for the reasons explained by Rothomas2.

eBGP has a loop avoidance rule that says look into AS path and if you find your own AS number reject the advertisement.

If you would use 1 in prepending instead of your AS you could make your networks unreachable by AS 1 as a minimum, and probably filtered by your ISP not expecting that AS number on the path.

 

Hope to help

Giuseppe

 

 

18975
Views
15
Helpful
3
Replies
CreatePlease login to create content