Recently, there was a customer asking me a question if the distributed firewall works on both ingress and egress traffic or just the egress traffic. Although, this is very well documented, he wanted me to demonstrate this capability.
Thus, what do I do? I spin up a quick LAB for NSX from Hands on Labs, and try and demonstrate the same and I will try and use the power of “Applied to” field to showcase the same.
I log into the NSX Manager through CLI, and as generally, we have the three clusters part of the vCenter, seen below.
I pick up cluster “RegionA01-COMP01” and the pull out the ESXi hosts part of the cluster.
Then, I pick up an ESXI host “esx-01a.corp. local” and pull out the list of all VMs on that ESXi host.
Then, using the summarize-dvfilter command I pull out al the vNIc name for dfw of the virtual machines.
Here, I am just showing this for the “web-02a.corp. local” virtual machine, followed by all the rules getting applied on that machine.
Here, I am just showing this for the “web-01a.corp. local” virtual machine, followed by all the rules getting applied on that machine.
As, you can see above in the rules for both the VMs, there is no specific “ICMP” allow rule present and the default rule 1001 is set to “ANY: ANY”: DROP.
Below, are the screenshots for the IP addresses of both the WEB machines and as expected these two machines cannot communicate to each other.
Now, I create a new rule for ICMP from “web-01a.corp. local” to “web-02a.corp. local” virtual machine, and then just apply onto “web-01a.corp. local” virtual machine.
However, as you can see below it does not work. This is because the rules are not applied to the “web-02a.corp. local”, and hence the icmp packets at dropped on the destination machine. This can also be seen at the rules using the commands shown earlier.
Now, I add both the machines under the “Applied to” field for them to get the allow rules applied.
And, now once we try to ping “It works”. This demonstrates true “Micro Segmentation” for both ingress and egress traffic and also the power of “Applied to” field.
Hope, this will help !!!