[j-nsp] Testing a new BGP Policy Statement before applying
Chuck Anderson
cra at WPI.EDU
Sat Oct 10 15:31:15 EDT 2009
On Sat, Oct 10, 2009 at 09:08:40PM +0200, Jason Alex wrote:
> Dear All,
> I have configured a new Policy statement in my configuration , i
> want to test it in the current routing table before applying it to a BGP
> Peer as an export policy
>
> In cisco you can test a route-map before applying it using the below command
>
> "show ip bgp route-map "
>
> Is there is any similar command in JUNOS
Yes, "test policy". Keep in mind that different protocols have
different default policies that get applied if the prefix doesn't
match the configured policy. For BGP this is accept, but for RIP it
is reject. "test policy" always uses accept as the default policy, so
unless you explicitly reject all routes that you don't want to match
in your policy you will see more routes matching than you want.
http://www.juniper.net/techpubs/en_US/junos9.6/information-products/topic-collections/config-guide-policy/policy-protocol-import-export-defaults.html#id-10113228
http://www.juniper.net/techpubs/en_US/junos9.6/information-products/topic-collections/config-guide-policy/policy-routing-policies-tests.html#id-10144672
It is unfortunate that you cannot test policy chains. I always use a
REJECT policy as the last policy in my policy chains rather than build
the reject into a single policy, which basically makes "test policy"
useless for me. If chains were accepted, you could test them like
this:
test policy [ EGBP-IN REJECT ]
where EBGP-IN doesn't have any explicit "then reject" statements.
More information about the juniper-nsp
mailing list