In this scenario , we have a Virtual Machine - VM-A sending ICMP packets to its gateway 172.16.1.82 and we have a drop rule for the same for the destination IP 172.16.2.204 which is the first rule.
1. summarize-dvfilter output from hypervisor.
world 4010344 vmm0:VM-A vcUuid:'50 14 b0 21 53 67 26 a3-2b ba bd e8 12 b3 b9 42'
port 50331658 VM-A.eth0
vNic slot 2
name: nic-4010344-eth0-vmware-sfw.2
agentName: vmware-sfw
state: IOChain Attached
vmState: Detached
failurePolicy: failClosed
slowPathID: none
filter source: Dynamic Filter Creation
vNic slot 1
name: nic-4010344-eth0-dvfilter-generic-vmware-swsec.1
agentName: dvfilter-generic-vmware-swsec
state: IOChain Attached
vmState: Detached
failurePolicy: failClosed
slowPathID: none
filter source: Alternate Opaque Channel
As you can see from above output - rule is applied at Slot-2 of IO chain with failclosed policy (no traffic will route through the module until the failure is corrected.)
2) vsipioctl getrules -f nic-4010344-eth0-vmware-sfw.2
Using vsipioctl (Remember VSIP is the module which recieves the rule and push to the underlying VM -> vm-A for we have the L3/L2 rules in the below rule section.
ruleset domain-c7 {
# Filter rules
rule 1005 at 1 inout protocol any from addrset ip-vm-123 to ip 172.16.2.204 drop with log; ( VM-123 is the MOB ID for VM-A)
rule 1003 at 2 inout protocol ipv6-icmp icmptype 135 from any to any accept;
rule 1003 at 3 inout protocol ipv6-icmp icmptype 136 from any to any accept;
rule 1002 at 4 inout protocol udp from any to any port 67 accept;
rule 1002 at 5 inout protocol udp from any to any port 68 accept;
rule 1001 at 6 inout protocol any from any to any accept;
}
ruleset domain-c7_L2 {
# Filter rules
rule 1004 at 1 inout ethertype any from any to any accept;
}
3. vsipioctl getflows -f nic-4010344-eth0-vmware-sfw.2
Count retrieved from kernel active(L3,L4)=1, active(L2)+inactive(L3,L4)=0, drop(L2,L3,L4)=0
851f1da70000000b Active icmp 0800 OUT 1001 0 0 172.16.1.81 -> 172.16.1.82 8 0 61068 61068 727 727
In the above output VM-A 172.16.1.81 is sending a ICMP packet to gateway 172.16.1.82 and it is captured.