DEV Community

Cover image for Azure Networking Fundamentals: How to Create and Secure Subnets with Network Security Groups
Oladimeji Zainab
Oladimeji Zainab

Posted on

Azure Networking Fundamentals: How to Create and Secure Subnets with Network Security Groups

Introduction

Network segmentation and access control are critical components of a secure cloud environment. In Microsoft Azure, subnets help organize resources within a virtual network, while Network Security Groups (NSGs) provide granular control over inbound and outbound traffic.

In this guide, I will walk through the process of creating a dedicated subnet, configuring a Network Security Group, defining an inbound security rule, and associating the NSG with the subnet. These steps demonstrate how to strengthen network security and establish controlled access to resources within an Azure Virtual Network.

  • From the Azure portal home page, in the search box, enter virtual networks.

update

  • Select the guided-project-vnet virtual network.

update

  • From the guided-project-vnet blade, under settings, select Subnets.

update

update

  • For Subnet purpose leave it as Default.
    update

  • For Name enter: ftpSubnet

update

  • Leave the rest of the settings alone and select Add.

update

Create a network security group

  • From the Azure portal home page, in the search box, enter virtual networks.

update

  • Select virtual networks under services

update

  • Select Network security groups.

update

  • Select + Create.

update

  • Verify the subscription is correct.

update

  • Select the guided-project-rg resource group.

update

  • Enter ftpNSG for the network security group name.

update

  • Select Review + create.

update

  • Once the validation is complete, select Create.

update

  • Wait for the screen to refresh and display Your deployment is complete.

update

  • Select Go to resource.

update

Create an inbound security rule

  • Under settings, select Inbound security rules.

update

  • Select + Add.

update

  • Change the Destination port ranges from 8080 to 22.

update

  • Select TCP for the protocol.

update

  • Set the name to ftpInbound.

update

  • Select Add.

update

Associate a network security group to a subnet

  • From the Azure portal home page, in the search box, enter virtual networks.

update

  • Select virtual networks under services.

update

  • Select the guided-project-vnet virtual network.

update

  • Under settings, select Subnets.

update

  • Select the ftpSubnet you created.

update

  • On the Edit subnet page, under the Security section heading, update the Network security group field to ftpNSG.

update

  • Select Save.

update

Conclusion

By completing these configurations, you have successfully created a dedicated subnet, deployed a Network Security Group, configured an inbound security rule, and associated the NSG with the subnet. This setup enhances the security posture of your Azure environment by allowing only authorized traffic to reach resources within the network.

Understanding and implementing network segmentation and security controls are essential cloud administration skills. As you continue your Azure journey, these foundational concepts will help you design more secure, scalable, and resilient cloud infrastructures.

Top comments (0)