Documentation

downpeernext-hopindex

Name

bgp router peer filter -  define a session filter

Synopsis

filter <in|out> 

Arguments

in|out
filter direction

Description

This command can be used to associate an input or an output filter to a BGP session with a peer. The direction of the filter is specified using the argument in|out. If the argument is "in", the filter is an input filter, i.e. it will be applied on routes received from the peer. If the argument is "out", the filter is an output filter, i.e. it will be applied on routes sent to the peer.

A filter is composed of a sequence of rules. You can add rules to an existing filter using command add-rule.

Here is an example script that defines an output filter for routes sent by router 1.0.0.1 to its peer 1.0.0.2. The filter is composed of two rules. The first rule rejects (denies) all routes that have community 1. The second rule accepts all remaining routes. bgp router 1.0.0.1 peer 1.0.0.2
  filter out
    add-rule
      match "community is 1"
      action "deny"
      exit
    add-rule
      match "any"
      action "accept"
      exit

Sub-commands

See also

It is possible to show the content of a filter using the command bgp router X peer Y filter in/out show.