This article provides configuration examples when multiple communities need to be configured under a single policy.
To match community A OR community B
This configuration can be used when accepting routes that contain either community 111:111 or community 222:222.
policy-options { policy-statement A-OR-B { from community [ A B ]; then accept; } community A members 111:111; community B members 222:222; } set policy-options policy-statement A-OR-B from community A set policy-options policy-statement A-OR-B from community B set policy-options policy-statement A-OR-B then accept set policy-options community A members 111:111 set policy-options community B members 222:222
To match community A AND community B
This configuration can be used when accepting routes with both community 111:111 and 222:222.
policy-options { policy-statement A-AND-B { from community AB; then accept; } community AB members [ 111:111 222:222 ]; set policy-options policy-statement A-AND-B from community AB set policy-options policy-statement A-AND-B then accept set policy-options community AB members 111:111 set policy-options community AB members 222:222