04-15-2012 04:57 AM
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;
}
}
}
Solved! Go to Solution.
04-16-2012 01:47 AM
If your incoming traffic is only destinated to 13.17.102.0/24 (orlonger) network , then the config looks fine...
04-16-2012 05:20 AM
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
04-16-2012 08:34 AM
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?
04-16-2012 08:52 AM - edited 04-16-2012 08:53 AM
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