Is the vCenter a Virtual Machine?
vCenter (if it is a VM) is normally excluded from DFW so we do not lock ourselves out from the vCenter
Exclude Virtual Machines from Firewall Protection
VMware recommends that you place the following service virtual machines in the Exclusion List to allow traffic to flow freely.
vCenter Server. It can be moved into a cluster that is protected by Firewall, but it must already exist in the exclusion list to avoid connectivity issues.
However, if you want NSX DFW to protect vCenter you can do that as long as the vSphere cluster hosting the vCenter VM is prepared for NSX.
You would also need to allow any other object to communicate to the vCenter such as range of ESXi host management IP, range of other management VM that need access to the vCenter
See these 2 KBs
Network ports required to access vCenter Server, ESXi, and ESX hosts (1012382) | VMware KB
Network Port requirements for VMware NSX for vSphere 6.x (2079386) | VMware KB
The steps would be something like below:
1. Create an IP Set for the IP range for example 192.168.1.0/24
2. Create an IP Set for the IP range of ESXi host management IP and other management VM that need access to the vCenter
3. (Optional if you are going to use Service Composer) create a Security Group to include the newly created IP Sets - the specific IP range that need access to vCenter, ESXi host, other management VM.
4. (Optional if you are gointg to use Service Composer) create a Security Group to include the vCenter VM
5. Create a rule to Allow from the created IP Sets to vCenter VM on Any Services (or from IP Sets Security Group to vCenter Security Group)
6. Create a rule below rule created in step #5 to Allow from Any to vCenter VM on Any services. Set the rule to Log and monitor this rule from syslog or Flow Monitoring and see if you missed any IP or object to be included in rule created in step #5. Once you happy, set this rule to Block.
If somehow you created wrong rule and got yourself locked out from vCenter, follow this KB vCenter Server access is blocked after creating a Deny All rule in DFW (2079620) | VMware KB or this blog NSX for vSphere: recovering from Distributed Firewall vCenter lock-out | Telecom Occasionally and start again
If you are using vCenter Server Appliance (vCSA) you can also create this firewall rule from the vCSA and only restrict access from specific IP range to access the vCSA.
VMware vSphere 6.5 Documentation Library-Edit the Firewall Settings of the vCenter Server Appliance