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
- Name
- Access(Allow/Deny)
- Description
- DestinationAddressPrefix
- DestinationPortRange
- Direction(Inbound/Outbound)
- Priority
- Protocol(tcp/udp)
- SourceAddressPrefix
- 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:
Post a Comment