To troubleshoot firewall issues with a KVM host, you can look at the firewall rules that apply on the host.

Get the list of VIFs on the KVM host

localhost.localdomain> get firewall vifs 
***sample output***
                            Firewall VIFs                             
----------------------------------------------------------------------VIF count: 3
 1   239140cf-6c6c-464f-96eb-dfb13203171e
 2   eb277d27-0d28-4fb0-82ce-f59d86ea5bee
 3   afb2aa98-85ee-4bb4-8318-d699fa84c7f0

Discover firewall rules that apply to a specific VIF

Specify the VIF by UUID (in this example: 239140cf-6c6c-464f-96eb-dfb13203171e).
localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e ruleset rules 
***sample output***
                            Firewall Rules                            
----------------------------------------------------------------------
VIF UUID : 239140cf-6c6c-464f-96eb-dfb13203171e
 Ruleset UUID : 7c5838e5-ab75-427d-b4dd-9452e5607805
 Rule count : 5345
 rule 3073 inout protocol any from any to any profile fbb4b84f-f6c1-40c5-a509-f7c6f81fe7d9 accept with log tag dns;
 rule 3072 inout protocol any from any to any profile 6bc09f62-a188-4e36-9708-291af7237039 accept with log tag youtube.com;
 rule 3072 inout protocol any from any to any profile 27b9a15b-8071-4d09-a7e8-71eecfca0779 accept with log tag youtube.com;
 rule 3075 inout protocol tcp from addrset 81d95211-ab77-4f2d-beaf-3e15b045fb5e to addrset 3d41a802-a899-4464-ba2b-da9240598552 port 5000 accept with log tag portlist1;
 rule 3075 inout protocol tcp from addrset 81d95211-ab77-4f2d-beaf-3e15b045fb5e to addrset 3d41a802-a899-4464-ba2b-da9240598552 port 4992/0xfff8 accept with log tag portlist1;
 rule 3075 inout protocol tcp from addrset 81d95211-ab77-4f2d-beaf-3e15b045fb5e to addrset 3d41a802-a899-4464-ba2b-da9240598552 port 4864/0xff80 accept with log tag portlist1;

Get the list of address sets used in a specific VIF

Specify the VIF by UUID (in this example: 239140cf-6c6c-464f-96eb-dfb13203171e).
localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e addrsets 
***sample output***
                        Firewall Address Sets                         
----------------------------------------------------------------------
Address set count : 11
  UUID : 09f6da50-bcf2-4347-91a7-df00dca003a6
  Address count : 7
    mac 00:50:56:81:9b:2e
    mac 00:0c:29:03:4d:0d
    mac 00:0c:29:03:4d:03
    ip 10.172.177.231
    ip 10.172.177.111
    ip 192.168.1.11
    ip 192.168.2.11

Get the list of APPIDs and FQDNs used in a specific VIF

To check the FQDN profiles on the hyspervisor run the command localhost.localdomain> get firewall <vif-id> profile

Look for the URL which was configured on the policy UI.

Specify the VIF by UUID (in this example: 239140cf-6c6c-464f-96eb-dfb13203171e).
localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e profile 
***sample output***
                          Firewall Profiles                           
----------------------------------------------------------------------
Profiles count : 9
  UUID : 87de2b6b-bdf5-49b6-bae2-824f455a21a4
  Attribute count : 2
    FQDN : www\.youtube\.com
    FQDN : .*\.microsoft\.com

  UUID : 68dc8321-5cb5-4cd4-b1d1-14961d71c05e
  Attribute count : 1
    APP_ID : APP_SSL

Get the list of APPIDs and FQDNs used in a specific VIF

Specify the VIF by UUID (in this example: 239140cf-6c6c-464f-96eb-dfb13203171e).
localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e profile 
***sample output***
                          Firewall Profiles                           
----------------------------------------------------------------------
Profiles count : 9
  UUID : 87de2b6b-bdf5-49b6-bae2-824f455a21a4
  Attribute count : 2
    FQDN : www\.youtube\.com
    FQDN : .*\.microsoft\.com

  UUID : 68dc8321-5cb5-4cd4-b1d1-14961d71c05e
  Attribute count : 1
    APP_ID : APP_SSL

Discover FQDN of specific VIF

localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e fqdn 
                        Firewall Profile FQDN                         
----------------------------------------------------------------------
Profiles count  : 3
  Profile UUID  : 87de2b6b-bdf5-49b6-bae2-824f455a21a4
  FQDN count    : 2
    FQDN UUID   : 37efd4dd-961c-4756-afdd-ec04f44b6c10
    Value       : www\.youtube\.com
    IP set      : 172.217.6.46

Check connections through the Linux Conntrack module.

In this example, we look for flows between two specific IP addresses.

ovs-appctl dpctl/dump-conntrack -m | grep 192.168.1.15 | grep 192.168.1.16
icmp,orig=(src=192.168.1.15,dst=192.168.1.16,id=7972,type=8,code=0),
reply=(src=192.168.1.16,dst=192.168.1.15,id=7972,type=0,code=0),
id=2901517888,zone=61437,status=SEEN_REPLY|CONFIRMED,mark=2083,labels=0x1f

Check FQDN Roles and Profiles On KVM Hosts

Firewall rules can be created to filter specific domains with FQDN/URLs. To check the FQDN profiles on the hyspervisor run the command localhost.localdomain> get firewall <vif-id> profile. Look for the URL which was configured on the policy UI.

Sample nsxcli output for published context profile with APP_ID and FQDN entries:
localhost.localdomain> get firewall 989bdcf6-c6fc-47cd-86a3-367e552dba32 profile 
 Firewall Profiles 
----------------------------------------------------------------------
Profiles count : 3
 UUID : b34b868e-f113-4463-84a6-14736e50168e
 Attribute count : 1
 APP_ID : APP_HTTP
UUID : c4689750-d5e1-41f5-ba2c-0bfc846ed494
 Attribute count : 1
 FQDN : www\.youtube\.com
UUID : 77a599db-b2d3-4510-bbff-fa2bb31aceae
 Attribute count : 1
 APP_ID : APP_DNS
localhost.localdomain> get firewall 989bdcf6-c6fc-47cd-86a3-367e552dba32 fqdn
Firewall Profile FQDN 
----------------------------------------------------------------------
Profiles count : 1
Profile UUID : c4689750-d5e1-41f5-ba2c-0bfc846ed494
FQDN count : 1
FQDN UUID : 1c9d612c-c398-409e-b6f0-f1ec49b778fe
Value : www\.youtube\.com
IP set : 172.217.6.46, 172.217.164.110, 172.217.5.110, 216.58.194.206, 172.217.6.78, 172.217.0.46, 216.58.195.78, 216.58.194.174