Routing
Reply
Contributor
rawdeal
Posts: 24
Registered: ‎11-23-2009
0
Accepted Solution

AS-Path Prepending in Junos

Hi! We have to edge routers one is Cisco and other is Juniper M7i. Both have BGP running with our ISP. Currently incoming traffic from ISP into our network is coming through M7i interface. I want to make Cisco link more preferred or(M7i link less preferred). For this we can use AS-Path prepending on M7i right?

 

So I want to be sure how would you configure that in Juniper. If it was Cisco I would have done something like this:

router bgp 65001
 neighbor 4.35.56.2 remote-as 45465
 neighbor 4.35.56.2 route-map prepend out
!
route-map prepend permit 10
 set as-path prepend 24367 25367 25367

 

So in Junos does the follwoing configuration seem ok?

 

protocols {
    bgp {
        group STC {
            import FROM_STC;
            export TO_STC;
            neighbor 4.35.56.2 {
                local-address 4.35.56.1;
                peer-as 45465;
            }
        }
       
        }
           
    
}

policy-options {
    policy-statement FROM_STC {
        term 1 {
            from {
                route-filter 0.0.0.0/0 exact;
            }
            then accept;
        }
        term 2 {
            then reject;
        }
    }
    policy-statement TO_STC {
        term 1 {
            from {
                protocol direct;
                route-filter 13.17.102.0/24 orlonger;
            }
            then{
        as-path-prepend " 24367 25367 25367";
         accept;
        }
        }
        term 2 {

            then reject;
        }
    }
}

Juniper Employee
jstar
Posts: 22
Registered: ‎04-28-2008
0

Re: AS-Path Prepending in Junos

If your incoming traffic is only destinated to 13.17.102.0/24 (orlonger) network , then the config looks fine...

Contributor
karlr
Posts: 37
Registered: ‎09-20-2010
0

Re: AS-Path Prepending in Junos

You are only prepending in one direction. If you want the traffic to be symmetric you might want to prepend your ISPs ASn on the import in the same matter.

 

/K

Contributor
rawdeal
Posts: 24
Registered: ‎11-23-2009
0

Re: AS-Path Prepending in Junos

Thanks for your reply, well I tried this config but still traffic was coming in via Juniper because I think looking at the looking glass it seemed that juniper is advertising 13.17.102.0/27 and Cisco is advertisisng 13.17.102.0/24. I think its because of the " from protocol direct" keyword as both routers have /27 ip address on their interface to ISP. 

 

How would i make juniper to advertise /24 address?

Contributor
ggglabs
Posts: 20
Registered: ‎12-15-2011
0

Re: AS-Path Prepending in Junos

[ Edited ]

    policy-statement TO_STC {
        term 1 {
            from {
                protocol static; <------
                route-filter 13.17.102.0/24 exact;  <------
            }
            then{
        as-path-prepend " 24367 25367 25367";
         accept;
        }
        }
        term 2 {

            then reject;
        }
    }
}

 

 

Also make sure you have the /24 prefix in routing table:

set routing-options static route 13.17.102.0/24 discard

 

 

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.