What do you someone breaks something? I post the solution here...

Kubernetes (K8s/K3d) / Terraform / Ansible / Linux / AWS / Docker / Bash / Python / ELK / CI/CD / Java / Traefik / Nginx / CentOs / Ubuntu


Creating Network Rules and Adding to Network Security Group





Creating Network Rules and Adding to Network Security Group(Part 3)


NETWORK SECURITY GROUP:
          NSG is list of Security rules that allow or deny network traffic to resources connected to azure VNET(Virtual Network). NSG can be associated to subnets they also can be associated to a subnet or individual network interfaces attached to VMs 

NSG Rules:
       These rules define the flow of network traffic . Properties of NSG rules in azure are 
  1. Name 
  2.  Access(Allow/Deny)
  3. Description
  4. DestinationAddressPrefix 
  5.  DestinationPortRange
  6. Direction(Inbound/Outbound)
  7. Priority
  8. Protocol(tcp/udp)
  9. SourceAddressPrefix
  10. SourcePortRange 


$RG="Osgroup"
$LOCATION="South Central US"

$FirstRul1=New-AzureRmNetworkSecurityRuleConfig -Name rule1 -Access Allow -Description "Allow all" ` -DestinationAddressPrefix * -DestinationPortRange * -Direction Inbound -Priority 100 ` -Protocol Tcp -SourceAddressPrefix Internet -SourcePortRange *









$NSG=New-AzureRmNetworkSecurityGroup -Location $LOCATION -Name OsgroupNSG ` -ResourceGroupName $RG -SecurityRules $FirstRule


$NSG


Finally !!! we are done with creating NSG rule and Adding it to NSG Group you can check $NSG variable for the NSG details 


Thanks !!! Have nice day

For information about Virtual network https://osgroup-techies.blogspot.in/2017/04/powershell-script-to-create-subnet-and.html




No comments:

Powered by Blogger.