Distributed Firewall Management in NSX

Knowledge Base

Distributed Firewall Management in NSX


Icons/System/eye-open Created with Sketch. 710 Views 27.02.2023 Cloud / Hosted Private Cloud

Objective

The distributed firewall feature in NSX allows filtering with all elements in your VMware cluster that are on Overlay or VLAN segments. It should be used normally on east-west connections (ovh-T1-gw), but it also works with elements of the VMware cluster that are connected on the north-south gateway (ovh-T0-gw). Filtering applies from the source (VM, segment, network, etc.).

To simplify the administration of NSX, it is possible to place tags on your elements (segments, virtual machines, roles, etc..) and create groups that contain the objects associated with the tags or IP address ranges (this solution should not be preferred).

Learn how to manage the distributed firewall by creating a rule that blocks traffic between a virtual machine and all virtual machines in another segment.

OVHcloud provides services for which you are responsible, with regard to their configuration and management. It is therefore your responsibility to ensure that they work properly.

This guide is designed to assist you as much as possible with common tasks. However, we recommend contacting a specialist provider if you experience any difficulties or doubts when it comes to managing, using or setting up a service on a server.

Requirements

Instructions

We will isolate communication between a virtual machine and all virtual machines in a segment bi-directionally by performing these operations :

  • Create two tags, one on a virtual machine and one on a segment.
  • Create two associated groups, one containing the first tag and the other the second.
  • Create a policy in the distributed firewall that will contain two rules:
    • A rule that will forbid traffic from the first group to the second.
    • Another rule that will forbid traffic from the second group to the first.

Creating tags

In the NSX interface, go to the Networking tab and click Segments to the left in Connectivity.

Then click on the three vertical dots to the left of the segment you want to tag and choose Edit from the menu.

01 Create tag on segment 01

To the right of Tags, enter ovsegment instead of tag and click Add Item(s) ovsegment below the input box.

01 Create tag on segment 02

Enter ov1 instead of Scope and click Add Item(s) ov1 below the input box.

01 Create tag on segment 02

Click the + button to the left of your tag.

01 Create tag on segment 03

The created tag is displayed in the bottom right of Tags, you can create more tags depending on your needs.

Click SAVE.

01 Create tag on segment 04

Click CLOSE EDITING to complete the markup for your segment.

01 Create tag on segment 05

Go to the Inventory tab and click Virtual Machines on the left in the inventory to view the list of virtual machines.

Then click on the three vertical dots to the left of the virtual machine that you want to tag and choose Edit from the menu.

02 Create tag on vm 01

Enter vm instead of Tag and click Add Item(s) vm below the input box.

02 Create tag on vm 02

Enter ov2 instead of Scope and click Add Item(s) ov2 below the input box.

02 Create tag on vm 03

Click the + button to the left of your tag.

02 Create tag on vm 04

The tag is created, click SAVE to save your changes.

02 Create tag on vm 05

Stay in the inventory and click Tags on the left to see the list of tags.

03 Show tags 01

Add groups that contain tags

In the inventory, go to Groups on the left and click ADD GROUP to create a group.

04 Create Group With tag on segment 01

Type g-segment01 below the Name column and click Set under the Compute Members column.

04 Create Group With tag on segment 02

Leave Generic selected and click + ADD CRITERION.

04 Create Group With tag on segment 03

Choose these settings :

  • Type : NSX Segment.
  • Tags : Equals ovsegment.
  • Scope: Equals ov1.

Click APPLY.

04 Create Group With tag on segment 04

Click SAVE.

04 Create Group With tag on segment 05

The group is created. Click View Members in the row of your group to display the members list.

04 Create Group With tag on segment 06

Click IP Addresses to view the IP addresses that are used on your segment and which have been automatically added to your group.

04 Create Group With tag on segment 07

Click NSX Segments to display the member segment of this group which has been automatically added from the criteria. You can click on CLOSE to close this window.

04 Create Group With tag on segment 08

Click ADD GROUP to create a second group.

05 Create Group With tag on VM 01

Type g-vm below the Name column and click Set under the Compute Members column.

05 Create Group With tag on VM 02

Leave Generic selected and click + ADD CRITERION.

05 Create Group With tag on VM 03

Choose these settings :

  • Type : Virtual Machine.
  • Tags : Equals vm.
  • Scope: Equals ov2.

Click on APPLY.

05 Create Group With tag on VM 04

Click SAVE.

05 Create Group With tag on VM 05

Click View Members in the row of your group to view the members.

05 Create Group With tag on VM 06

In the Virtual Machines section, you can see the tagged virtual machine that has been automatically added.

Click CLOSE to close this window.

05 Create Group With tag on VM 07

Setting up a distributed firewall rule

We will now create a two-way blocking rule, on the distributed firewall, between the two created groups.

Go to the Security tab, select Distributed Firewall and click + ADD POLICY.

06 Create distributed firewall rules 01

Name your strategy Isolate vm and segment.

06 Create distributed firewall rules 02

Click the three vertical dots to the left of your policy and choose Add Rule from the menu.

06 Create distributed firewall rules 03

Click the Pen icon to the right of Any in the Sources column.

06 Create distributed firewall rules 04

Stay on the groups tab, check the g-segment01 group and click APPLY.

06 Create distributed firewall rules 05

Click the Pen icon to the right of Any in the Destinations column.

06 Create distributed firewall rules 06

Select the g-vm group and click APPLY.

06 Create distributed firewall rules 07

Choose Drop to remove packages on this rule and click the three vertical dots to the left of your policy.

06 Create distributed firewall rules 08

Click Add Rule in the menu.

06 Create distributed firewall rules 09

Click the Pen icon to the right of Any in the Sources column.

06 Create distributed firewall rules 10

Select the g-vm group and click APPLY.

06 Create distributed firewall rules 11

Click the Pen icon to the right of Any in the Destinations column.

06 Create distributed firewall rules 12

Select the g-segment01 group and click APPLY.

06 Create distributed firewall rules 13

Choose Drop to remove packages from this rule and click publish to validate the creation of the policy and its two associated rules.

06 Create distributed firewall rules 14

Your rule is active, the traffic between the virtual machine member of the g-vm group and the segment member of the g-segment group is no longer possible.

06 Create distributed firewall rules 14

Go further

Getting started with NSX

Segment management in NSX

VMware Distributed Firewall in NSX documentation

If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.

Join our community of users on https://community.ovh.com/en/.

Related articles