A method and mechanism of controlling information flow in a firewall. A
firewall controls the flow of information between different communities.
The enforcement method and mechanism uses a database of associations of
sets of communities corresponding to network addresses. Upon receiving an
incoming data packet, a packet community set (PCS) is deterined for the
data packet. If the PCS is not a subset of an interface community set
(IFCS) of the interface upon which the data packet was received, the data
packet is discarded. Otherwise, a firewall rule match is determined for
the data packet. If a rule match is detected, a PCS attribute of the
matching rule is compared to the PCS of the data packet. If the PCS
attribute of the rule matches the PCS of the data packet and the rule
indicates the data packet is to be forwarded, the PCS of the data packet
is changed to a second PCS indicated by the matching rule. If the new PCS
of the data packet is a subset of an IFCS of the interface upon which the
data packet is to be output, the data packet is transmitted. Otherwise,
the data packet is discarded.