To configure a policy to filter unwanted PIM neighbors, include the neighbor-policy statement:
-
neighbor-policy policy-name;
For a list of hierarchy levels at which you can configure this statement, see the statement summary section for this statement.
The neighbor policy must be a properly structured policy statement that uses a prefix list containing the neighbor primary address (or any secondary IP addresses) in a prefix list and the reject option to reject the unwanted address. For example:
- prefix-list nbrGroup1 {
- 20.20.20.1/32;
- }
- policy-statement nbr-policy {
-
- from {
- prefix-list nbrGroup1;
- }
- then reject;
- }
For more information about configuring prefix lists or policy statements, see the JUNOS Policy Framework Configuration Guide.
The PIM interface compares neighbor IP addresses with the IP addresses in the policy statement before any hello processing takes place. If any of the neighbor IP addresses (primary or secondary) match the IP address specified in the prefix list, PIM drops the hello packet and rejects the neighbor.
If you configure a PIM neighbor policy after PIM has already established a neighbor adjacency with an unwanted PIM neighbor, the adjacency remains intact until the neighbor hold time expires. When the unwanted neighbor sends another hello message to update its adjacency, the router recognizes the unwanted address and rejects the neighbor.