gatekeeper icon indicating copy to clipboard operation
gatekeeper copied to clipboard

How to implement a whitelist for src addr?

Open ShawnLeung87 opened this issue 2 years ago • 3 comments

How to implement a whitelist for src addr? If lpm table is used as a whitelist, pkt_info in lookup_policy matches lookup_src_lpm_ipv4_policy first. Will pkt_info enter other policies?

ShawnLeung87 avatar Jul 12 '22 23:07 ShawnLeung87

Try the example at section "The policy script" of the wiki page "Tips for Deployments". This example is easy to modify to meet your needs.

AltraMayor avatar Jul 13 '22 12:07 AltraMayor

Aren't the packets processed linearly? For example lookup_policy Policy plan A, src 1.1.1.1 granted to any dst address Policy plan B, dst 2.2.2.2 deny access to any src address lookup_policy order, plan A first, planB second At this time, which policy plan should the data packets from 1.1.1.1 to 2.2.2.2 follow?

ShawnLeung87 avatar Jul 14 '22 01:07 ShawnLeung87

Given that (1) both plans match that packet, and (2) plan A comes before plan B, plan A will decide the fate of the flow (1.1.1.1, 2.2.2.2). That is, the flow will be granted.

AltraMayor avatar Jul 14 '22 12:07 AltraMayor